MoReFEM
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
MoReFEM::Domain Class Reference

This class holds descriptors that can be used to tailor a sub-domain of a Mesh. More...

#include <Domain.hpp>

Inheritance diagram for MoReFEM::Domain:
Collaboration diagram for MoReFEM::Domain:

Public Types

using unique_id_parent
 Convenient alias.
 
using const_unique_ptr = std::unique_ptr<const Domain>
 Alias for unique_ptr.
 
using vector_const_unique_ptr = std::vector<const_unique_ptr>
 Vector of unique pointers.
 

Public Member Functions

bool IsGeometricEltInside (const GeometricElt &geometric_element) const
 Whether the given geometric element belongs to the domain or not.
 
bool DoRefGeomEltMatchCriteria (const RefGeomElt &ref_geom_elt) const
 Whether geom_ref_element match the criteria of Domain.
 
const std::vector< std::size_t > & GetDimensionList () const noexcept
 Dimensions consider inside the domain.
 
Accessors.
const MeshLabel::vector_const_shared_ptrGetMeshLabelList () const noexcept
 Mesh labels in the domain.
 
MeshNS::unique_id GetMeshIdentifier () const noexcept
 Returns the mesh identifier.
 
const MeshGetMesh () const
 Return the Mesh.
 
const std::vector< Advanced::GeometricEltEnum > & GetRefGeometricEltIdList () const noexcept
 List of geometric element type handled in the domain.
 
template<Advanced::DomainNS::Criterion CriterionT>
bool IsConstraintOn () const noexcept
 Whether the domain imposes a constraint upon the selected criterion.
 

Static Public Member Functions

static const std::string & ClassName ()
 Returns the name of the class (required for some Singleton-related errors).
 

Private Member Functions

Mutators.
void SetDimensionList (const std::vector< std::size_t > &dimension_list)
 Set the dimensions to consider in the domain.
 
void SetMesh (const std::vector< MeshNS::unique_id > &mesh_unique_id)
 Set the mesh onto which the domain is defined (if any).
 
void SetRefGeometricEltIdList (const std::vector< Advanced::GeomEltNS::GenericName > &name_list)
 Set the list of geometric element type to consider.
 
void SetLabelList (const std::vector< std::size_t > &label_index_list)
 Set label list.
 
Low-level methods of the class, to check validity of operations.
void SetConditionType (Advanced::DomainNS::Criterion constraint_type)
 
template<Advanced::DomainNS::Criterion CriterionT, class GeometricObjectT >
bool IsConstraintFulfilled (const GeometricObjectT &object) const
 Whether a given constraint is fulfilled or not.
 
template<Advanced::DomainNS::Criterion CriterionT, class GeometricObjectT >
bool CheckConstraintIfRelevant (const GeometricObjectT &object) const
 Check if appropriate whether a constraint has been fulfilled for a given geometric object.
 

Private Attributes

MeshNS::unique_id mesh_identifier_ = MeshNS::unique_id{ NumericNS::UninitializedIndex<std::size_t>() }
 Identifier of the mesh upon which the domain is defined.
 
std::vector< std::size_t > dimension_list_
 Dimensions consider inside the domain.
 
MeshLabel::vector_const_shared_ptr mesh_label_list_
 Mesh labels in the domain.
 
std::vector< Advanced::GeometricEltEnumgeometric_type_list_
 List of geometric element type handled in the domain.
 
std::bitset< static_cast< std::size_t >(Advanced::DomainNS::Criterion::End)> are_constraints_on_
 Keep track of the conditions upon which the current domain imposes constraints.
 

Friends

class DomainManager
 Frienship to Domain manager, to allow it to create domain objects.
 

Special members.

 Domain ()
 Default constructor that restricts nothing.
 
 ~Domain ()=default
 Destructor.
 
 Domain (const Domain &rhs)=delete
 The copy constructor.
 
 Domain (Domain &&rhs)=delete
 The move constructor.
 
