FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Assembly::TraceAssembler< Trafo_ > Class Template Reference

Trace Integral Assembler class template. More...

#include <trace_assembler.hpp>

Public Types

typedef TrafoType::MeshType MeshType
 
typedef TrafoType::ShapeType ShapeType
 
typedef Trafo_ TrafoType
 

Public Member Functions

 TraceAssembler (const TrafoType &trafo)
 Constructor. More...
 
void add_facet (Index ifacet)
 Adds a single facet to the assembler. More...
 
void add_mesh_part (const Geometry::MeshPart< MeshType > &mesh_part)
 Adds all facets of a mesh part to the assembler. More...
 
template<typename Job_ >
void assemble (Job_ &job)
 Executes a trace assembly job. More...
 
void clear ()
 Clears the assembler. More...
 
void compile ()
 Compiles the assembler for all facets that have been added manually. More...
 
void compile_all_facets (bool inner, bool outer)
 Compiles the assembler for all inner and/our outer facets of the underlying mesh. More...
 
const TrafoType & get_trafo () const
 

Static Public Attributes

static constexpr int facet_dim = shape_dim-1
 
static constexpr int shape_dim = ShapeType::dimension
 

Protected Member Functions

bool _find_local_facet (Index face, Index cell, int &facet, int &ori)
 Helper function: tries to find the local facet index for a given facet/cell pair. More...
 

Protected Attributes

std::vector< int > _cell_facet
 
std::vector< Index_cells
 the indices of all cells and facets to loop over during assembly More...
 
std::vector< int > _facet_mask
 the facet masks, local cell facet indices and facet orientation codes More...
 
std::vector< int > _facet_ori
 
std::vector< Index_facets
 
const TrafoType & _trafo
 a reference to the trafo More...
 

Detailed Description

template<typename Trafo_>
class FEAT::Assembly::TraceAssembler< Trafo_ >

Trace Integral Assembler class template.

This class can be used to assemble operators, functionals and various other quantities on (a part of) the boundary of a mesh or any other set of mesh facets.

After you have constructed the trace assembler object, you still have to tell the assembler on which set of facets the assembly should take place before you can actually assemble anything. There are 2 ways to do this:

  • You can tell the assembler to assemble on all inner and/or outer facets of the mesh by calling the compile_all_facets() function.
  • You can add individual facets or whole mesh parts to the assembler by calling the add_facet() and add_mesh_part() functions. Afterwards, you need to compile the assembler by calling the compile() function.
Note
Each trace assembler object is tied to the trafo object that is has been constructed on, i.e. if you have several different trafo objects (such as in a multigrid scenario) then you also need several trace assembler objects – one for each trafo object. Also, a trace assembler always assembles over the elements of its trafo, so all FE spaces used in the assembly have to be defined on the same trafo object as the trace assembler.
Template Parameters
Trafo_The transformation on whose underlying mesh the assembly should take place
Note
This class currently does not employ any sort of multi-threading, however, the documentation of the classes and functions related to this class may already be written as if this class already supported assembly with multiple threads – which it actually may do sometime in the future.
Author
Peter Zajac

Definition at line 372 of file trace_assembler.hpp.

Member Typedef Documentation

◆ MeshType

template<typename Trafo_ >
typedef TrafoType::MeshType FEAT::Assembly::TraceAssembler< Trafo_ >::MeshType

Definition at line 376 of file trace_assembler.hpp.

◆ ShapeType

template<typename Trafo_ >
typedef TrafoType::ShapeType FEAT::Assembly::TraceAssembler< Trafo_ >::ShapeType

Definition at line 377 of file trace_assembler.hpp.

◆ TrafoType

template<typename Trafo_ >
typedef Trafo_ FEAT::Assembly::TraceAssembler< Trafo_ >::TrafoType

Definition at line 375 of file trace_assembler.hpp.

Constructor & Destructor Documentation

◆ TraceAssembler()

template<typename Trafo_ >
FEAT::Assembly::TraceAssembler< Trafo_ >::TraceAssembler ( const TrafoType &  trafo)
inlineexplicit

Constructor.

Parameters
[in]trafoA resident reference to the trafo on which to assemble

Definition at line 397 of file trace_assembler.hpp.

Member Function Documentation

◆ _find_local_facet()

template<typename Trafo_ >
bool FEAT::Assembly::TraceAssembler< Trafo_ >::_find_local_facet ( Index  face,
Index  cell,
int &  facet,
int &  ori 
)
inlineprotected

Helper function: tries to find the local facet index for a given facet/cell pair.

Parameters
[in]faceThe global index of the facet that is adjacent to cell
[in]cellThe global index of the cell/element that is adjacent to face
[out]facetThe local facet index of face with respect to cell
[out]oriThe local facet orientation code of face with respect to the corresponding reference element facet of cell
Returns
true, if the local facet was identified, or false, if face does not seem to be a facet of cell

Definition at line 652 of file trace_assembler.hpp.

References FEAT::Assembly::TraceAssembler< Trafo_ >::_trafo.

