FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Geometry::MeshPart< MeshType_ > Class Template Reference

Class template for partial meshes. More...

#include <mesh_part.hpp>

Classes

struct  IndexSet
 Index set type class template. More...
 
struct  TargetSet
 Target set type class template. More...
 

Public Types

typedef MeshType::VertexSetType::CoordType AttributeDataType
 Data type for attributes. More...
 
typedef AttributeSetContainer::const_iterator AttributeSetConstIterator
 submesh node const-iterator type More...
 
typedef std::map< String, std::unique_ptr< AttributeSetType > > AttributeSetContainer
 submesh node bin container type More...
 
typedef AttributeSetContainer::iterator AttributeSetIterator
 submesh node iterator type More...
 
typedef AttributeSetContainer::reverse_iterator AttributeSetReverseIterator
 submesh node reverse-iterator type More...
 
typedef AttributeSet< AttributeDataTypeAttributeSetType
 Type for mesh attributes. More...
 
typedef IndexSetHolder< ShapeTypeIndexSetHolderType
 Index set holder type. More...
 
typedef MeshType_ MeshType
 parent Mesh type More...
 
typedef MeshType::IndexSetHolderType ParentIndexSetHolderType
 Topology (aka IndexSetHolder) of parent mesh type. More...
 
typedef MeshType::ShapeType ShapeType
 Shape type. More...
 
typedef TargetSetHolder< ShapeTypeTargetSetHolderType
 Target set holder type. More...
 

Public Member Functions

 MeshPart (const Index num_entities[], bool create_topology=false)
 Constructor. More...
 
 MeshPart (const MeshPart &other)=delete
 deleted copy constructor
 
 MeshPart (Factory< MeshPart > &factory)
 Factory constructor. More...
 
 MeshPart (MeshPart &&other)=default
 move constructor
 
virtual ~MeshPart ()
 Virtual destructor. More...
 
virtual bool add_attribute (std::unique_ptr< AttributeSetType > attribute, const String &identifier)
 Copies one attribute to this MeshPart's AttributeHolder. More...
 
std::size_t bytes () const
 
MeshPart clone () const
 
void clone (const MeshPart &other)
 Clones another mesh part object into this object. More...
 
template<int end_dim_, int current_dim_ = ShapeType::dimension>
void deduct_target_sets_from_bottom (const ParentIndexSetHolderType &parent_ish)
 Deducts the target sets from bottom to top. More...
 
template<int end_dim_, int current_dim_ = 0>
void deduct_target_sets_from_top (const ParentIndexSetHolderType &parent_ish)
 Deducts the target sets from top to bottom. More...
 
void deduct_topology (const ParentIndexSetHolderType &parent_ish)
 Fills the mesh topology from parent information. More...
 
AttributeSetTypefind_attribute (const String &identifier)
 Finds an Attribute by its identifier String and returns a pointer to it. More...
 
const AttributeSetTypefind_attribute (const String &identifier) const
 Finds an Attribute by its identifier String and returns a pointer to it. More...
 
template<int cell_dim_, int face_dim_>
IndexSet< cell_dim_, face_dim_ >::Type & get_index_set ()
 Returns the reference to an index set. More...
 
template<int cell_dim_, int face_dim_>
const IndexSet< cell_dim_, face_dim_ >::Type & get_index_set () const
 Returns the reference to an index set. More...
 
const AttributeSetContainerget_mesh_attributes () const
 Returns a const reference to the mesh attributes container. More...
 
int get_num_attributes () const
 Returns the total number of Attributes in this MeshPart. More...
 
Index get_num_entities (int dim) const
 Returns the number of entities. More...
 
template<int cell_dim_>
TargetSet< cell_dim_ >::Type & get_target_set ()
 Return the reference to a target set. More...
 
template<int cell_dim_>
const TargetSet< cell_dim_ >::Type & get_target_set () const
 Return the reference to a target set. More...
 
bool has_topology () const
 Checks if this MeshPart has a mesh topology. More...
 
MeshPartoperator= (const MeshPart &)=delete
 deleted copy-assignment operator
 
MeshPartoperator= (MeshPart &&other)=default
 move-assignment operator
 