Domainoperator= (const Domain &rhs)=delete
 The (copy) operator=.
 
Domainoperator= (Domain &&rhs)=delete
 The (move) operator=.
 
 Domain (DomainNS::unique_id unique_id, const std::vector<::MoReFEM::MeshNS::unique_id > &mesh_index, const std::vector< std::size_t > &dimension_list, const std::vector< std::size_t > &mesh_label_list, const std::vector< Advanced::GeomEltNS::GenericName > &geometric_type_list)
 Constructor from input data file.
 
 Domain (DomainNS::unique_id unique_id, const ::MoReFEM::MeshNS::unique_id mesh_index, const std::vector< std::size_t > &mesh_label_index_list)
 Constructor used by LightweightDomainList.
 

Detailed Description

This class holds descriptors that can be used to tailor a sub-domain of a Mesh.

[internal] At the moment this is merely a prototype; full Domain class should be much more complete and for instance allow intersections, unions of domains. See #162.

The principle is that for each criterion (dimension, geometric element type, mesh labels at the moment) either Domain includes the list of all values supported, or there is an information inside a bitset that tells there are no constraints on this topic.

Objects of this class can only be created through the DomainManager (except the Domain that impose absolutely no restriction).

Member Typedef Documentation

◆ unique_id_parent

Initial value:
Crtp::
UniqueId<Domain, DomainNS::unique_id, UniqueIdNS::AssignationMode::manual, UniqueIdNS::DoAllowNoId::yes>

Convenient alias.

Constructor & Destructor Documentation

◆ Domain() [1/4]

MoReFEM::Domain::Domain ( DomainNS::unique_id unique_id,
const std::vector<::MoReFEM::MeshNS::unique_id > & mesh_index,
const std::vector< std::size_t > & dimension_list,
const std::vector< std::size_t > & mesh_label_list,
const std::vector< Advanced::GeomEltNS::GenericName > & geometric_type_list )
private

Constructor from input data file.

This constructor is intended to be used when constructing a domain from the input data file; otherwise it would have been structured differently to avoid many adjacent arguments with the exact same type.

Parameters
[in]unique_idIdentifier of the domain, that must be unique. It is in the input data file the figure that is in the block name, e.g. 1 for Domain1 = { .... }.
[in]mesh_indexThere might be here one index, that indicates in which mesh the domain is defined. If the domain is not limited to one mesh, leave it empty.
[in]dimension_listList of dimensions to consider. If empty, no restriction on dimension.
[in]mesh_label_listList of mesh labels to consider. If empty, no restriction on it. This argument must mandatorily be empty if mesh_index is empty: a mesh label is closely related to one given mesh.
[in]geometric_type_listList of geometric element types to consider in the domain. List of elements available is given by Advanced::GeometricEltFactory::GetNameList(); most if not all of them should been displayed in the comment in the input data file.

◆ Domain() [2/4]

MoReFEM::Domain::Domain ( DomainNS::unique_id unique_id,
const ::MoReFEM::MeshNS::unique_id mesh_index,
const std::vector< std::size_t > & mesh_label_index_list )
private

Constructor used by LightweightDomainList.

Parameters
[in]unique_idIdentifier of the domain, that must be unique.
[in]mesh_indexIndex of the mesh to which the Domain is related (mandatory in this case).
[in]mesh_label_index_listList of mesh labels to consider.

◆ Domain() [3/4]

MoReFEM::Domain::Domain ( const Domain & rhs)
delete

The copy constructor.

Parameters
[in]rhsThe object from which the construction occurs.

◆ Domain() [4/4]

MoReFEM::Domain::Domain ( Domain && rhs)
delete

The move constructor.

Parameters
[in]rhsThe object from which the construction occurs.

Member Function Documentation

◆ ClassName()

static const std::string & MoReFEM::Domain::ClassName ( )
static

Returns the name of the class (required for some Singleton-related errors).

Returns
Name of the class.

◆ operator=() [1/2]

