pub trait FunctionSpace {
type T: RlstScalar;
type TMesh: RlstScalar;
type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash;
type Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor, T = Self::TMesh>;
type FiniteElement: FiniteElement<CellType = Self::EntityDescriptor, T = Self::T>;
// Required methods
fn mesh(&self) -> &Self::Mesh;
fn elements(&self) -> &[Self::FiniteElement];
fn entities_by_element(&self, element_index: usize) -> Option<&[usize]>;
fn entity_dofs(
&self,
entity_type: Self::EntityDescriptor,
entity_number: usize,
) -> Option<&[usize]>;
fn entity_closure_dofs(
&self,
entity_type: Self::EntityDescriptor,
entity_number: usize,
) -> Option<&[usize]>;
fn process_size(&self) -> usize;
fn process_owned_size(&self) -> usize;
fn global_size(&self) -> usize;
fn global_dof_index(&self, process_dof_index: usize) -> usize;
fn ownership(&self, process_dof_index: usize) -> Ownership;
}Expand description
Function space.
There will be three ways that the degrees of freedom (DOFs) are numbered:
- The local DOF numbering is the numbering of the DOFs on a single cell.
- The process DOF numbering is the numbering of the DOFs local to the current process. This includes owned and ghost DOFs.
- The global DOF numbering is the numberinf of the DOFs across all processes. Note that if the mpi feature is not enabaled, then this is the same as the process DOF numbering.
DOFs included in function spaces are either owned or ghosts. Owned DOFs are owned by the current process. Ghost DOFs are owned by another process but information about them is known by the current process because (eg) they neighbour a cell on this process. If the mpi feature is disabled, all DOFs will be owned DOFs.
Required Associated Types§
Sourcetype EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash
type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash
Type used as identifier of different entity types
Sourcetype Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor, T = Self::TMesh>
type Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor, T = Self::TMesh>
The type for the mesh this function space is defined on
Sourcetype FiniteElement: FiniteElement<CellType = Self::EntityDescriptor, T = Self::T>
type FiniteElement: FiniteElement<CellType = Self::EntityDescriptor, T = Self::T>
The type for the finite element this mesh is defined by
Required Methods§
Sourcefn elements(&self) -> &[Self::FiniteElement]
fn elements(&self) -> &[Self::FiniteElement]
The finite elements used in this function space
Sourcefn entities_by_element(&self, element_index: usize) -> Option<&[usize]>
fn entities_by_element(&self, element_index: usize) -> Option<&[usize]>
A list of entity indices that use the element with the given index
Sourcefn entity_dofs(
&self,
entity_type: Self::EntityDescriptor,
entity_number: usize,
) -> Option<&[usize]>
fn entity_dofs( &self, entity_type: Self::EntityDescriptor, entity_number: usize, ) -> Option<&[usize]>
Get the process DOF numbers associated with the given entity
Sourcefn entity_closure_dofs(
&self,
entity_type: Self::EntityDescriptor,
entity_number: usize,
) -> Option<&[usize]>
fn entity_closure_dofs( &self, entity_type: Self::EntityDescriptor, entity_number: usize, ) -> Option<&[usize]>
Get the process DOF numbers associated with the closure of the given entity
The closure of an entity includes the lower dimensional entities that are on the boundary of the entity. For example, the closure of a triangle includes its edges and vertices.
Sourcefn process_size(&self) -> usize
fn process_size(&self) -> usize
Get the number of process DOFs
This count includes owned and ghost DOFs
Sourcefn process_owned_size(&self) -> usize
fn process_owned_size(&self) -> usize
Get the number of owned process DOFs
Sourcefn global_size(&self) -> usize
fn global_size(&self) -> usize
Get the number of DOFs on all processes
Sourcefn global_dof_index(&self, process_dof_index: usize) -> usize
fn global_dof_index(&self, process_dof_index: usize) -> usize
Get the global DOF index associated with a process DOF index
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".