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

Class in charge of dof information. More...

#include <Dof.hpp>

Inheritance diagram for MoReFEM::Dof:
Collaboration diagram for MoReFEM::Dof:

Public Types

using shared_ptr = std::shared_ptr<Dof>
 Shared smart pointer.
 
using vector_shared_ptr = std::vector<shared_ptr>
 Vector of shared smart pointers.
 
using processor_wise_or_ghost_index_per_numbering_subset_type
 Convenient alias.
 
using program_wise_index_per_numbering_subset_type
 Convenient alias.
 
using underlying_type
 Type used for the unique id.
 

Public Member Functions

DofNS::processor_wise_or_ghost_index GetProcessorWiseOrGhostIndex (const NumberingSubset &numbering_subset) const
 Processor-wise or ghost index.
 
DofNS::program_wise_index GetProgramWiseIndex (const NumberingSubset &numbering_subset) const
 Program-wise index.
 
Internal::DofNS::internal_processor_wise_or_ghost_index GetInternalProcessorWiseOrGhostIndex () const noexcept
 Processor- or ghost-wise index independent of the numbering subset.
 
bool IsInNumberingSubset (const NumberingSubset &numbering_subset) const
 Whether the current dof is present in numbering_subset.
 
std::shared_ptr< const NodeGetNodeFromWeakPtr () const
 Return a pointer to the Node to which the current dof belongs to.
 
DofNS::unique_id GetUniqueId () const
 Get the value of the internal unique ID.
 
Special members.
 Dof (const std::shared_ptr< const Node > &node_ptr)
 Constructor.
 
 ~Dof ()
 Destructor.
 
 Dof (const Dof &rhs)=delete
 The copy constructor.
 
 Dof (Dof &&rhs)=delete
 The move constructor.
 
Dofoperator= (const Dof &rhs)=delete
 The (copy) operator=.
 
Dofoperator= (Dof &&rhs)=delete
 The (move) operator=.
 

Static Public Member Functions

static DofNS::unique_id GenerateNewEligibleId ()
 Generate a unique id.
 
static void ClearUniqueIdList ()
 Clear all unique ids.
 

Private Member Functions

void SetProgramWiseIndex (const NumberingSubset &numbering_subset, DofNS::program_wise_index program_wise_index)
 
void SetProcessorWiseOrGhostIndex (const NumberingSubset &numbering_subset, DofNS::processor_wise_or_ghost_index index)
 
void SetInternalProcessorWiseOrGhostIndex (Internal::DofNS::internal_processor_wise_or_ghost_index index)
 
const processor_wise_or_ghost_index_per_numbering_subset_typeGetProcessorWiseOrGhostIndexPerNumberingSubset () const
 List of processor-wise or ghost index per numbering subset index.
 
const program_wise_index_per_numbering_subset_typeGetProgramWiseIndexPerNumberingSubset () const
 List of program-wise index per numbering subset index.
 

Static Private Member Functions

static DofNS::unique_id AssignUniqueId ()
 If AssignationMode is automatic, generates a new unique identifier.
 
static DofNS::unique_id NewUniqueId (DofNS::unique_id new_unique_id)
 If AssignationMode is manual, checks the unique identifier provided is valid.
 
static std::set< DofNS::unique_id > & StaticUniqueIdList ()
 List of all identifiers existing for DerivedT.
 

Private Attributes

Internal::DofNS::internal_processor_wise_or_ghost_index internal_processor_wise_or_ghost_index_
 Processor- or ghost-wise index independent of the numbering subset.
 
processor_wise_or_ghost_index_per_numbering_subset_type processor_wise_or_ghost_index_per_numbering_subset_
 Processor-wise or ghost index.
 
program_wise_index_per_numbering_subset_type program_wise_index_per_numbering_subset_
 Program-wise index.
 
std::weak_ptr< const Nodenode_
 Weak pointer to NodeBearer.
 
const DofNS::unique_id unique_id_
 The value of the unique id for the current DerivedT object.
 

Friends

struct MoReFEM::Internal::DofNS::SetIndex
 This friendship enables to give access to private attributes to the class to an anonymous function in GodOfDof__Init.cpp file.
 

Detailed Description

Class in charge of dof information.

This class mostly sports the different numbering associated to a given dof:

Dof objects are expected to be stored within Node objects, but they also appears directly in internals of GodOfDof.

Member Typedef Documentation

◆ processor_wise_or_ghost_index_per_numbering_subset_type