Domain & MoReFEM::Domain::operator= ( const Domain & rhs)
delete

The (copy) operator=.

Parameters
[in]rhsThe object from which the affectation occurs.
Returns
Reference to the object (to enable chained affectation).

◆ operator=() [2/2]

Domain & MoReFEM::Domain::operator= ( Domain && rhs)
delete

The (move) operator=.

Parameters
[in]rhsThe object from which the affectation occurs.
Returns
Reference to the object (to enable chained affectation).

◆ IsGeometricEltInside()

bool MoReFEM::Domain::IsGeometricEltInside ( const GeometricElt & geometric_element) const

Whether the given geometric element belongs to the domain or not.

Parameters
[in]geometric_elementGeometricElement which status related to the current Domain is sought.
Returns
True if it belongs to the current Domain.

◆ DoRefGeomEltMatchCriteria()

bool MoReFEM::Domain::DoRefGeomEltMatchCriteria ( const RefGeomElt & ref_geom_elt) const

Whether geom_ref_element match the criteria of Domain.

Parameters
[in]ref_geom_eltRefGeometricElt under investigation.
Attention
This method does not solely check the geometric_elt_type criterion; it might also check for instance the dimension.

The main usage is for instance when a GlobalVariationalOperator is defined: it is handy to be able to restrict an operator for instance to a given set of dimensions (for instance elastic and hyperelastic stiffness make sense only for dimension >= 2).

Returns
True if the ref_geom_elt meets all requirements of the domain.

◆ GetDimensionList()

const std::vector< std::size_t > & MoReFEM::Domain::GetDimensionList ( ) const
noexcept

Dimensions consider inside the domain.

Relevant only if Advanced::DomainNS::Criterion::dimension is enforced.

[internal] This list is sort in increasing order.

Returns
List of all dimensions considered in the Domain.

◆ GetMeshLabelList()

const MeshLabel::vector_const_shared_ptr & MoReFEM::Domain::GetMeshLabelList ( ) const
noexcept

Mesh labels in the domain.

Relevant only if Advanced::DomainNS::Criterion::label is enforced.

[internal] This list is sort in increasing order.

Returns
List of all mesh labels considered in the Domain.

◆ GetMeshIdentifier()

MeshNS::unique_id MoReFEM::Domain::GetMeshIdentifier ( ) const
noexcept

Returns the mesh identifier.

Relevant only if Advanced::DomainNS::Criterion::mesh is enforced.

Returns
Unique identifier of the mesh (provided Advanced::DomainNS::Criterion::mesh is enforced).

◆ GetMesh()

const Mesh & MoReFEM::Domain::GetMesh ( ) const

Return the Mesh.

Relevant only if Advanced::DomainNS::Criterion::mesh is enforced.

Returns
Mesh into which current Domain is defined.

◆ GetRefGeometricEltIdList()

const std::vector< Advanced::GeometricEltEnum > & MoReFEM::Domain::GetRefGeometricEltIdList ( ) const
noexcept

List of geometric element type handled in the domain.

Relevant only if Criterion::geometric_elt_type is enforced.

Returns
List of identifiers of the RefGeomElt considered in the Domain.

◆ IsConstraintOn()

template<Advanced::DomainNS::Criterion CriterionT>
bool MoReFEM::Domain::IsConstraintOn ( ) const
noexcept

Whether the domain imposes a constraint upon the selected criterion.

Returns
True if there is CriterionT constraint applied on the domain.

By all means, you should treat this as a private member: it is public only because:

  • Parameter needs it for a consistency check.
  • Defining a friendship to Parameter would be cumbersome given its template parameters, relying on non-types defined in Parameter library.

◆ SetDimensionList()

void MoReFEM::Domain::SetDimensionList ( const std::vector< std::size_t > & dimension_list)
private

Set the dimensions to consider in the domain.

Parameters
[in]dimension_listList of dimensions to be covered by the domain.

◆ SetMesh()