Referenced by FEAT::Assembly::TraceAssembler< Trafo_ >::compile(), and FEAT::Assembly::TraceAssembler< Trafo_ >::compile_all_facets().

◆ add_facet()

template<typename Trafo_ >
void FEAT::Assembly::TraceAssembler< Trafo_ >::add_facet ( Index  ifacet)
inline

Adds a single facet to the assembler.

Parameters
[in]facetThe index of the facet to be added to the assembler.

Definition at line 428 of file trace_assembler.hpp.

References FEAT::Assembly::TraceAssembler< Trafo_ >::_facet_mask, and ASSERTM.

◆ add_mesh_part()

template<typename Trafo_ >
void FEAT::Assembly::TraceAssembler< Trafo_ >::add_mesh_part ( const Geometry::MeshPart< MeshType > &  mesh_part)
inline

Adds all facets of a mesh part to the assembler.

Parameters
[in]mesh_partThe mesh part whose facets are to be added.

Definition at line 440 of file trace_assembler.hpp.

References FEAT::Assembly::TraceAssembler< Trafo_ >::_facet_mask.

◆ assemble()

◆ clear()

template<typename Trafo_ >
void FEAT::Assembly::TraceAssembler< Trafo_ >::clear ( )
inline

Clears the assembler.

Definition at line 412 of file trace_assembler.hpp.

References FEAT::Assembly::TraceAssembler< Trafo_ >::_cells.

◆ compile()

template<typename Trafo_ >
void FEAT::Assembly::TraceAssembler< Trafo_ >::compile ( )
inline

Compiles the assembler for all facets that have been added manually.

This function compiles the assembler for all facets that have been added manually by previous calls of the add_facet or add_mesh_part functions.

Note
If you want to compile the assembler for all facets of the trafo's underlying mesh, consider using the compile_all_facets() function instead.

Definition at line 457 of file trace_assembler.hpp.

References FEAT::Assembly::TraceAssembler< Trafo_ >::_cells, FEAT::Assembly::TraceAssembler< Trafo_ >::_facet_mask, FEAT::Assembly::TraceAssembler< Trafo_ >::_find_local_facet(), FEAT::Assembly::TraceAssembler< Trafo_ >::_trafo, FEAT::Adjacency::Graph::image_begin(), FEAT::Adjacency::Graph::image_end(), FEAT::Adjacency::injectify_transpose, and XABORTM.

◆ compile_all_facets()

template<typename Trafo_ >
void FEAT::Assembly::TraceAssembler< Trafo_ >::compile_all_facets ( bool  inner,
bool  outer 
)
inline

Compiles the assembler for all inner and/our outer facets of the underlying mesh.

Parameters
[in]innerSpecifies whether the mesh's inner facets are to be added to the assembler or not.
[in]outerSpecifies whether the mesh's outer (i.e. boundary) facets are to be added to the assembler or not.

Definition at line 508 of file trace_assembler.hpp.

References FEAT::Assembly::TraceAssembler< Trafo_ >::_cells, FEAT::Assembly::TraceAssembler< Trafo_ >::_facet_mask, FEAT::Assembly::TraceAssembler< Trafo_ >::_find_local_facet(), FEAT::Assembly::TraceAssembler< Trafo_ >::_trafo, FEAT::Adjacency::Graph::degree(), FEAT::Adjacency::Graph::image_begin(), FEAT::Adjacency::Graph::image_end(), FEAT::Adjacency::injectify_transpose, XABORTM, and XASSERT.

◆ get_trafo()

Member Data Documentation

◆ _cell_facet

template<typename Trafo_ >
std::vector<int> FEAT::Assembly::TraceAssembler< Trafo_ >::_cell_facet
protected

Definition at line 386 of file trace_assembler.hpp.

◆ _cells

template<typename Trafo_ >
std::vector<Index> FEAT::Assembly::TraceAssembler< Trafo_ >::_cells
protected

◆ _facet_mask

template<typename Trafo_ >
std::vector<int> FEAT::Assembly::TraceAssembler< Trafo_ >::_facet_mask
protected

◆ _facet_ori

template<typename Trafo_ >
std::vector<int> FEAT::Assembly::TraceAssembler< Trafo_ >::_facet_ori
protected

Definition at line 386 of file trace_assembler.hpp.

◆ _facets

template<typename Trafo_ >
std::vector<Index> FEAT::Assembly::TraceAssembler< Trafo_ >::_facets
protected

Definition at line 388 of file trace_assembler.hpp.

◆ _trafo

◆ facet_dim

template<typename Trafo_ >
constexpr int FEAT::Assembly::TraceAssembler< Trafo_ >::facet_dim = shape_dim-1
staticconstexpr

Definition at line 380 of file trace_assembler.hpp.

◆ shape_dim

template<typename Trafo_ >
constexpr int FEAT::Assembly::TraceAssembler< Trafo_ >::shape_dim = ShapeType::dimension
staticconstexpr

Definition at line 379 of file trace_assembler.hpp.


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