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::GodOfDof Class Referencefinal

Object in charge of all the dofs related to a given Mesh. More...

#include <GodOfDof.hpp>

Inheritance diagram for MoReFEM::GodOfDof:
Collaboration diagram for MoReFEM::GodOfDof:

Public Types

using shared_ptr = std::shared_ptr<GodOfDof>
 
using const_shared_ptr = std::shared_ptr<const GodOfDof>
 
using unique_id_parent = Crtp::UniqueId<GodOfDof, MeshNS::unique_id, UniqueIdNS::AssignationMode::manual>
 Convenient alias to one of the parent.
 
using underlying_type
 Type used for the unique id.
 

Public Member Functions

const MeshGetMesh () const noexcept
 Get the mesh object.
 
const FEltSpaceGetFEltSpace (FEltSpaceNS::unique_id unique_id) const
 Get access to the unique_id -th finite element space.
 
bool IsFEltSpace (FEltSpaceNS::unique_id unique_id) const
 
const FEltSpace::vector_unique_ptrGetFEltSpaceList () const noexcept
 Get the list of FEltSpace.
 
const NodeBearer::vector_shared_ptrGetProcessorWiseNodeBearerList () const noexcept
 Returns the list of node bearers present on local processor.
 
const NodeBearer::vector_shared_ptrGetGhostNodeBearerList () const noexcept
 Returns the list of ghost node bearers.
 
std::size_t NprocessorWiseDof () const noexcept
 Returns the number of processor-wise dofs (excluding ghosts).
 
std::size_t NprocessorWiseDof (const NumberingSubset &numbering_subset) const
 
std::size_t NprogramWiseDof () const noexcept
 Get the number of program-wise dofs.
 
std::size_t NprogramWiseDof (const NumberingSubset &numbering_subset) const
 
const Dof::vector_shared_ptrGetProcessorWiseDofList () const noexcept
 Get the list of all processor-wise dofs.
 
const Dof::vector_shared_ptrGetGhostDofList () const noexcept
 Get the list of all ghost dofs.
 
const NumberingSubset::vector_const_shared_ptrGetNumberingSubsetList () const noexcept
 List of all numbering subsets, computed from the finite element spaces.
 
const Wrappers::Petsc::MatrixPatternGetMatrixPattern (const NumberingSubset &row_numbering_subset, const NumberingSubset &column_numbering_subset) const
 
const Wrappers::Petsc::MatrixPatternGetMatrixPattern (const NumberingSubset &numbering_subset) const
 
Dof::vector_shared_ptr GetBoundaryConditionDofList (const NumberingSubset &numbering_subset) const
 Return the list of the dofs involved in an essential boundary condition.
 
GodOfDof::shared_ptr GetSharedPtr ()
 Yield a shared_ptr to the current object.
 
bool HasInitBeenCalled () const
 Whether Init() has already been called or not.
 
void PrintDofInformation (const NumberingSubset &numbering_subset, std::ostream &stream) const
 
const NumberingSubsetGetNumberingSubset (NumberingSubsetNS::unique_id unique_id) const
 
const NumberingSubset::const_shared_ptrGetNumberingSubsetPtr (NumberingSubsetNS::unique_id unique_id) const
 
template<Internal::GodOfDofNS::wildcard_for_rank is_wildcard = Internal::GodOfDofNS::wildcard_for_rank::no>
const FilesystemNS::DirectoryGetOutputDirectory () const noexcept
 Get the output directory.
 
template<Internal::GodOfDofNS::wildcard_for_rank is_wildcard = Internal::GodOfDofNS::wildcard_for_rank::no>
const FilesystemNS::DirectoryGetOutputDirectoryForNumberingSubset (const NumberingSubset &numbering_subset) const
 Returns the name of the subfolder related to a given numbering subset.
 
void ClearTemporaryData () const noexcept
 Clear the temporary data used to build properly the Internal::FEltNS::Local2GlobalStorage objects.
 
template<BoundaryConditionMethod BoundaryConditionMethodT>
void ApplyBoundaryCondition (const DirichletBoundaryCondition &boundary_condition, GlobalMatrix &matrix) const
 
template<BoundaryConditionMethod BoundaryConditionMethodT>
void ApplyBoundaryCondition (const DirichletBoundaryCondition &boundary_condition, GlobalVector &vector) const
 
void ApplyPseudoElimination (const DirichletBoundaryCondition &boundary_condition, GlobalMatrix &matrix) const
 Apply one boundary condition by pseudo-elimination on a matrix.
 
void ApplyPseudoElimination (const DirichletBoundaryCondition &boundary_condition, GlobalVector &vector) const
 Apply one boundary condition by pseudo-elimination on a vector.
 