void permute (const MeshPermutation< ShapeType > &mesh_perm)
 Applies a mesh permutation onto this mesh part's target sets. More...
 

Static Public Member Functions

static String name ()
 Returns the name of the class. More...
 

Static Public Attributes

static constexpr int shape_dim = ShapeType::dimension
 Shape dimension. More...
 

Protected Attributes

std::unique_ptr< IndexSetHolderType_index_set_holder
 The index sets of the mesh. More...
 
AttributeSetContainer _mesh_attributes
 The attribute sets of the mesh. More...
 
std::array< Index, shape_dim+1 > _num_entities
 Number of entities for each shape dimension. More...
 
TargetSetHolderType _target_set_holder
 The target sets of the mesh. More...
 

Detailed Description

template<typename MeshType_>
class FEAT::Geometry::MeshPart< MeshType_ >

Class template for partial meshes.

A MeshPart is a part of another mesh (called parent mesh) and is defined by mapping its own mesh entities (like vertices, edges etc.) to the corresponding mesh entities of the parent mesh. For at least one arbitrary shape dimension a mapping has to exist, but a MeshPart can have one mapping for each shape dimension of the mesh it refers to.

A MeshPart does not need to be connected or to have a topology, although it can implicitly use the parent's topology. It can have sets of AttributeSets for each shape dimension. If the parent mesh is refine, it is possible to use that information to create a refined version of the MeshPart, although particular care has to be taken when refining the AttributeSets.

A MeshPart can supply its own topology, which can be different from the parent's. One important example for this is a MeshPart that defines the boundary of its parent mesh. If the boundary is parametrized using a AttributeSet and the boundary is closed, the parametrization requires the doubling of some mesh entities to correctly represent the parametrization variable.

*
*   Parent:      MeshPart representing the closed boundary:
*   3----2       0--1--2--3--4
*   |    |         map to
*   |    |       0--1--2--3--0
*   0----1
*
* 

Vertex 0 of the parent mesh has two different parametrization variables, as it is both the first and the last vertex of the closed boundary. This can be easily represented by having two vertices in the MeshPart point to the same vertex of the parent mesh.

At least one parent mapping has to be given, but it is possible to deduct the other parent mappings from this. There are two possibilities:

  1. Bottom to top: Starting with the lowest dimensional parent mapping, an entity is considered to be in the MeshPart if all its sub shapes are in the MeshPart, i.e. for a given edge parent mapping in 3d, all faces consisting exclusively of edges in the MeshPart are considered to be in the MeshPart as well. This is then repeated for cells as well.
  2. Top to bottom: Starting with the highest dimensional parent mapping, all subshapes of these entities are considered to be in the MeshPart as well, i.e. for a given face parent mapping in 3d, all edges belonging to faces in the MeshPart are considered to be in the MeshPart as well.
Warning
Extra care has to be taken with this when it comes to refinement when adding higher dimensional parent information. Consider the case of a the parent mesh partitioned into several patches and a MeshPart consisting of two vertices where more than two patches meet. If the mesh is refined, there are still exactly two vertices where more than two patches meet. If by chance those two vertices share an edge in the coarse mesh and bottom to top parent deduction is used, an edge is added to the MeshPart. Refinement of said edge then leads to the addition of a new vertex to the MeshPart, which is correct in terms of mesh topology, but the MeshPart then no longer represents the set of patch cross points.
Note
This template works for both ConformalMesh as well as StructuredMesh meshes.
Author
Jordi Paul
Peter Zajac

Definition at line 89 of file mesh_part.hpp.

Member Typedef Documentation

◆ AttributeDataType

template<typename MeshType_ >
typedef MeshType::VertexSetType::CoordType FEAT::Geometry::MeshPart< MeshType_ >::AttributeDataType

Data type for attributes.

Definition at line 133 of file mesh_part.hpp.

◆ AttributeSetConstIterator

template<typename MeshType_ >
typedef AttributeSetContainer::const_iterator FEAT::Geometry::MeshPart< MeshType_ >::AttributeSetConstIterator

submesh node const-iterator type

Definition at line 142 of file mesh_part.hpp.

