MoReFEM
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
MoReFEM::MeshLabel Class Referencefinal

Depiction of a given label. More...

#include <MeshLabel.hpp>

Collaboration diagram for MoReFEM::MeshLabel:

Public Types

using const_shared_ptr = std::shared_ptr<const MeshLabel>
 Typical smart pointer associated to the object.
 
using vector_const_shared_ptr = std::vector<const_shared_ptr>
 Vector of smart pointers.
 

Public Member Functions

const std::string & GetDescription () const noexcept
 Get the description.
 
MeshNS::unique_id GetMeshIdentifier () const noexcept
 Get the mesh identifier.
 
std::size_t GetIndex () const noexcept
 Get the index.
 
Special members.
 MeshLabel (MeshNS::unique_id mesh_id, std::size_t index, const std::string &description)
 Constructor.
 
 ~MeshLabel ()
 Destructor.
 
 MeshLabel (const MeshLabel &rhs)=delete
 The copy constructor.
 
 MeshLabel (MeshLabel &&rhs)=delete
 The move constructor.
 
MeshLabeloperator= (const MeshLabel &rhs)=delete
 The (copy) operator=.
 
MeshLabeloperator= (MeshLabel &&rhs)=delete
 The (move) operator=.
 

Static Public Member Functions

static const std::string & ClassName ()
 Name of the class (required by unique_id Crtp).
 

Private Attributes

const MeshNS::unique_id mesh_identifier_
 Identifier of the mesh for which the label is defined.
 
const std::size_t index_
 Identifier related to the label.
 
std::string description_
 Description.
 

Detailed Description

Depiction of a given label.

This is mostly just a couple unique_id/description; the expected modus operandi is that a (smart) pointer to the MeshLabel object will be passed to each element that belongs to it (geometric elements, edges, etc...)

So MeshLabels objects should always be created through dynamic allocation:

auto my_surface = std::make_shared<MeshLabel>(mesh, 42, "Left ventricle");
Attention
If for some reason we need to know quickly and often all the geometric elements in a label, this data should be stored as a vector of WEAK pointers, to avoid circular definitions.

Constructor & Destructor Documentation

◆ MeshLabel() [1/3]

MoReFEM::MeshLabel::MeshLabel ( MeshNS::unique_id mesh_id,
std::size_t index,
const std::string & description )
explicit

Constructor.

Parameters
[in]mesh_idIdentifier of the Mesh to which the label belongs to.
[in]indexIdentifier related to the label. This identifier should be unique for a given Mesh (i.e. that a given mesh should get at most one MeshLabel object with a given unique id).

[internal] Crtp UniqueId can't be used used as same integer might be used in different meshes.

Parameters
[in]descriptionDescription of the label. Might be empty.

◆ MeshLabel() [2/3]

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

The copy constructor.

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

◆ MeshLabel() [3/3]

MoReFEM::MeshLabel::MeshLabel ( MeshLabel && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

MeshLabel & MoReFEM::MeshLabel::operator= ( const MeshLabel & 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]

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

The (move) operator=.

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

Field Documentation

◆ index_

const std::size_t MoReFEM::MeshLabel::index_
private

Identifier related to the label.

This identifier should be unique for a given Mesh (i.e. that a given mesh should get at most one MeshLabel object with a given unique id).

[internal] Crtp UniqueId can't be used used as same integer might be used in different meshes.


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