void ApplyPenalization (const DirichletBoundaryCondition &boundary_condition, GlobalMatrix &matrix) const
 Apply one boundary condition by penalization on a matrix.
 
void ApplyPenalization (const DirichletBoundaryCondition &boundary_condition, GlobalVector &vector) const
 Apply one boundary condition by penalization on a vector.
 
MeshGetNonCstMesh () noexcept
 Non constant access to the mesh object.
 
const std::map<::MoReFEM::NumberingSubsetNS::unique_id, std::size_t > & NprogramWiseDofPerNumberingSubset () const noexcept
 
DoConsiderProcessorWiseLocal2Global GetDoConsiderProcessorWiseLocal2Global () const
 Whether local2global arrays for processor-wise indexes might be required or not.
 
const Wrappers::MpiGetMpi () const noexcept
 
MeshNS::unique_id GetUniqueId () const
 Get the value of the internal unique ID.
 

Static Public Member Functions

static const std::string & ClassName ()
 Name of the class.
 
static MeshNS::unique_id GenerateNewEligibleId ()
 Generate a unique id.
 
static void ClearUniqueIdList ()
 Clear all unique ids.
 

Private Member Functions

NodeBearer::vector_shared_ptrGetNonCstProcessorWiseNodeBearerList () noexcept
 Non constant access to the list of node bearers.
 
NodeBearer::vector_shared_ptrGetNonCstGhostNodeBearerList () noexcept
 Non constant access to the list of ghost node bearers.
 
void SetUpNodeBearersFromPrepartitionedData (::MoReFEM::Wrappers::Lua::OptionFile &god_of_dof_prepartitioned_data, Internal::FEltSpaceNS::optional_ref_connectivity_per_numbering_subset_type connectivity_per_numbering_subset=std::nullopt)
 Sort and reindex the NodeBearer so that they match what is expected for the parallel run.
 
auto GetIteratorFEltSpace (FEltSpaceNS::unique_id unique_id) const
 Iterator to the finite element space which index is unique_id.
 
void Reduce (const Internal::FEltSpaceNS::AssignGeomEltToProcessor &assign_geom_elt_to_processor, const std::optional< MeshNS::InterpolationNS::CoordsMatching > &coords_matching)
 Reduce to processor-wise data.
 
Internal::FEltSpaceNS::MatchInterfaceNodeBearer CreateNodeBearers ()
 Create all the NodeBearer objects.
 
void CreateNodes (Internal::FEltSpaceNS::MatchInterfaceNodeBearer &match_interface_node_bearer)
 Create all the Nodes by iterating through all LocalFEltSpace of FEltSpace.
 
void ComputeDofIndexes ()
 Compute all the indexes related to all of the Dof.
 
void ReduceToProcessorWise (const Internal::FEltSpaceNS::AssignGeomEltToProcessor &assign_geom_elt_to_processor, Internal::FEltSpaceNS::MatchInterfaceNodeBearer &match_interface_node_bearer, Internal::FEltSpaceNS::connectivity_per_numbering_subset_type &connectivity_per_numbering_subset)
 Reduce to processor-wise the finite elements in each finite element space, the mesh and computes the ghost node bearers.
 
std::size_t NprocessorWiseNodeBearer () const noexcept
 Returns the number of node bearers.
 
void SetBoundaryConditions ()
 Set for each concerned dof the associated value from a Dirichlet boundary condition.
 
Dof::vector_shared_ptrGetNonCstProcessorWiseDofList () noexcept
 Get the list of all processor-wise dofs (ghost excluded).
 
Dof::vector_shared_ptrGetNonCstGhostDofList () noexcept
 Get the list of all ghost dofs.
 
const NumberingSubset::vector_const_shared_ptrComputeNumberingSubsetList ()
 Iterate through all finite element spaces and compute the list of all numbering subsets.
 
void PrepareOutput (const Internal::Parallelism *parallelism)
 Prepare the subfolders for each numbering_subset.
 
const Internal::FEltSpaceNS::NdofHolderGetNdofHolder () const noexcept
 Accessor to NdofHolder.
 
Internal::FEltSpaceNS::MatchInterfaceNodeBearer InitNodeBearers ()
 First part of the Init() method, that begins to initialize stuff but has not yet begun the reduction to processor-wise.
 
void CreateNodesAndDofs (Internal::FEltSpaceNS::MatchInterfaceNodeBearer &match_interface_node_bearer)
 Third part of the Init() method, which mostly settles the data reduction to processor-size.
 
void Reduce (Internal::FEltSpaceNS::MatchInterfaceNodeBearer &match_interface_node_bearer, Internal::FEltSpaceNS::connectivity_per_numbering_subset_type &connectivity_per_numbering_subset)
 Reduce to processor-wise and ghost data..
 