◆ AttributeSetContainer

template<typename MeshType_ >
typedef std::map<String, std::unique_ptr<AttributeSetType> > FEAT::Geometry::MeshPart< MeshType_ >::AttributeSetContainer

submesh node bin container type

Definition at line 138 of file mesh_part.hpp.

◆ AttributeSetIterator

template<typename MeshType_ >
typedef AttributeSetContainer::iterator FEAT::Geometry::MeshPart< MeshType_ >::AttributeSetIterator

submesh node iterator type

Definition at line 140 of file mesh_part.hpp.

◆ AttributeSetReverseIterator

template<typename MeshType_ >
typedef AttributeSetContainer::reverse_iterator FEAT::Geometry::MeshPart< MeshType_ >::AttributeSetReverseIterator

submesh node reverse-iterator type

Definition at line 144 of file mesh_part.hpp.

◆ AttributeSetType

template<typename MeshType_ >
typedef AttributeSet<AttributeDataType> FEAT::Geometry::MeshPart< MeshType_ >::AttributeSetType

Type for mesh attributes.

Definition at line 135 of file mesh_part.hpp.

◆ IndexSetHolderType

template<typename MeshType_ >
typedef IndexSetHolder<ShapeType> FEAT::Geometry::MeshPart< MeshType_ >::IndexSetHolderType

Index set holder type.

Definition at line 99 of file mesh_part.hpp.

◆ MeshType

template<typename MeshType_ >
typedef MeshType_ FEAT::Geometry::MeshPart< MeshType_ >::MeshType

parent Mesh type

Definition at line 93 of file mesh_part.hpp.

◆ ParentIndexSetHolderType

template<typename MeshType_ >
typedef MeshType::IndexSetHolderType FEAT::Geometry::MeshPart< MeshType_ >::ParentIndexSetHolderType

Topology (aka IndexSetHolder) of parent mesh type.

Definition at line 97 of file mesh_part.hpp.

◆ ShapeType

template<typename MeshType_ >
typedef MeshType::ShapeType FEAT::Geometry::MeshPart< MeshType_ >::ShapeType

Shape type.

Definition at line 95 of file mesh_part.hpp.

◆ TargetSetHolderType

template<typename MeshType_ >
typedef TargetSetHolder<ShapeType> FEAT::Geometry::MeshPart< MeshType_ >::TargetSetHolderType

Target set holder type.

Definition at line 101 of file mesh_part.hpp.

Constructor & Destructor Documentation

◆ MeshPart() [1/2]

template<typename MeshType_ >
FEAT::Geometry::MeshPart< MeshType_ >::MeshPart ( const Index  num_entities[],
bool  create_topology = false 
)
inlineexplicit

Constructor.

Parameters
[in]num_entitiesAn array of length at least shape_dim + 1 holding the number of entities for each shape dimension. Must not be nullptr.
[in]create_topologyDetermines if the MeshPart is to have a mesh topology.

Definition at line 183 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_index_set_holder, FEAT::Geometry::MeshPart< MeshType_ >::_num_entities, and FEAT::Geometry::MeshPart< MeshType_ >::shape_dim.

◆ MeshPart() [2/2]

template<typename MeshType_ >
FEAT::Geometry::MeshPart< MeshType_ >::MeshPart ( Factory< MeshPart< MeshType_ > > &  factory)
inlineexplicit

◆ ~MeshPart()

template<typename MeshType_ >
virtual FEAT::Geometry::MeshPart< MeshType_ >::~MeshPart ( )
inlinevirtual

Virtual destructor.

Definition at line 232 of file mesh_part.hpp.

Member Function Documentation

◆ add_attribute()

template<typename MeshType_ >
virtual bool FEAT::Geometry::MeshPart< MeshType_ >::add_attribute ( std::unique_ptr< AttributeSetType attribute,
const String identifier 
)
inlinevirtual

Copies one attribute to this MeshPart's AttributeHolder.

Parameters
[in]attributeA resident pointer to the Attribute to be added.
[in]identifierIdentifier for the map.
Returns
True if the attribute was successfully added, meaning no attribute with the appropriate identifier was present, or false otherwise.

