Skip to main content

FunctionSpace

Trait FunctionSpace 

Source
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:

  1. The local DOF numbering is the numbering of the DOFs on a single cell.
  2. The process DOF numbering is the numbering of the DOFs local to the current process. This includes owned and ghost DOFs.
  3. 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§

Source

type T: RlstScalar

Scalar type

Source

type TMesh: RlstScalar

Scalar type for geometry

Source

type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash

Type used as identifier of different entity types

Source

type Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor, T = Self::TMesh>

The type for the mesh this function space is defined on

Source

type FiniteElement: FiniteElement<CellType = Self::EntityDescriptor, T = Self::T>

The type for the finite element this mesh is defined by

Required Methods§

Source

fn mesh(&self) -> &Self::Mesh

The mesh that this function space is defined on

Source

fn elements(&self) -> &[Self::FiniteElement]

The finite elements used in this function space

Source

fn entities_by_element(&self, element_index: usize) -> Option<&[usize]>

A list of entity indices that use the element with the given index

Source

fn entity_dofs( &self, entity_type: Self::EntityDescriptor, entity_number: usize, ) -> Option<&[usize]>

Get the process DOF numbers associated with the given entity

Source

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.

Source

fn process_size(&self) -> usize

Get the number of process DOFs

This count includes owned and ghost DOFs

Source

fn process_owned_size(&self) -> usize

Get the number of owned process DOFs

Source

fn global_size(&self) -> usize

Get the number of DOFs on all processes

Source

fn global_dof_index(&self, process_dof_index: usize) -> usize

Get the global DOF index associated with a process DOF index

Source

fn ownership(&self, process_dof_index: usize) -> Ownership

Get ownership of a process DOF

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T: RlstScalar, TMesh: RlstScalar, E: Debug + PartialEq + Eq + Clone + Copy + Hash, G: Mesh<EntityDescriptor = E, T = TMesh>, F: MappedFiniteElement<CellType = E, T = T>> FunctionSpace for FunctionSpaceImpl<'a, T, TMesh, E, G, F>