void ComputeGhostNodeBearerListForCoordsMatching (const MeshNS::InterpolationNS::CoordsMatching &coords_matching, const NumberingSubset &source_numbering_subset, Internal::FEltSpaceNS::MatchInterfaceNodeBearer &match_interface_node_bearer)
 Identify the supplementary ghost NodeBearer that should be kept for CoordsMatching purpose.
 
void SetFEltSpaceList (FEltSpace::vector_unique_ptr &&felt_space_list)
 Set list of FEltSpace.
 
template<::MoReFEM::Advanced::Concept::MoReFEMDataType MoReFEMDataT>
void InitFromPreprocessedData (const MoReFEMDataT &morefem_data)
 The method called by Init() when the parallelism strategy is "run_from_preprocessed_data".
 
void InitFromPreprocessedDataHelper (::MoReFEM::Wrappers::Lua::OptionFile &god_of_dof_prepartioned_data)
 The method that does the heavy bulk of InitFromPreprocessedData - once the correct data have been extracted from the input data file.
 
void FinalizeInitialization (DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global, const Internal::Parallelism *parallelism)
 Finalize the initialization of the GodOfDof (through Init() call).
 
void InitOutputDirectories (const FilesystemNS::Directory &output_directory)
 Set and create the output directories.
 

Static Private Member Functions

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

Private Attributes

FEltSpace::vector_unique_ptr felt_space_list_
 List of all finite element spaces related to the mesh covered by GodOfDof.
 
NumberingSubset::vector_const_shared_ptr numbering_subset_list_
 List of all numbering subsets, computed from the finite element spaces.
 
Meshmesh_
 Mesh covered by the current object.
 
NodeBearer::vector_shared_ptr processor_wise_node_bearer_list_
 List of all node bearers. Each one is present only once here; ghost aren't present in this one.
 
NodeBearer::vector_shared_ptr ghost_node_bearer_list_
 
Internal::FEltSpaceNS::NdofHolder::const_unique_ptr Ndof_holder_ = nullptr
 Objects that counts the number of dofs in several configurations.
 
Internal::GodOfDofNS::OutputDirectoryStorage::const_unique_ptr output_directory_storage_ = nullptr
 Object in charge of storing output directories.
 
Internal::GodOfDofNS::OutputDirectoryStorage::const_unique_ptr output_directory_wildcard_storage_ = nullptr
 Object in charge of storing output directories with wildcarfs instead of rank id (for use in output files).
 
Dof::vector_shared_ptr processor_wise_dof_list_
 List of processor-wise dofs.
 
Dof::vector_shared_ptr ghost_dof_list_
 List of processor-wise dofs.
 
Internal::FEltSpaceNS::MatrixPattern::vector_const_unique_ptr matrix_pattern_per_numbering_subset_
 CSR Pattern of the matrix.
 
FilesystemNS::File time_iteration_file_
 Path of the file listing the time iterations and the related files.
 
bool has_init_been_called_ = false
 Whether Init() has already been called or not.
 
DoConsiderProcessorWiseLocal2Global do_consider_proc_wise_local_2_global_
 Whether local2global arrays for processor-wise indexes might be required or not.
 
const Wrappers::Mpimpi_
 Mpi object.
 
const MeshNS::unique_id unique_id_
 The value of the unique id for the current DerivedT object.
 

Friends

class GodOfDofManager
 Friendship.
 
class Internal::GodOfDofNS::InitAllGodOfDof
 Friendship.
 
class TestNS::LoadPrepartitionedGodOfDofNS::Model
 Friendship to test class,.
 

Special members.

 GodOfDof (const Wrappers::Mpi &mpi, Mesh &mesh)
 Constructor.
 
 ~GodOfDof ()=default
 Destructor.
 
 GodOfDof (const GodOfDof &rhs)=delete
 The copy constructor.
 
 GodOfDof (GodOfDof &&rhs)=default
 The move constructor.
 
GodOfDofoperator= (const GodOfDof &rhs)=delete
 The (copy) operator=.
 
GodOfDofoperator= (GodOfDof &&rhs)=delete
 The (move) operator=.
 

Detailed Description

Object in charge of all the dofs related to a given Mesh.

There is exactly one GodOfDof per Mesh; both objects share the same unique id. For instance if in the input data file there is

   Mesh2 = { ... }

a Mesh AND a GodOfDof with an identifier of 2 are created.

GodOfDof is also the place where all finite element spaces related to a given mesh are stored.

Member Typedef Documentation

◆ shared_ptr

using MoReFEM::GodOfDof::shared_ptr = std::shared_ptr<GodOfDof>