Definition at line 374 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_mesh_attributes, and XASSERTM.

Referenced by FEAT::Geometry::MeshPart< MeshType_ >::clone(), and FEAT::Geometry::MeshPartOperations< MeshType_ >::copy_attributes().

◆ bytes()

template<typename MeshType_ >
std::size_t FEAT::Geometry::MeshPart< MeshType_ >::bytes ( ) const
inline

◆ clone() [1/2]

template<typename MeshType_ >
MeshPart FEAT::Geometry::MeshPart< MeshType_ >::clone ( ) const
inline

◆ clone() [2/2]

template<typename MeshType_ >
void FEAT::Geometry::MeshPart< MeshType_ >::clone ( const MeshPart< MeshType_ > &  other)
inline

Clones another mesh part object into this object.

Parameters
[in]otherA transient reference to the source object that is to be cloned into this object.

Definition at line 243 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::add_attribute(), and FEAT::Geometry::other.

◆ deduct_target_sets_from_bottom()

template<typename MeshType_ >
template<int end_dim_, int current_dim_ = ShapeType::dimension>
void FEAT::Geometry::MeshPart< MeshType_ >::deduct_target_sets_from_bottom ( const ParentIndexSetHolderType parent_ish)
inline

Deducts the target sets from bottom to top.

Template Parameters
end_dim_Dimension to stop at (meaning the lowest dimension).
current_dim_Dimension to generate parent information for.
Parameters
[in]parent_ishA transient reference to the topology of the parent this MeshPart refers to.
Warning
This will in general change the implied topology of the MeshPart and is meant to be used in mesh preprocessing only.

Definition at line 504 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_num_entities, and FEAT::Geometry::MeshPart< MeshType_ >::_target_set_holder.

◆ deduct_target_sets_from_top()

template<typename MeshType_ >
template<int end_dim_, int current_dim_ = 0>
void FEAT::Geometry::MeshPart< MeshType_ >::deduct_target_sets_from_top ( const ParentIndexSetHolderType parent_ish)
inline

Deducts the target sets from top to bottom.

Template Parameters
end_dim_Dimension to stop at (meaning the highest dimension).
current_dim_Dimension to generate parent information for.
Parameters
[in]parent_ishA transient reference to the topology of the parent this MeshPart refers to.
Warning
This will in general change the implied topology of the MeshPart and is meant to be used in mesh preprocessing only.

Definition at line 529 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_num_entities, and FEAT::Geometry::MeshPart< MeshType_ >::_target_set_holder.

◆ deduct_topology()

template<typename MeshType_ >
void FEAT::Geometry::MeshPart< MeshType_ >::deduct_topology ( const ParentIndexSetHolderType parent_ish)
inline

Fills the mesh topology from parent information.

Parameters
[in]parent_ishA transient reference to the IndexSetHolder of the parent this MeshPart refers to.
Warning
This will in general change the implied topology of the MeshPart and is meant to be used in mesh preprocessing only.

Definition at line 547 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_index_set_holder, FEAT::Geometry::MeshPart< MeshType_ >::_num_entities, FEAT::Geometry::MeshPart< MeshType_ >::_target_set_holder, and FEAT::Geometry::RedundantIndexSetBuilder< Shape_ >::compute().

Referenced by FEAT::Geometry::MeshNodeLinker< RootMesh_ >::execute().

◆ find_attribute() [1/2]

template<typename MeshType_ >
AttributeSetType * FEAT::Geometry::MeshPart< MeshType_ >::find_attribute ( const String identifier)
inline

Finds an Attribute by its identifier String and returns a pointer to it.

Parameters
[in]identifierIdentifier to match.
Returns
A pointer to the Attribute of shape dimension dim if present.
Warning
Will return nullptr if no Attribute with the given identifier is found

Definition at line 328 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_mesh_attributes.

◆ find_attribute() [2/2]

template<typename MeshType_ >
const AttributeSetType * FEAT::Geometry::MeshPart< MeshType_ >::find_attribute ( const String identifier) const
inline

Finds an Attribute by its identifier String and returns a pointer to it.

Parameters
[in]identifierIdentifier to match.
Returns
A pointer to the Attribute of shape dimension dim if present.
Warning
Will return nullptr if no Attribute with the given identifier is found

Definition at line 335 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_mesh_attributes.

◆ get_index_set() [1/2]

template<typename MeshType_ >
template<int cell_dim_, int face_dim_>
IndexSet< cell_dim_, face_dim_ >::Type & FEAT::Geometry::MeshPart< MeshType_ >::get_index_set ( )
inline

Returns the reference to an index set.

Template Parameters
cell_dim_The dimension of the entity whose index set is to be returned.
face_dim_The dimension of the face that the index set refers to.
Returns
A reference to the index set.

Definition at line 394 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_index_set_holder, FEAT::Geometry::MeshPart< MeshType_ >::has_topology(), and XASSERTM.

◆ get_index_set() [2/2]

template<typename MeshType_ >
template<int cell_dim_, int face_dim_>
const IndexSet< cell_dim_, face_dim_ >::Type & FEAT::Geometry::MeshPart< MeshType_ >::get_index_set ( ) const
inline

Returns the reference to an index set.

Template Parameters
cell_dim_The dimension of the entity whose index set is to be returned.
face_dim_The dimension of the face that the index set refers to.
Returns
A reference to the index set.

Definition at line 402 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_index_set_holder, FEAT::Geometry::MeshPart< MeshType_ >::has_topology(), and XASSERTM.

◆ get_mesh_attributes()

template<typename MeshType_ >
const AttributeSetContainer & FEAT::Geometry::MeshPart< MeshType_ >::get_mesh_attributes ( ) const
inline

◆ get_num_attributes()

template<typename MeshType_ >
int FEAT::Geometry::MeshPart< MeshType_ >::get_num_attributes ( ) const
inline

Returns the total number of Attributes in this MeshPart.

Returns
The total number of Attributes.

Definition at line 356 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_mesh_attributes.

◆ get_num_entities()

◆ get_target_set() [1/2]

template<typename MeshType_ >
template<int cell_dim_>
TargetSet< cell_dim_ >::Type & FEAT::Geometry::MeshPart< MeshType_ >::get_target_set ( )
inline

Return the reference to a target set.

Template Parameters
cell_dim_The dimension of the entity whose target set is to be returned.
Returns
A reference to the target set.

Definition at line 433 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_target_set_holder, and FEAT::Geometry::MeshPart< MeshType_ >::shape_dim.

◆ get_target_set() [2/2]

template<typename MeshType_ >
template<int cell_dim_>
const TargetSet< cell_dim_ >::Type & FEAT::Geometry::MeshPart< MeshType_ >::get_target_set ( ) const
inline

Return the reference to a target set.

Template Parameters
cell_dim_The dimension of the entity whose target set is to be returned.
Returns
A reference to the target set.

Definition at line 442 of file mesh_part.hpp.

References FEAT::Geometry::MeshPart< MeshType_ >::_target_set_holder, and FEAT::Geometry::MeshPart< MeshType_ >::shape_dim.

◆ has_topology()

◆ name()

template<typename MeshType_ >
static String FEAT::Geometry::MeshPart< MeshType_ >::name ( )
inlinestatic

Returns the name of the class.

Returns
The name of the class as a String.

Definition at line 472 of file mesh_part.hpp.

◆ permute()

template<typename MeshType_ >
void FEAT::Geometry::MeshPart< MeshType_ >::permute ( const MeshPermutation< ShapeType > &  mesh_perm)
inline

Applies a mesh permutation onto this mesh part's target sets.

Parameters
[in]mesh_permA transient reference to the mesh permutation that is to be applied.

Definition at line 483 of file mesh_part.hpp.

References FEAT::Geometry::MeshPermutation< Shape_ >::get_inv_perms().

Member Data Documentation

◆ _index_set_holder

◆ _mesh_attributes

◆ _num_entities

◆ _target_set_holder

◆ shape_dim

template<typename MeshType_ >
constexpr int FEAT::Geometry::MeshPart< MeshType_ >::shape_dim = ShapeType::dimension
staticconstexpr

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