void MoReFEM::Domain::SetMesh ( const std::vector< MeshNS::unique_id > & mesh_unique_id)
private

Set the mesh onto which the domain is defined (if any).

Parameters
[in]mesh_unique_idUnique id of the mesh to be covered by the domain.
Warning
This argument is a vector for conveniency in OptionFile but at most one value is expected (and in case this method is called exactly one in fact...).

◆ SetRefGeometricEltIdList()

void MoReFEM::Domain::SetRefGeometricEltIdList ( const std::vector< Advanced::GeomEltNS::GenericName > & name_list)
private

Set the list of geometric element type to consider.

Parameters
[in]name_listList of names of the RefGeomElt to be considered in the Domain.

[internal] "Convert" the list of strings that give the geometric element types to consider in the domain into something more efficient to use. The elements are ordered to fasten access through binary_search.

◆ SetLabelList()

void MoReFEM::Domain::SetLabelList ( const std::vector< std::size_t > & label_index_list)
private

Set label list.

This operation makes sense only when a mesh has been defined: there is little chance several mesh would share the same mesh labels... So SetMesh() must have been called beforehand.

Parameters
[in]label_index_listList of unique ids of the MeshLabel to be covered by the domain.

◆ SetConditionType()

void MoReFEM::Domain::SetConditionType ( Advanced::DomainNS::Criterion constraint_type)
private

Tells the domain defines a specific kind of constraints.

Parameters
[in]constraint_typeA type of constraint the current Domain should consider.

◆ IsConstraintFulfilled()

template<Advanced::DomainNS::Criterion CriterionT, class GeometricObjectT >
bool MoReFEM::Domain::IsConstraintFulfilled ( const GeometricObjectT & object) const
private

Whether a given constraint is fulfilled or not.

It is assumed here that CriterionT is enforced in the domain.

Parameters
[in]objectGeometric object upon which the constraint is tested. It might be a GeometricElt or a RefGeomElt.
Returns
True if current constraint is fulfilled in the domain.

◆ CheckConstraintIfRelevant()

template<Advanced::DomainNS::Criterion CriterionT, class GeometricObjectT >
bool MoReFEM::Domain::CheckConstraintIfRelevant ( const GeometricObjectT & object) const
private

Check if appropriate whether a constraint has been fulfilled for a given geometric object.

Template Parameters
CriterionTThe criterion being investigated.
GeometricObjectTEither GeometricElt or RefGeomElt.
Parameters
[in]objectGeometric object upon which the test is performed.
Returns
True either if there are no constraint on this criterion OR if there is one and the object passed it correctly.

Field Documentation

◆ mesh_identifier_

MeshNS::unique_id MoReFEM::Domain::mesh_identifier_ = MeshNS::unique_id{ NumericNS::UninitializedIndex<std::size_t>() }
private

Identifier of the mesh upon which the domain is defined.

Relevant only if DomainNS::Criterion::mesh is enforced.

◆ dimension_list_

std::vector<std::size_t> MoReFEM::Domain::dimension_list_
private

Dimensions consider inside the domain.

Relevant only if DomainNS::Criterion::dimension is enforced.

[internal] This list is sort in increasing order.

◆ mesh_label_list_

MeshLabel::vector_const_shared_ptr MoReFEM::Domain::mesh_label_list_
private

Mesh labels in the domain.

Relevant only if DomainNS::Criterion::label is enforced.

[internal] This list is sort in increasing order.

◆ geometric_type_list_

std::vector<Advanced::GeometricEltEnum> MoReFEM::Domain::geometric_type_list_
private

List of geometric element type handled in the domain.

Relevant only if DomainNS::Criterion::geometric_elt_type is enforced.

◆ are_constraints_on_

std::bitset<static_cast<std::size_t>(Advanced::DomainNS::Criterion::End)> MoReFEM::Domain::are_constraints_on_
private

Keep track of the conditions upon which the current domain imposes constraints.

enum class IsConditionOn is used to access the elements within.


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