Alias to shared pointer. It is a shared_pointer and not unique_ptr here as weak_pointers will be used in FEltSpace.

◆ const_shared_ptr

using MoReFEM::GodOfDof::const_shared_ptr = std::shared_ptr<const GodOfDof>

Alias to shared pointer. It is a shared_pointer and not unique_ptr here as weak_pointers will be used in FEltSpace.

Constructor & Destructor Documentation

◆ GodOfDof() [1/3]

MoReFEM::GodOfDof::GodOfDof ( const Wrappers::Mpi & mpi,
Mesh & mesh )
explicitprivate

Constructor.

[internal] It is private as construction should be driven by friend GodOfDofManager.

Parameters
[in]mpiMpi object which knows the rank of the processor, the total number of processors, etc...
[in]meshMesh upon which the GodOfDof is built.

◆ GodOfDof() [2/3]

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

The copy constructor.

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

◆ GodOfDof() [3/3]

MoReFEM::GodOfDof::GodOfDof ( GodOfDof && rhs)
default

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

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

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

The (move) operator=.

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

◆ GetFEltSpace()

const FEltSpace & MoReFEM::GodOfDof::GetFEltSpace ( FEltSpaceNS::unique_id unique_id) const

Get access to the unique_id -th finite element space.

It assumes the finite element space does exist in the GodOfDof; this can be checked beforehand with IsFEltSpace(index).

Parameters
[in]unique_idUnique identifier of the sought FEltSpace (as returned by FEltSpace::GetUniqueId()).
Returns
Returns the unique_id -th finite element space.

◆ IsFEltSpace()

bool MoReFEM::GodOfDof::IsFEltSpace ( FEltSpaceNS::unique_id unique_id) const

Whether the finite element space unique_id is in the current GodOfDof.

Parameters
[in]unique_idUnique identifier of the sought FEltSpace (as returned by FEltSpace::GetUniqueId()).

◆ NprocessorWiseDof()

std::size_t MoReFEM::GodOfDof::NprocessorWiseDof ( const NumberingSubset & numbering_subset) const

Returns the number of processor-wise dofs (excluding ghosts) within a given numbering subset.

Parameters
[in]numbering_subsetNumberingSubset for which the tally is done.

◆ NprogramWiseDof()

std::size_t MoReFEM::GodOfDof::NprogramWiseDof ( const NumberingSubset & numbering_subset) const

Returns the number of program-wise dofs within a given numbering subset.

Parameters
[in]numbering_subsetNumberingSubset for which the tally is done.

◆ GetMatrixPattern() [1/2]

const Wrappers::Petsc::MatrixPattern & MoReFEM::GodOfDof::GetMatrixPattern ( const NumberingSubset & row_numbering_subset,
const NumberingSubset & column_numbering_subset ) const

Fetch the matrix pattern which rows are numbered by row_numbering_subset, and columns by column_numbering_subset.

Parameters
[in]row_numbering_subsetNumberingSubset used for the rows.
[in]column_numbering_subsetNumberingSubset used for the columns.

◆ GetMatrixPattern() [2/2]

const Wrappers::Petsc::MatrixPattern & MoReFEM::GodOfDof::GetMatrixPattern ( const NumberingSubset & numbering_subset) const

Shorthand function for a matrix described only by one numbering_subset (square matrix).

Parameters
[in]numbering_subsetSame NumberingSubset used for the rows and the columns.

◆ GetBoundaryConditionDofList()

Dof::vector_shared_ptr MoReFEM::GodOfDof::GetBoundaryConditionDofList ( const NumberingSubset & numbering_subset) const

Return the list of the dofs involved in an essential boundary condition.

The dofs may be processor-wise or ghosts; as usual ghost are packed together at the end of the container.

Attention
There is a return-by-value as it is currently used only in State constructor; store that somewhere if it is needed by something else!
Parameters
[in]numbering_subsetOnly dofs that belongs to this NumberingSubset are requested.
Returns
List of dofs encompassed by the boundary conditions relared to numbering_subset.

◆ GetSharedPtr()

GodOfDof::shared_ptr MoReFEM::GodOfDof::GetSharedPtr ( )

Yield a shared_ptr to the current object.

This requires that at least one shared_ptr to this object exists (see behaviour of std::enable_shared_from_this for more details).

Returns
Return shared_from_this().

◆ HasInitBeenCalled()

bool MoReFEM::GodOfDof::HasInitBeenCalled ( ) const

Whether Init() has already been called or not.

Finite element spaces are fully initialized with the call to Init(), which among other things fill them and partition the mesh. They must not be defined after this call; current debug attribute is there to ensure it doesn't happen.

Returns
Whether Init() has already been called or not.

◆ PrintDofInformation()

