LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Public Member Functions | Private Member Functions | Private Attributes | List of all members
projects::dpg::PrescribedSignProvider Class Reference

Class which allows evaluation of the \( \text{sgn}_K \) function. More...

#include </home/nico/bildung/SemVI/thesis/lehrfempp/projects/dpg/dpg_tools.h>

Public Member Functions

 PrescribedSignProvider ()=default
 
 PrescribedSignProvider (const PrescribedSignProvider &)=delete
 
 PrescribedSignProvider (PrescribedSignProvider &&) noexcept=default
 
PrescribedSignProvideroperator= (const PrescribedSignProvider &)=delete
 
PrescribedSignProvideroperator= (PrescribedSignProvider &&) noexcept=default
 
virtual ~PrescribedSignProvider ()=default
 
 PrescribedSignProvider (std::shared_ptr< const lf::mesh::Mesh > mesh_ptr)
 main constructor, initializes the \(\text{sgn}_K\) function for all cells \( K \) of the passed mesh More...
 
int PrescribedSign (const lf::mesh::Entity &element, const lf::mesh::Entity &edge) const
 evaluates the the \( \text{sgn}_K \) function at the midpoint of the edge \( e \) of cell \( K \) More...
 

Private Member Functions

void init ()
 

Private Attributes

std::shared_ptr< const lf::mesh::Meshmesh_ptr_
 
std::shared_ptr< lf::mesh::utils::CodimMeshDataSet< int > > maxElement_ptr_
 

Detailed Description

Class which allows evaluation of the \( \text{sgn}_K \) function.

DPG formulations can involve the notion of prescribed edge normals \( n_e \). These can be represented by a unit vector field on the mesh skeleton that is normal to the edges and points outwards on the boundary. The prescribed edge normals are fully specified by the definition of a function \( \text{sgn}_K: K \rightarrow \{ -1,1 \} \) that distinguishes them from the outer normals \(n_K\) on each cell \( K \) of the mesh.

\[ \text{sgn}_K = \begin{cases} 1 & \text{if } n_K = n_e \\ -1 & \text{if } n_K = - n_e \end{cases} \]

This class provides an implementation of the \( \text{sgn}_K \) function that further guarantues that the function is constant on any edge \( e \) of \( \partial K \). In particular the function is specified fully on any cell \( K \) by evaluating it in all midpoints of the edges of \( K \).

Definition at line 81 of file dpg_tools.h.

Constructor & Destructor Documentation

◆ PrescribedSignProvider() [1/4]

projects::dpg::PrescribedSignProvider::PrescribedSignProvider ( )
default

default constructors and destructors:

Note
creates an invalid object that cannot be used.

◆ PrescribedSignProvider() [2/4]

projects::dpg::PrescribedSignProvider::PrescribedSignProvider ( const PrescribedSignProvider )
delete

◆ PrescribedSignProvider() [3/4]

projects::dpg::PrescribedSignProvider::PrescribedSignProvider ( PrescribedSignProvider &&  )
defaultnoexcept

◆ ~PrescribedSignProvider()

virtual projects::dpg::PrescribedSignProvider::~PrescribedSignProvider ( )
virtualdefault

◆ PrescribedSignProvider() [4/4]

projects::dpg::PrescribedSignProvider::PrescribedSignProvider ( std::shared_ptr< const lf::mesh::Mesh mesh_ptr)
inlineexplicit

main constructor, initializes the \(\text{sgn}_K\) function for all cells \( K \) of the passed mesh

Parameters
mesh_ptrunderlying mesh

Definition at line 98 of file dpg_tools.h.

References init().

Member Function Documentation

◆ init()

void projects::dpg::PrescribedSignProvider::init ( )
private

Initialization of the maxElement data set

Definition at line 127 of file dpg_tools.cc.

References lf::mesh::utils::CodimMeshDataSet< T >::DefinedOn(), maxElement_ptr_, mesh_ptr_, and lf::mesh::Entity::SubEntities().

Referenced by PrescribedSignProvider().

◆ operator=() [1/2]

PrescribedSignProvider & projects::dpg::PrescribedSignProvider::operator= ( const PrescribedSignProvider )
delete

◆ operator=() [2/2]

PrescribedSignProvider & projects::dpg::PrescribedSignProvider::operator= ( PrescribedSignProvider &&  )
defaultnoexcept

◆ PrescribedSign()

int projects::dpg::PrescribedSignProvider::PrescribedSign ( const lf::mesh::Entity element,
const lf::mesh::Entity edge 
) const

evaluates the the \( \text{sgn}_K \) function at the midpoint of the edge \( e \) of cell \( K \)

Parameters
elementthe cell \( K \) on which the function is evauated
edgethe edge \( e \subset \partial K \) for which the function is evaluated.
Returns
value of \( \text{sgn}_K \) at the midpoint of \( e \).
Note
By construction the value of the function is constant along an edge \( e \subset \partial K \) and this is the value function on the complete edge \( e \)

Definition at line 143 of file dpg_tools.cc.

References lf::mesh::utils::CodimMeshDataSet< T >::DefinedOn(), maxElement_ptr_, and mesh_ptr_.

Member Data Documentation

◆ maxElement_ptr_

std::shared_ptr<lf::mesh::utils::CodimMeshDataSet<int> > projects::dpg::PrescribedSignProvider::maxElement_ptr_
private

a mesh dataset for edges. maxElement_ptr_(edge) equals the maximum entity index of a cell whose subentity edge is. We define the prescribed normal on that edge to be the outer normal of that cell with the bigger index.

Note
An edge can only be a subentity of maximum two cells, so this uniquely determines the sign.

Definition at line 135 of file dpg_tools.h.

Referenced by init(), and PrescribedSign().

◆ mesh_ptr_

std::shared_ptr<const lf::mesh::Mesh> projects::dpg::PrescribedSignProvider::mesh_ptr_
private

the underlying mesh

Definition at line 127 of file dpg_tools.h.

Referenced by init(), and PrescribedSign().


The documentation for this class was generated from the following files: