LifeV
MeshEntity Class Reference

This is the base class to store basic properties of any mesh entity. More...

#include <MeshEntity.hpp>

+ Inheritance diagram for MeshEntity:
+ Collaboration diagram for MeshEntity:

Public Types

enum  SwitchId { LOCALID = 0, GLOBALID = 1 }
 Indicator for local or global id. More...
 

Private Attributes

ID M_id
 
ID M_localId
 
flag_Type M_flag
 

Constructors & Destructor

 MeshEntity ()
 Empty Constructor. More...
 
 MeshEntity (const ID &id, const flag_Type &flag=EntityFlags::DEFAULT)
 Constructor with a single value for both identifiers. More...
 
 MeshEntity (const ID &id, const ID &lid, const flag_Type &flag=EntityFlags::DEFAULT)
 Full constructor, where both identifiers are specified. More...
 
 MeshEntity (const ID &id, const bool &boundary)
 backward-compatible constructor More...
 
virtual ~MeshEntity ()
 Destructor. More...
 

Methods

void showMe (std::ostream &output=std::cout) const
 Displays the informations stored by this class. More...
 

Set Methods

void setId (const ID &id)
 Method to set the global identifier. More...
 
void setLocalId (const ID &id)
 Method to set the local identifier. More...
 
void setBoundary (const bool &boundary)
 Set method for the boundary indicator. More...
 
void replaceFlag (const flag_Type &flag)
 Replace method for the entity flag. More...
 
void setFlag (const flag_Type &flag)
 Sets a flag. More...
 
void unSetFlag (const flag_Type &flag)
 Remove a flag. More...
 

Get Methods

const IDid () const
 Method to get the global identifier. More...
 
const IDlocalId () const
 Method to get the local identifier. More...
 
bool boundary () const
 Tells if it is on the boundary. More...
 
bool isOwned () const
 Tells if the entity is owned by current process. More...
 
const flag_Typeflag () const
 returns the entity flag More...
 

Detailed Description

This is the base class to store basic properties of any mesh entity.

The basic properties of a mesh entity is to have identifiers and flags. Identifiers give information about the numbering of the entity (typically in a mesh) flags are attributes af the entity, like being on the boundary.

In this class, there are two identifiers stored:

  1. The global identifier, normally used to uniquely identify the entity in the whole mesh.
  2. The local identifier, which is usually unique to the entity on a given partition. If the entity is stored into a meshEntityContainer, then localId must be the position of the entity in the container.

When running the code in serial (1 processor), the identifiers are then the same (but this is not necessary)

This class provides the method and operators to handle local and global identifiers easily.

Note: Documentation by Samuel Quinodoz, implementation anterior to the documentation: Luca Formaggia

The additional fag that is stored is used to specify geometrical properties of the entity such as the ones specified above in the EntityFlags namespace.

Todo:
The marker ID should be taken away form marker class and added to the MeshEntity directly

Definition at line 97 of file MeshEntity.hpp.

Member Enumeration Documentation

◆ SwitchId

enum SwitchId

Indicator for local or global id.

This enum helps to develop methods to operate on local or globalID

Enumerator
LOCALID 
GLOBALID 

Definition at line 105 of file MeshEntity.hpp.

Constructor & Destructor Documentation

◆ MeshEntity() [1/4]

MeshEntity ( )
inline

Empty Constructor.

Using this constructor, both identifiers are set to NotAnId.

Definition at line 113 of file MeshEntity.hpp.

◆ MeshEntity() [2/4]

MeshEntity ( const ID id,
const flag_Type flag = EntityFlags::DEFAULT 
)
inline

Constructor with a single value for both identifiers.

Parameters
idThe value for both identifers.
flagThe value of the flag to assign (optional)

Definition at line 124 of file MeshEntity.hpp.

◆ MeshEntity() [3/4]

MeshEntity ( const ID id,
const ID lid,
const flag_Type flag = EntityFlags::DEFAULT 
)
inline

Full constructor, where both identifiers are specified.

Parameters
idThe value for the global ID.
lidThe value for the local ID.
flagThe value of the flag to assign (optional)

Definition at line 136 of file MeshEntity.hpp.

◆ MeshEntity() [4/4]

MeshEntity ( const ID id,
const bool &  boundary 
)
inline

backward-compatible constructor

Parameters
idThe identifier to be set for both (global and local) identifiers. Use a set method if you want different identifiers.
boundaryThe value of the boundary indicator.

Definition at line 148 of file MeshEntity.hpp.

+ Here is the caller graph for this function:

◆ ~MeshEntity()

virtual ~MeshEntity ( )
inlinevirtual

Destructor.

Definition at line 159 of file MeshEntity.hpp.

Member Function Documentation

◆ showMe()

void showMe ( std::ostream &  output = std::cout) const

Displays the informations stored by this class.

Definition at line 39 of file MeshEntity.cpp.

+ Here is the caller graph for this function:

◆ setId()

void setId ( const ID id)
inline

Method to set the global identifier.

Todo:
change the name in setGlobalId
Parameters
idThe new global identifier.

Definition at line 178 of file MeshEntity.hpp.

+ Here is the caller graph for this function:

◆ setLocalId()

void setLocalId ( const ID id)
inline

Method to set the local identifier.

Parameters
idThe new local identifier.

Definition at line 187 of file MeshEntity.hpp.

+ Here is the caller graph for this function:

◆ setBoundary()

void setBoundary ( const bool &  boundary)
inline

Set method for the boundary indicator.

Parameters
boundaryThe value to be set for the boundary indicator.

Definition at line 196 of file MeshEntity.hpp.

◆ replaceFlag()

void replaceFlag ( const flag_Type flag)
inline

Replace method for the entity flag.

Parameters
flagThe value to be set for the entity flag.
Note
Beware, it sets the entire flag; if you want to add a flag use | or setFlag

Definition at line 213 of file MeshEntity.hpp.

◆ setFlag()

void setFlag ( const flag_Type flag)
inline

Sets a flag.

Parameters
flagThe flag to be added

Definition at line 222 of file MeshEntity.hpp.

◆ unSetFlag()

void unSetFlag ( const flag_Type flag)
inline

Remove a flag.

Parameters
flagThe flag to be removed

Definition at line 230 of file MeshEntity.hpp.

◆ id()

const ID& id ( ) const
inline

Method to get the global identifier.

Returns
The global identifier.

Definition at line 245 of file MeshEntity.hpp.

+ Here is the caller graph for this function:

◆ localId()

const ID& localId ( ) const
inline

Method to get the local identifier.

Returns
The local identifier.

Definition at line 254 of file MeshEntity.hpp.

+ Here is the caller graph for this function:

◆ boundary()

bool boundary ( ) const
inline

Tells if it is on the boundary.

Definition at line 260 of file MeshEntity.hpp.

+ Here is the caller graph for this function:

◆ isOwned()

bool isOwned ( ) const
inline

Tells if the entity is owned by current process.

Definition at line 266 of file MeshEntity.hpp.

◆ flag()

const flag_Type& flag ( ) const
inline

returns the entity flag

Definition at line 272 of file MeshEntity.hpp.

Field Documentation

◆ M_id

ID M_id
private

Definition at line 280 of file MeshEntity.hpp.

◆ M_localId

ID M_localId
private

Definition at line 281 of file MeshEntity.hpp.

◆ M_flag

flag_Type M_flag
private

Definition at line 282 of file MeshEntity.hpp.


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