void MoReFEM::GodOfDof::PrintDofInformation ( const NumberingSubset & numbering_subset,
std::ostream & stream ) const

Print the information for each dof.

Parameters
[in]numbering_subsetNumberingSubset for which dof information will be printed.
Parameters
[in,out]streamStream upon which object information are written.

◆ GetNumberingSubset()

const NumberingSubset & MoReFEM::GodOfDof::GetNumberingSubset ( NumberingSubsetNS::unique_id unique_id) const

Get the numbering subset which id is unique_id.

Parameters
[in]unique_idUnique identifier of the sought NumberingSubset (as returned by NumberingSubset::GetUniqueId()).

◆ GetNumberingSubsetPtr()

const NumberingSubset::const_shared_ptr & MoReFEM::GodOfDof::GetNumberingSubsetPtr ( NumberingSubsetNS::unique_id unique_id) const

Get the numbering subset which id is unique_id as a smart pointer.

Parameters
[in]unique_idUnique identifier of the sought NumberingSubset (as returned by NumberingSubset::GetUniqueId()).

◆ GetOutputDirectoryForNumberingSubset()

template<Internal::GodOfDofNS::wildcard_for_rank is_wildcard = Internal::GodOfDofNS::wildcard_for_rank::no>
const FilesystemNS::Directory & MoReFEM::GodOfDof::GetOutputDirectoryForNumberingSubset ( const NumberingSubset & numbering_subset) const

Returns the name of the subfolder related to a given numbering subset.

For instance

*path_to_output_directory* /NumberingSubset*i*
Descriptor of a dof numbering.
Definition NumberingSubset.hpp:63

where i is the unique id of the numbering subset.

Parameters
[in]numbering_subsetNumbering subset for which output folder is sought.
Returns
Name of the subfolder related to a given numbering subset.

◆ ApplyBoundaryCondition() [1/2]

template<BoundaryConditionMethod BoundaryConditionMethodT>
void MoReFEM::GodOfDof::ApplyBoundaryCondition ( const DirichletBoundaryCondition & boundary_condition,
GlobalMatrix & matrix ) const

Apply the boundary condition method given in template argument.

Template Parameters
BoundaryConditionMethodTMethod used to enforce the boundary condition.
Parameters
[in]boundary_conditionDirichletBoundaryCondition to be applied.
[in,out]matrixGlobalMatrix upon which the boundary condition will be enforced.

◆ ApplyBoundaryCondition() [2/2]

template<BoundaryConditionMethod BoundaryConditionMethodT>
void MoReFEM::GodOfDof::ApplyBoundaryCondition ( const DirichletBoundaryCondition & boundary_condition,
GlobalVector & vector ) const

Apply the boundary condition method given in template argument.

Template Parameters
BoundaryConditionMethodTMethod used to enforce the boundary condition.
Parameters
[in]boundary_conditionDirichletBoundaryCondition to be applied.
[in,out]vectorGlobalVector upon which the boundary condition will be enforced.

◆ ApplyPseudoElimination() [1/2]

void MoReFEM::GodOfDof::ApplyPseudoElimination ( const DirichletBoundaryCondition & boundary_condition,
GlobalMatrix & matrix ) const

Apply one boundary condition by pseudo-elimination on a matrix.

Relevant numbering subset is read from the matrix object.

Parameters
[in]boundary_conditionBoundary condition to be applied.
[in,out]matrixMatrix upon which the condition is applied.

◆ ApplyPseudoElimination() [2/2]

void MoReFEM::GodOfDof::ApplyPseudoElimination ( const DirichletBoundaryCondition & boundary_condition,
GlobalVector & vector ) const

Apply one boundary condition by pseudo-elimination on a vector.

Relevant numbering subset is read from the vector object.

Parameters
[in]boundary_conditionBoundary condition to be applied.
[in,out]vectorVector upon which the condition is applied.

◆ ApplyPenalization() [1/2]

void MoReFEM::GodOfDof::ApplyPenalization ( const DirichletBoundaryCondition & boundary_condition,
GlobalMatrix & matrix ) const

Apply one boundary condition by penalization on a matrix.

Relevant numbering subset is read from the matrix object.

Parameters
[in]boundary_conditionBoundary condition to be applied.
[in,out]matrixMatrix upon which the condition is applied.

◆ ApplyPenalization() [2/2]

void MoReFEM::GodOfDof::ApplyPenalization ( const DirichletBoundaryCondition & boundary_condition,
GlobalVector & vector ) const

Apply one boundary condition by penalization on a vector.

Relevant numbering subset is read from the vector object.

Parameters
[in]boundary_conditionBoundary condition to be applied.
[in,out]vectorVector upon which the condition is applied.

