MoReFEM
|
Class in charge of dof information. More...
#include <Dof.hpp>
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 Node > | GetNodeFromWeakPtr () 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. | |
Dof & | operator= (const Dof &rhs)=delete |
The (copy) operator=. | |
Dof & | operator= (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_type & | GetProcessorWiseOrGhostIndexPerNumberingSubset () const |
List of processor-wise or ghost index per numbering subset index. | |
const program_wise_index_per_numbering_subset_type & | GetProgramWiseIndexPerNumberingSubset () 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 Node > | node_ |
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. | |
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.
Convenient alias.
Convenient alias.
|
explicit |
Constructor.
[in] | node_ptr | Pointer to the Node onto which the dof will be created. |
|
delete |
The copy constructor.
[in] | rhs | The object from which the construction occurs. |
|
delete |
The move constructor.
[in] | rhs | The object from which the construction occurs. |
The (copy) operator=.
[in] | rhs | The object from which the affectation occurs. |
The (move) operator=.
[in] | rhs | The object from which the affectation occurs. |
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.
[in] | numbering_subset | Numbering subset considered. |
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.
[in] | numbering_subset | Numbering subset considered. |
|
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.
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.
[in] | numbering_subset | Numbering subset considered. |
std::shared_ptr< const Node > MoReFEM::Dof::GetNodeFromWeakPtr | ( | ) | const |
|
private |
Set the program-wise index for the given numbering_subset.
[in] | numbering_subset | NumberingSubset for which program-wise index is set. |
[in] | program_wise_index | Value of the program-wise index, computed outside the class. |
|
private |
Set the processor-wise index for the given numbering_subset.
[in] | numbering_subset | NumberingSubset for which processor-wise or ghost index is set. |
[in] | index | Value of the index, computed outside the class. |
|
private |
Set a processor-wise index regardless of the numbering subset.
[in] | index | Index to set, computed outside the class. |
|
inherited |
Get the value of the internal unique ID.
|
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.
|
staticinherited |
Clear all unique ids.
|
staticprivateinherited |
If AssignationMode is automatic, generates a new unique identifier.
|
staticprivateinherited |
If AssignationMode is manual, checks the unique identifier provided is valid.
[in] | new_unique_id | The proposed new unique id. If it already exists an exception will be thrown. |
|
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.
|
private |
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.
|
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.
|
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!).