Initial value:
std::vector<std::pair<::MoReFEM::NumberingSubsetNS::unique_id, DofNS::processor_wise_or_ghost_index>>

Convenient alias.

◆ program_wise_index_per_numbering_subset_type

Initial value:
std::vector<std::pair<::MoReFEM::NumberingSubsetNS::unique_id, DofNS::program_wise_index>>

Convenient alias.

Constructor & Destructor Documentation

◆ Dof() [1/3]

MoReFEM::Dof::Dof ( const std::shared_ptr< const Node > & node_ptr)
explicit

Constructor.

Parameters
[in]node_ptrPointer to the Node onto which the dof will be created.

◆ Dof() [2/3]

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

The copy constructor.

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

◆ Dof() [3/3]

MoReFEM::Dof::Dof ( Dof && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

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

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

The (move) operator=.

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

◆ GetProcessorWiseOrGhostIndex()

DofNS::processor_wise_or_ghost_index MoReFEM::Dof::GetProcessorWiseOrGhostIndex ( const NumberingSubset & numbering_subset) const

Processor-wise or ghost index.

This index tells where the dof is stored locally in the vector. The processor-wise indexes comes first; then all the ghost are grouped together. It is FEltSpace class that is aware where the ghost begins; current class is oblivious whether it is a ghost or a processor-wise value.

This index should typically be used when an element must be fetched in a parallel Petsc::Vector and a Petsc::AccessGhostContent object is used to do so.

Nonetheless, beware: function Petsc::Vector::GetValues() and Petsc::Vector::SetValues() expects a program- wise index rather than a processor-wise one.

Parameters
[in]numbering_subsetNumbering subset considered.
Returns
Processor-wise or ghost index of the dof in the given numbering_subset.

◆ GetProgramWiseIndex()

DofNS::program_wise_index MoReFEM::Dof::GetProgramWiseIndex ( const NumberingSubset & numbering_subset) const

Program-wise index.

This index is useful when you deal with a parallel matrix: for instance if you need to zero a row for a boundary condition, Petsc expects a program-wise index to do so.

Parameters
[in]numbering_subsetNumbering subset considered.
Returns
Program-wise index of the dof in the given numbering_subset.

◆ GetInternalProcessorWiseOrGhostIndex()

Internal::DofNS::internal_processor_wise_or_ghost_index MoReFEM::Dof::GetInternalProcessorWiseOrGhostIndex ( ) const
noexcept

Processor- or ghost-wise index independent of the numbering subset.

A same dof may be present or not in a given numbering subset, and there is no guaranteed special numbering subset that encompass all the dofs of a given GodOfDof.

Hence this index which covers all the dofs on a same processor, regardless of their numbering subset.

Returns
Processor- or ghost-wise index independent of the numbering subset.

◆ IsInNumberingSubset()

bool MoReFEM::Dof::IsInNumberingSubset ( const NumberingSubset & numbering_subset) const

Whether the current dof is present in numbering_subset.

[internal] Such a check is made by looking into program_wise_index_per_numbering_subset_: the processor-wise counterpart might have been left empty if not required by the model.

Parameters
[in]numbering_subsetNumbering subset considered.
Returns
True if the dof belong to numbering_subset.

◆ GetNodeFromWeakPtr()

std::shared_ptr< const Node > MoReFEM::Dof::GetNodeFromWeakPtr ( ) const

Return a pointer to the Node to which the current dof belongs to.

[internal] No reference on purpose here: node_ is stored as a weak_ptr not to introduce circular dependency.

Returns
Shared pointer to the enclosing Node.

◆ SetProgramWiseIndex()

void MoReFEM::Dof::SetProgramWiseIndex ( const NumberingSubset & numbering_subset,
DofNS::program_wise_index program_wise_index )
private

Set the program-wise index for the given numbering_subset.

Parameters
[in]numbering_subsetNumberingSubset for which program-wise index is set.
[in]program_wise_indexValue of the program-wise index, computed outside the class.

◆ SetProcessorWiseOrGhostIndex()

void MoReFEM::Dof::SetProcessorWiseOrGhostIndex ( const NumberingSubset & numbering_subset,
DofNS::processor_wise_or_ghost_index index )
private

Set the processor-wise index for the given numbering_subset.

Parameters
[in]numbering_subsetNumberingSubset for which processor-wise or ghost index is set.
[in]indexValue of the index, computed outside the class.

◆ SetInternalProcessorWiseOrGhostIndex()

void MoReFEM::Dof::SetInternalProcessorWiseOrGhostIndex ( Internal::DofNS::internal_processor_wise_or_ghost_index index)
private

Set a processor-wise index regardless of the numbering subset.

Parameters
[in]indexIndex to set, computed outside the class.

◆ GetUniqueId()

DofNS::unique_id MoReFEM::Crtp::UniqueId< Dof , DofNS::unique_id , UniqueIdNS::AssignationMode::automatic , UniqueIdNS::DoAllowNoId::no >::GetUniqueId ( ) const
inherited

Get the value of the internal unique ID.

Returns
Unique id.

◆ GenerateNewEligibleId()

static DofNS::unique_id MoReFEM::Crtp::UniqueId< Dof , DofNS::unique_id , UniqueIdNS::AssignationMode::automatic , UniqueIdNS::DoAllowNoId::no >::GenerateNewEligibleId ( )
staticinherited

Generate a unique id.

No new objects is created, and the new identifier is not counted in the list - the purpose here is just to provide a value that don't collide with existing objects. This is really used in a very edge case; think twice before using this functionality as it really might not be what you really seek.

Returns
A unique id that is not in use yet.

◆ ClearUniqueIdList()

static void MoReFEM::Crtp::UniqueId< Dof , DofNS::unique_id , UniqueIdNS::AssignationMode::automatic , UniqueIdNS::DoAllowNoId::no >::ClearUniqueIdList ( )
staticinherited

Clear all unique ids.

Attention
This functionality has been put there only for the sake of writing tests; please do not use it! It should be considered as private, even if unfortunately I can't easily put it that way.

◆ AssignUniqueId()

static DofNS::unique_id MoReFEM::Crtp::UniqueId< Dof , DofNS::unique_id , UniqueIdNS::AssignationMode::automatic , UniqueIdNS::DoAllowNoId::no >::AssignUniqueId ( )
staticprivateinherited

If AssignationMode is automatic, generates a new unique identifier.

Returns
The new unique id, which is just an increment from the previously assigned one.

◆ NewUniqueId()

static DofNS::unique_id MoReFEM::Crtp::UniqueId< Dof , DofNS::unique_id , UniqueIdNS::AssignationMode::automatic , UniqueIdNS::DoAllowNoId::no >::NewUniqueId ( DofNS::unique_id new_unique_id)
staticprivateinherited

If AssignationMode is manual, checks the unique identifier provided is valid.

Parameters
[in]new_unique_idThe proposed new unique id. If it already exists an exception will be thrown.
Returns
The unmodified unique id.

Friends And Related Symbol Documentation

◆ MoReFEM::Internal::DofNS::SetIndex

friend struct MoReFEM::Internal::DofNS::SetIndex
friend

This friendship enables to give access to private attributes to the class to an anonymous function in GodOfDof__Init.cpp file.

The alternative would be to make the attribute public, which would have been misleading; now the access is still possible but the call sequence makes it obvious it is not intended to be used by a standard user of the library.

Field Documentation

◆ internal_processor_wise_or_ghost_index_

Internal::DofNS::internal_processor_wise_or_ghost_index MoReFEM::Dof::internal_processor_wise_or_ghost_index_
private
Initial value:
=
NumericNS::UninitializedIndex<Internal::DofNS::internal_processor_wise_or_ghost_index>()

Processor- or ghost-wise index independent of the numbering subset.

A same dof may be present or not in a given numbering subset, and there is no guaranteed there is a special numbering subset that encompass all the dofs of a given GodOfDof.

Hence this index which covers all the dofs on a same processor, regardless of their numbering subset.

◆ processor_wise_or_ghost_index_per_numbering_subset_

processor_wise_or_ghost_index_per_numbering_subset_type MoReFEM::Dof::processor_wise_or_ghost_index_per_numbering_subset_
private

Processor-wise or ghost index.

This index tells where the dof is stored locally in the vector. The processor-wise indexes comes first; then all the ghost are grouped together. It is FEltSpace class that is aware where the ghost begins; current class is oblivious whether it is a ghost or a processor-wise value.

◆ program_wise_index_per_numbering_subset_

program_wise_index_per_numbering_subset_type MoReFEM::Dof::program_wise_index_per_numbering_subset_
private

Program-wise index.

This index is the one that is assigned after the mesh has been partitioned; so it is devised so that all dofs on a same processor are contiguous. We don't care about the original mesh that was assigned to begin with (except in sequential, because in this case they are the same!).


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