◆ GetNonCstMesh()

Mesh & MoReFEM::GodOfDof::GetNonCstMesh ( )
noexcept

Non constant access to the mesh object.

Attention
Access is public solely for the needs of FEltSpace::Movemesh(). You shouldn't call this accessor at all unless you are modifying the core of MoReFLoEM; during the development of a model you shouldn't use this one at all and prefer the constant accessor.
Returns
Mesh on top of which the GodOfDof has been built.

◆ SetUpNodeBearersFromPrepartitionedData()

void MoReFEM::GodOfDof::SetUpNodeBearersFromPrepartitionedData ( ::MoReFEM::Wrappers::Lua::OptionFile & god_of_dof_prepartitioned_data,
Internal::FEltSpaceNS::optional_ref_connectivity_per_numbering_subset_type connectivity_per_numbering_subset = std::nullopt )
private

Sort and reindex the NodeBearer so that they match what is expected for the parallel run.

This method is expected to be called in a run from prepartitioned data, just after the NodeBearer have been created from the reduced data. At this stage before the call, we get a list of NodeBearers, but we don't know yet:

  • Whether a given NodeBearer is processor-wise or ghost (by construct no other option!)
  • Their indexes.

These information are properly filled by the method.

Parameters
[in]god_of_dof_prepartitioned_dataThe OptionFile which contains the data required to reconstruct properly the GodOfDof in a run from preprocessed data. It should really be seen as an input only - the fact it is not const is due to the constraints of the OptionFile implementation.
[out]connectivity_per_numbering_subsetFor each NumberingSubset, track for each processor-wise NodeBearer the other NodeBearer s to which it is collected - including ghosted ones.

◆ GetIteratorFEltSpace()

auto MoReFEM::GodOfDof::GetIteratorFEltSpace ( FEltSpaceNS::unique_id unique_id) const
private

Iterator to the finite element space which index is unique_id.

Iterator might be the end of the list; this method is only for internal purposes.

Parameters
[in]unique_idUnique identifier of the FEltSpace (noticeably used in the input data file to tag the finite element space).
Returns
Iterator to the finite element space which index is unique_id.

◆ Reduce() [1/2]

void MoReFEM::GodOfDof::Reduce ( const Internal::FEltSpaceNS::AssignGeomEltToProcessor & assign_geom_elt_to_processor,
const std::optional< MeshNS::InterpolationNS::CoordsMatching > & coords_matching )
private

Reduce to processor-wise data.

Parameters
[in]assign_geom_elt_to_processorThe object which was used to determine which rank is in charge of each GeometricElt.
Parameters
[in]coords_matchingIf there is a FromCoordsMatching operator, the association between Coords of both meshes involved.

◆ CreateNodeBearers()

Internal::FEltSpaceNS::MatchInterfaceNodeBearer MoReFEM::GodOfDof::CreateNodeBearers ( )
private

Create all the NodeBearer objects.

And only those - their content (Node and Dof) is created later, after the reduction in parallel mode.

Returns
An helper object which is used during initialization.

◆ CreateNodes()

void MoReFEM::GodOfDof::CreateNodes ( Internal::FEltSpaceNS::MatchInterfaceNodeBearer & match_interface_node_bearer)
private

Create all the Nodes by iterating through all LocalFEltSpace of FEltSpace.

Parameters
[in,out]match_interface_node_bearerHelper object which stores data useful for the initialisation phase.

This method is expected to be called AFTER the reduction process occurred. After the call, all relevant Node are created and they are properly sorted as processor-wise or ghost.

Don't call this method directly: it is automatically called in CreateNodesAndDofs().

◆ ComputeDofIndexes()

void MoReFEM::GodOfDof::ComputeDofIndexes ( )
private

Compute all the indexes related to all of the Dof.

This includes the indexes for each relevant NumbberingSubset.

◆ ReduceToProcessorWise()

void MoReFEM::GodOfDof::ReduceToProcessorWise ( const Internal::FEltSpaceNS::AssignGeomEltToProcessor & assign_geom_elt_to_processor,
Internal::FEltSpaceNS::MatchInterfaceNodeBearer & match_interface_node_bearer,
Internal::FEltSpaceNS::connectivity_per_numbering_subset_type & connectivity_per_numbering_subset )
private

Reduce to processor-wise the finite elements in each finite element space, the mesh and computes the ghost node bearers.

Parameters
[in]assign_geom_elt_to_processorThe object which was used to determine which rank is in charge of each GeometricElt.
[in,out]match_interface_node_bearerHelper object which stores data useful for the initialisation phase.
Parameters
[in,out]connectivity_per_numbering_subsetNodeBearer connectivity for each NumberingSubset. This is also an input parameter: if there are several GodOfDof involved in the model at hand there might be already data from another GodOfDof.

