| FEAT 3
    Finite Element Analysis Toolbox | 
Constructs RefinementTemplates from RawTemplates. More...
#include <template_builder.hpp>
| Public Member Functions | |
| template<int dim_, int codim_> | |
| std::pair< Index, int > | correct_for_orientation (RefinementTypeByDim< dim_ > type, int orientation, Index idx) | 
| Correct an index for orientation.  More... | |
| template<int dim_> | |
| const RefinementTemplateByDim< dim_ > & | get_template (RefinementTypeByDim< dim_ > type) | 
| template<int dim_> | |
| bool | has_template (RefinementTypeByDim< dim_ > type) | 
| void | stats () | 
| print some stats about maximum children in the raw data  More... | |
| template<int dim_> | |
| const std::array< std::uint64_t, Shape::FaceTraits< Shape::Hypercube< dim_ >, 0 >::count > & | type_adjustment (Index type) | 
| Private Types | |
| using | CellMap = TemplateMapByDim< 3 > | 
| Map type from refinement types to cell templates.  More... | |
| using | EdgeMap = TemplateMapByDim< 1 > | 
| Map type from refinement types to edge templates.  More... | |
| using | FaceMap = TemplateMapByDim< 2 > | 
| Map type from refinement types to face templates.  More... | |
| using | MaxShape = typename RawData_::MaxShape | 
| Maximum shape supported by the raw data.  More... | |
| using | RawCellMap = typename RawData_::CellMap | 
| Map type from refinement types to raw cell templates.  More... | |
| using | RawEdgeMap = typename RawData_::EdgeMap | 
| Map type from refinement types to raw edge templates.  More... | |
| using | RawFaceMap = typename RawData_::FaceMap | 
| Map type from refinement types to raw face templates.  More... | |
| template<int dim_> | |
| using | RawTemplateMapByDim = typename RawData_::template TemplateMapByDim< dim_ > | 
| Accessor for raw template maps.  More... | |
| template<int dim_> | |
| using | RefinementTemplateByDim = RefinementTemplate< typename Shape::FaceTraits< MaxShape, dim_ >::ShapeType > | 
| Accessor for refinement template types.  More... | |
| template<int dim_> | |
| using | RefinementTypeByDim = typename RawData_::template RefinementTypeByDim< dim_ > | 
| Accessor for refinement types.  More... | |
| template<int dim_> | |
| using | TemplateMapByDim = std::unordered_map< RefinementTypeByDim< dim_ >, RefinementTemplate< Shape::Hypercube< dim_ > > > | 
| Accessor for template map types.  More... | |
| Private Member Functions | |
| template<int dim_> | |
| TemplateMapByDim< dim_ > | _build (const RawTemplateMapByDim< dim_ > &raw_templates) | 
| Build all templates of a certain dimension.  More... | |
| template<typename TemplateShape_ , int dim_ = TemplateShape_::dimension> | |
| void | _build_template (const RawTemplate< TemplateShape_ > &raw_template, RefinementTemplate< TemplateShape_ > &tmplt, TemplateSearchSpace< TemplateShape_ > &search_space) | 
| Constructs a RefinementTemplate from the given RawTemplate.  More... | |
| template<typename TemplateShape_ , typename TopologyShape_ , int dim_ = TopologyShape_::dimension - 1> | |
| void | _build_topology (const RawEntity< TopologyShape_, TemplateShape_::dimension > &raw_entity, const TemplateSearchSpace< TemplateShape_ > &search_space, TopologyTemplate< TopologyShape_ > &topo) | 
| Constructs a TopologyTemplate for the given RawEntity.  More... | |
| template<typename Shape_ , typename TemplateMap_ > | |
| void | _create_type_adjustments (const TemplateMap_ &available_templates) | 
| Calculate adjustments of the subdivision levels.  More... | |
| template<typename TemplateShape_ , int dim_ = TemplateShape_::dimension> | |
| void | _fill_orientation_mappings (const RefinementTypeByDim< TemplateShape_::dimension > &oriented_type, const int orientation, const RefinementTemplate< TemplateShape_ > &local_template, const TemplateSearchSpace< TemplateShape_ > &local_search_space, const RefinementTemplate< TemplateShape_ > &oriented_template, const TemplateSearchSpace< TemplateShape_ > &oriented_search_space) | 
| Fill orientation mappings for a given template.  More... | |
| template<int n_> | |
| Index | _find_vertex (const std::vector< Tiny::Vector< Real, n_ > > &vertices, const Tiny::Vector< Real, n_ > &vertex) | 
| Determines the index of a vertex in a list of vertices.  More... | |
| template<typename Shape_ > | |
| TemplateSearchSpace< Shape_ > | _setup_search_space (RefinementTypeByDim< Shape_::dimension > type) const | 
| Helper function for creating a search space with boundary and topology entities.  More... | |
| const CellMap & | cells () | 
| Cell-template accessor.  More... | |
| const EdgeMap & | edges () | 
| Edge-template accessor.  More... | |
| const FaceMap & | faces () | 
| Face-template accessor.  More... | |
| template<int dim_> | |
| auto & | type_adjustments () | 
| dim-based accessor for type adjustment arrays  More... | |
| Private Attributes | |
| CellMap | _cell_templates = {} | 
| Cell-templates constructed by this template builder.  More... | |
| std::array< std::array< std::uint64_t, 8 >, 256 > | _cell_type_adjustments = {} | 
| Type adjustments for cells.  More... | |
| EdgeMap | _edge_templates = {} | 
| Edge-templates constructed by this template builder.  More... | |
| std::array< std::array< std::uint64_t, 2 >, 4 > | _edge_type_adjustments = {} | 
| Type adjustments for edges.  More... | |
| FaceMap | _face_templates = {} | 
| Face-templates constructed by this template builder.  More... | |
| std::array< std::array< std::uint64_t, 4 >, 16 > | _face_type_adjustments = {} | 
| Type adjustments for faces.  More... | |
| OrientationMappingHolder< RawData_, Shape::Hexahedron > | _orientation_mappings = {} | 
| Container for orientation mappings.  More... | |
| std::array< bool, 4 > | _type_adjustment_initialized = {false, false, false, false} | 
| Bookkeeping for which type adjustments have been created already.  More... | |
Constructs RefinementTemplates from RawTemplates.
| RawData_ | Raw template data. See Geometry::SchneidersData for an example. | 
The TemplateBuilder is lazy. Templates will be constructed the first time they are accessed. This especially means hexahedral templates will not be constructed for 2D meshes and defined but unused template sets inccur no overhead.
Definition at line 1322 of file template_builder.hpp.
| 
 | private | 