The only quantity not yet reduced is the dofs involved in the boundary conditions.

◆ SetBoundaryConditions()

void MoReFEM::GodOfDof::SetBoundaryConditions ( )
private

Set for each concerned dof the associated value from a Dirichlet boundary condition.

[internal] Boundary conditions have not been discussed deeply yet and so essential ones are still handled à la Felisce (which is not necessarily a bad thing here). However, we depart much for the handling of natural ones.

◆ ComputeNumberingSubsetList()

const NumberingSubset::vector_const_shared_ptr & MoReFEM::GodOfDof::ComputeNumberingSubsetList ( )
private

Iterate through all finite element spaces and compute the list of all numbering subsets.

Returns
The generated list.

◆ PrepareOutput()

void MoReFEM::GodOfDof::PrepareOutput ( const Internal::Parallelism * parallelism)
private

Prepare the subfolders for each numbering_subset.

Parameters
[in]parallelismObject which holds the parallelism strategy to use. or some of them, additional information will be written on disk.

◆ InitNodeBearers()

Internal::FEltSpaceNS::MatchInterfaceNodeBearer MoReFEM::GodOfDof::InitNodeBearers ( )
private

First part of the Init() method, that begins to initialize stuff but has not yet begun the reduction to processor-wise.

It is hence decoupled because this part may be compiled, contrary to the second one.

◆ CreateNodesAndDofs()

void MoReFEM::GodOfDof::CreateNodesAndDofs ( Internal::FEltSpaceNS::MatchInterfaceNodeBearer & match_interface_node_bearer)
private

Third part of the Init() method, which mostly settles the data reduction to processor-size.

Parameters
[in,out]match_interface_node_bearerHelper object which stores data useful for the initialisation phase.

◆ Reduce() [2/2]

void MoReFEM::GodOfDof::Reduce ( Internal::FEltSpaceNS::MatchInterfaceNodeBearer & match_interface_node_bearer,
Internal::FEltSpaceNS::connectivity_per_numbering_subset_type & connectivity_per_numbering_subset )
private

Reduce to processor-wise and ghost data..

Parameters
[in,out]match_interface_node_bearerHelper object which stores data useful for the initialisation phase.
Parameters
[in,out]connectivity_per_numbering_subsetNodeBearer connectivity for each NumberingSubset. This is also an input parameter: if there are several GodOfDof involved in the model at hand there might be already data from another GodOfDof.

◆ ComputeGhostNodeBearerListForCoordsMatching()

void MoReFEM::GodOfDof::ComputeGhostNodeBearerListForCoordsMatching ( const MeshNS::InterpolationNS::CoordsMatching & coords_matching,
const NumberingSubset & source_numbering_subset,
Internal::FEltSpaceNS::MatchInterfaceNodeBearer & match_interface_node_bearer )
private

Identify the supplementary ghost NodeBearer that should be kept for CoordsMatching purpose.

If there is a CoordsMatching operator, list the NodeBearer that should be kept as ghost - some of them would have been dropped otherwise.

Parameters
[in,out]match_interface_node_bearerHelper object which stores data useful for the initialisation phase.
[in]source_numbering_subsetSource NumberingSubset in the FromCoordsMatching interpolator.
Parameters
[in]coords_matchingIf there is a FromCoordsMatching operator, the association between Coords of both meshes involved.

◆ SetFEltSpaceList()

void MoReFEM::GodOfDof::SetFEltSpaceList ( FEltSpace::vector_unique_ptr && felt_space_list)
private

Set list of FEltSpace.

Parameters
[in]felt_space_listList of all FEltSpace to consider in the GodOfDof.

Prerequisite: none - this method can be called at the very beginning of the initialization process.

◆ InitFromPreprocessedData()

template<::MoReFEM::Advanced::Concept::MoReFEMDataType MoReFEMDataT>
void MoReFEM::GodOfDof::InitFromPreprocessedData ( const MoReFEMDataT & morefem_data)
private

The method called by Init() when the parallelism strategy is "run_from_preprocessed_data".

Parameters
[in]morefem_dataThe object which encapsulates some stuff that acts as global data, such as:
  • The content of the input data.
  • Mpi related information.
  • The directory into which output is to be written.
  • Management of time iterations

Prerequisite: FEltSpace and output directories must have been initialized.

◆ InitFromPreprocessedDataHelper()

void MoReFEM::GodOfDof::InitFromPreprocessedDataHelper ( ::MoReFEM::Wrappers::Lua::OptionFile & god_of_dof_prepartioned_data)
private

The method that does the heavy bulk of InitFromPreprocessedData - once the correct data have been extracted from the input data file.

The perk is that this method is compiled, leaving only a very restrained part in the InitFromPreprocessedData method.

Parameters
[in]god_of_dof_prepartioned_dataThe OptionFile which contains the data required to reconstruct properly the GodOfDo in a run from preprocessed data. It should really be seen as an input only - the fact it is not const is due to the constraints of the OptionFile implementation.

◆ FinalizeInitialization()

void MoReFEM::GodOfDof::FinalizeInitialization ( DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global,
const Internal::Parallelism * parallelism )
private

Finalize the initialization of the GodOfDof (through Init() call).

Parameters
[in]do_consider_processor_wise_local_2_globalIf no, only the program-wise local2global array is computed. If yes, both program- and processor-wise ones are computed. By default it is no: some global operators don't need it so it's best to avoid cluttering memory when it doesn't matter.
[in]parallelismObject which holds the parallelism strategy to use. or some of them, additional information will be written on disk.

◆ InitOutputDirectories()

void MoReFEM::GodOfDof::InitOutputDirectories ( const FilesystemNS::Directory & output_directory)
private

Set and create the output directories.

Parameters
[in]output_directoryOutput directory for data specific to the mesh covered by the GodOfDof.

◆ NprogramWiseDofPerNumberingSubset()

const std::map<::MoReFEM::NumberingSubsetNS::unique_id, std::size_t > & MoReFEM::GodOfDof::NprogramWiseDofPerNumberingSubset ( ) const
noexcept

Number of program-wise dofs per NumberingSubset. You shouldn't need this: it is useful only for reloading data for two-steps parallelism.

◆ GetDoConsiderProcessorWiseLocal2Global()

DoConsiderProcessorWiseLocal2Global MoReFEM::GodOfDof::GetDoConsiderProcessorWiseLocal2Global ( ) const

Whether local2global arrays for processor-wise indexes might be required or not.

yes doesn't mean they are already computed, but is a mandatory prerequisite should they be required.

Returns
yes if local2global arrays for processor-wise indexes are to be considered.

◆ GetMpi()

const Wrappers::Mpi & MoReFEM::Crtp::CrtpMpi< GodOfDof >::GetMpi ( ) const
noexceptinherited

Read-only access to underlying Mpi object.

Returns
Constant accessor to underlying Mpi object.

◆ GetUniqueId()

MeshNS::unique_id MoReFEM::Crtp::UniqueId< GodOfDof , MeshNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::GetUniqueId ( ) const
inherited

Get the value of the internal unique ID.

Returns
Unique id.

◆ GenerateNewEligibleId()

static MeshNS::unique_id MoReFEM::Crtp::UniqueId< GodOfDof , MeshNS::unique_id , AssignationModeT, 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< GodOfDof , MeshNS::unique_id , AssignationModeT, 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 MeshNS::unique_id MoReFEM::Crtp::UniqueId< GodOfDof , MeshNS::unique_id , AssignationModeT, 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 MeshNS::unique_id MoReFEM::Crtp::UniqueId< GodOfDof , MeshNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::NewUniqueId ( MeshNS::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.

Field Documentation

◆ ghost_node_bearer_list_

NodeBearer::vector_shared_ptr MoReFEM::GodOfDof::ghost_node_bearer_list_
private

List of all ghost node bearers, that is all nodes required for calculation but not hosted by local processor.

◆ processor_wise_dof_list_

Dof::vector_shared_ptr MoReFEM::GodOfDof::processor_wise_dof_list_
private

List of processor-wise dofs.

Ghost are excluded and handled in ghost_dof_list_.

[internal] This information is redundant with the one from node_per_felt_, but it allows to use a slicker interface (direct loop instead of three imbricated ones). //

Todo
#258

◆ ghost_dof_list_

Dof::vector_shared_ptr MoReFEM::GodOfDof::ghost_dof_list_
private

List of processor-wise dofs.

[internal] This information is redundant with the one from node_per_felt_, but it allows to use a slicker interface (direct loop instead of three imbricated ones).

◆ has_init_been_called_

bool MoReFEM::GodOfDof::has_init_been_called_ = false
private

Whether Init() has already been called or not.

Finite element spaces are fully initialized with the call to Init(), which among other things fill them and partition the mesh. They must not been defined after this call; current debug attribute is there to ensure it doesn't happen.

◆ do_consider_proc_wise_local_2_global_

DoConsiderProcessorWiseLocal2Global MoReFEM::GodOfDof::do_consider_proc_wise_local_2_global_
private
Initial value:
=
DoConsiderProcessorWiseLocal2Global::no

Whether local2global arrays for processor-wise indexes might be required or not.

yes doesn't mean they are already computed, but is a mandatory prerequisite should they be required.


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