Map type from refinement types to cell templates.
Definition at line 1355 of file template_builder.hpp.
| 
 | private | 
Map type from refinement types to edge templates.
Definition at line 1351 of file template_builder.hpp.
| 
 | private | 
Map type from refinement types to face templates.
Definition at line 1353 of file template_builder.hpp.
| 
 | private | 
Maximum shape supported by the raw data.
Definition at line 1325 of file template_builder.hpp.
| 
 | private | 
Map type from refinement types to raw cell templates.
Definition at line 1336 of file template_builder.hpp.
| 
 | private | 
Map type from refinement types to raw edge templates.
Definition at line 1332 of file template_builder.hpp.
| 
 | private | 
Map type from refinement types to raw face templates.
Definition at line 1334 of file template_builder.hpp.
| 
 | private | 
Accessor for raw template maps.
Definition at line 1329 of file template_builder.hpp.
| 
 | private | 
Accessor for refinement template types.
Definition at line 1344 of file template_builder.hpp.
| 
 | private | 
Accessor for refinement types.
Definition at line 1340 of file template_builder.hpp.
| 
 | private | 
Accessor for template map types.
Definition at line 1348 of file template_builder.hpp.
| 
 | inlineprivate | 
Build all templates of a certain dimension.
| dim_ | Dimension to build templates for | 
| [in] | raw_templates | Map of raw templates | 
Definition at line 1801 of file template_builder.hpp.
| 
 | inlineprivate | 
Constructs a RefinementTemplate from the given RawTemplate.
| TemplateShape_ | Shape of the template | 
| dim_ | Dimension the algorithm is currently working on | 
| [in] | raw_template | The raw template to construct a refinement template for | 
| [in,out] | tmplt | The refinement template being constructed | 
| [in,out] | search_space | The TemplateSearchSpace for the current template. | 
Definition at line 1618 of file template_builder.hpp.
References FEAT::Geometry::TemplateSearchSpace< Shape_, num_coords_ >::add_sibling().
| 
 | inlineprivate | 
Constructs a TopologyTemplate for the given RawEntity.
| TemplateShape_ | Shape of the template the topology is part of | 
| TopologyShape_ | Shape of the entity the topology is for | 
| dim_ | Dimension the algorithm is currently working on | 
| [in] | raw_entity | The raw entity to construct a topology template for | 
| [in,out] | topo | The topology being constructed | 
| [in] | search_space | The TemplateSearchSpace for the current template. | 
Definition at line 1581 of file template_builder.hpp.
References FEAT::Geometry::TemplateSearchSpace< Shape_, num_coords_ >::search().
| 
 | inlineprivate | 
Calculate adjustments of the subdivision levels.
| Shape_ | Shape to calculate adjustments for | 
A template set does not necessarily contain templates for all possible markings of a mesh element. In that case the AdaptiveMesh corrects the markings during the creation of the final refinement field. This method supplies the necessary corrections.
It does so by determining the "closest" template, i.e. the template with the least required changes to the subidivision levels, to all possible markings and saving the neccessary changes to apply that template to the element.
Definition at line 1914 of file template_builder.hpp.
| 
 | inlineprivate | 
Fill orientation mappings for a given template.
| TemplateShape_ | Shape of the template | 
| dim_ | Current working dim | 
| [in] | oriented_type | The refinement type of the given oriented template | 
| [in] | orientation | The orientation to fill the mappings of | 
| [in] | local_template | The refinement template, as seen by the current mesh entity \parma[in] local_search_space Search space containing all elements of local_template | 
| [in] | oriented_template | Refinement template as seen by sub-entity with orientation orientation | 
| [in] | oriented_search_space | Search space containing all elements of oriented_template | 
Fills orientation mapping for (oriented_type, orientation) as a side effect.
To compute these mappings, we use the following idea.
Let e be a mesh entity with dimension >= 2, i.e. at least a face, and let s be a sub-entity of e, i.e. an edge or face of e's topology.
The sub-entity s then has two refinement types. A local type, as determined by the vertex-ordering of e, and a foreign tye, as determined by the vertex ordering of s itself. We can predict the foreign type using the local type and the relative orientation of s as stored in the entities topology.
This allows us to fill the orientation mappings by finding the foreign type for each pair of local type and possible orientation. Given a local template and the corresponding oriented template, as are passed to this function, we can retrieve the vertices of all entities from their respective search spaces, and determine the orientation mapping by finding identical entities in both templates.
Because the templates determine how mesh entities will be constructed in the adaptive mesh, we can also pre-compute these entities relative orientations to each other at this point. This means no orientations have to be computed by the adaptive mesh beyond the intial collection of root topologies.
Definition at line 1693 of file template_builder.hpp.
References FEAT::Geometry::OrientationMapping::get_mapping().
| 
 | inlineprivate | 
Determines the index of a vertex in a list of vertices.
Definition at line 1544 of file template_builder.hpp.
| 
 | inlineprivate | 
Helper function for creating a search space with boundary and topology entities.
| Shape_ | Shape of the search space | 
| type | Refinement type for determining boundary entities | 
Definition at line 1866 of file template_builder.hpp.
References FEAT::Geometry::TemplateSearchSpace< Shape_, num_coords_ >::add_boundary_entity(), and FEAT::Geometry::TemplateSearchSpace< Shape_, num_coords_ >::add_topology().
| 
 | inlineprivate | 
Cell-template accessor.
Definition at line 1398 of file template_builder.hpp.
| 
 | inline | 
Correct an index for orientation.
Definition at line 1448 of file template_builder.hpp.
| 
 | inlineprivate | 
Edge-template accessor.
Definition at line 1378 of file template_builder.hpp.
| 
 | inlineprivate | 
Face-template accessor.
Definition at line 1388 of file template_builder.hpp.
| 
 | inline | 
Definition at line 1409 of file template_builder.hpp.
| 
 | inline | 
Definition at line 1427 of file template_builder.hpp.
| 
 | inline | 
print some stats about maximum children in the raw data
Definition at line 1501 of file template_builder.hpp.
References FEAT::Math::max(), and FEAT::stringify().
| 
 | inline | 
Definition at line 1471 of file template_builder.hpp.
| 
 | inlineprivate | 
dim-based accessor for type adjustment arrays
Definition at line 1552 of file template_builder.hpp.
References XABORTM.
| 
 | private | 
Cell-templates constructed by this template builder.
Definition at line 1362 of file template_builder.hpp.
| 
 | private | 
Type adjustments for cells.
Definition at line 1372 of file template_builder.hpp.
| 
 | private | 
Edge-templates constructed by this template builder.
Definition at line 1358 of file template_builder.hpp.
| 
 | private | 
Type adjustments for edges.
Definition at line 1368 of file template_builder.hpp.
| 
 | private | 
Face-templates constructed by this template builder.
Definition at line 1360 of file template_builder.hpp.
| 
 | private | 
Type adjustments for faces.
Definition at line 1370 of file template_builder.hpp.
| 
 | private | 
Container for orientation mappings.
Definition at line 1365 of file template_builder.hpp.
| 
 | private | 
Bookkeeping for which type adjustments have been created already.
Definition at line 1375 of file template_builder.hpp.