MoReFEM
|
The class in charge of most of the interaction with nodes, dofs and unknowns. More...
#include <FEltSpace.hpp>
Public Types | |
using | unique_ptr = std::unique_ptr<FEltSpace> |
Alias over unique_ptr. | |
using | vector_unique_ptr = std::vector<unique_ptr> |
Alias over a vector of unique_ptr. | |
using | unique_id_parent = Crtp::UniqueId<FEltSpace, FEltSpaceNS::unique_id, UniqueIdNS::AssignationMode::manual> |
Convenient alias to one of the parent. | |
using | underlying_type |
Type used for the unique id. | |
Public Member Functions | |
void | InitLocal2Global (DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global) |
Init the local2global array for each combination LocalFEltSpace/numbering subset. | |
void | MoveMesh (const GlobalVector &vector) const |
Use the output of the finite element space to move a mesh. | |
void | MoveMeshFromInitialPosition (const GlobalVector &vector) const |
Exactly the same as MoveMesh except that the displacement is applied upon the initial position of the mesh. | |
void | ComputeLocal2Global (const ExtendedUnknown::vector_const_shared_ptr &extended_unknown_list, DoComputeProcessorWiseLocal2Global do_compute_processor_wise_local_2_global) const |
Compute the local2global array required by a given global variational operator. | |
void | ComputeLocal2Global (ExtendedUnknown::const_shared_ptr &&extended_unknown_ptr, DoComputeProcessorWiseLocal2Global do_compute_processor_wise_local_2_global) const |
Compute the local2global array required by a given global variational operator. | |
bool | IsEmpty () const noexcept |
Return true if the FEltSpace doesn't include any finite element. | |
template<RoleOnProcessor RoleOnProcessorT> | |
const LocalFEltSpacePerRefLocalFEltSpace & | GetLocalFEltSpacePerRefLocalFEltSpace () const noexcept |
Get the list of local finite element spaces sort per finite element type. | |
template<RoleOnProcessor RoleOnProcessorT> | |
const LocalFEltSpacePerRefLocalFEltSpace & | GetLocalFEltSpacePerRefLocalFEltSpace (const Domain &domain) const |
Get the list of local finite element spaces sort per finite element type for a given domain. | |
const LocalFEltSpace & | GetLocalFEltSpace (const GeometricElt &geometric_elt) const |
Get the local felt space that matches a given geometric_elt. | |
const LocalFEltSpace::per_geom_elt_index & | GetLocalFEltSpaceList (const RefGeomElt &ref_geom_elt) const |
Get the list of local finite element spaces sort for a given ref_geom_elt. | |
const Dof::vector_shared_ptr & | GetProcessorWiseDofList () const noexcept |
Get the list of processor-wise dofs covered by the finite element space. | |
const Dof::vector_shared_ptr & | GetGhostDofList () const noexcept |
Get the list of ghost dofs covered by the finite element space. | |
std::size_t | NprocessorWiseDof () const noexcept |
Returns the number of processor-wise Dof,. | |
std::size_t | NghostDof () const noexcept |
Returns the number of ghost Dof,. | |
std::size_t | NprocessorWiseDof (const NumberingSubset &numbering_subset) const |
Returns the number of processor-wise Dof for given numbering_subset. | |
std::size_t | NprogramWiseDof (const NumberingSubset &numbering_subset) const |
Returns the number of program-wise Dof for given numbering_subset. | |
Dof::vector_shared_ptr | GetProcessorWiseDofList (const NumberingSubset &numbering_subset) const |
Get the list of processor-wise dofs covered by the finite element space and inside given numbering subset. | |
bool | DoCoverNumberingSubset (const NumberingSubset &numbering_subset) const |
Check whether numbering_subset is covered in the finite element space. | |
std::size_t | GetDimension () const noexcept |
Returns the dimension considered within the FEltSpace. | |
std::size_t | GetMeshDimension () const |
Returns the dimension of the mesh (read from the GodOfDof). | |
std::shared_ptr< const GodOfDof > | GetGodOfDofFromWeakPtr () const |
Access to the enclosing GodOfDof. | |
const ExtendedUnknown::vector_const_shared_ptr & | GetExtendedUnknownList () const noexcept |
List of all the pairs of unknowns and numbering subset. | |
const NumberingSubset & | GetNumberingSubset (const Unknown &unknown) const |
const NumberingSubset::const_shared_ptr & | GetNumberingSubsetPtr (const Unknown &unknown) const |
const ExtendedUnknown & | GetExtendedUnknown (const Unknown &unknown) const |
ExtendedUnknown::const_shared_ptr | GetExtendedUnknownPtr (const Unknown &unknown) const |
const NumberingSubset::vector_const_shared_ptr & | GetNumberingSubsetList () const noexcept |
Get the list of numbering subset. | |
void | ClearTemporaryData () const noexcept |
Clear the temporary data used to build properly the Internal::FEltNS::Local2GlobalStorage objects. | |
const QuadratureRulePerTopology & | GetQuadratureRulePerTopology () const noexcept |
Constant accessor to the list of default quadrature rules to use in operators for which no rule has been specified. | |
const QuadratureRulePerTopology * | GetQuadratureRulePerTopologyRawPtr () const noexcept |
Constant accessor to the list of default quadrature rules to use in operators for which no rule has been specified. | |
const Domain & | GetDomain () const noexcept |
const Wrappers::Mpi & | GetMpi () const noexcept |
std::mutex & | GetMutex () const |
FEltSpaceNS::unique_id | GetUniqueId () const |
Get the value of the internal unique ID. | |
Special members. | |
FEltSpace (const std::shared_ptr< const GodOfDof > &god_of_dof_ptr, const Domain &domain, FEltSpaceNS::unique_id unique_id, ExtendedUnknown::vector_const_shared_ptr &&extended_unknown_list) | |
Constructor. | |
~FEltSpace ()=default | |
Destructor. | |
FEltSpace (FEltSpace &rhs)=delete | |
The copy constructor. | |
FEltSpace (FEltSpace &&rhs)=delete | |
The move constructor. | |
FEltSpace & | operator= (FEltSpace &rhs)=delete |
The (copy) operator=. | |
FEltSpace & | operator= (FEltSpace &&rhs)=delete |
The (move) operator=. | |
Static Public Member Functions | |
static const std::string & | ClassName () |
Name of the class. | |
static FEltSpaceNS::unique_id | GenerateNewEligibleId () |
Generate a unique id. | |
static void | ClearUniqueIdList () |
Clear all unique ids. | |
Data Fields | |
friend | GodOfDof |
Friendship to GodOfDof (which stores the FEltSpace defined on its related mesh). | |
Private Member Functions | |
void | Reduce (const Internal::FEltSpaceNS::AssignGeomEltToProcessor &assign_geom_elt_to_processor) |
Reduce the LocalFEltSpace to processor-wise and ghost. | |
std::size_t | ComputeMaxOrderFElt () const |
Compute the maximal order of the finite elements present in the FEltSpace. | |
void | ComputeDofList (const std::vector< DofNS::unique_id > &dof_unique_id_list) |
Compute the list of dofs from the one available in the GodOfDof. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | FillLocalFEltSpaceList (const Mesh &mesh, const Domain &domain, const Internal::RefFEltNS::RefLocalFEltSpace &ref_local_felt_space, LocalFEltSpace::per_geom_elt_index &local_felt_space_list) const |
Fill the local finite element space list. | |
void | ClearDofLists () |
Clear both processor-wise and ghost Dof lists. | |
const LocalFEltSpace::per_geom_elt_index & | GetLocalFEltSpaceList (const Internal::RefFEltNS::RefLocalFEltSpace &ref_felt_space) const |
Get the list of local finite element spaces sort for a given RefLocalFEltSpace. | |
void | ComputeDofList () |
Sift through the GodOfDof lists and fill the lists of processor-wise and ghost Dof, and also the NdofHolder object. | |
const Internal::RefFEltNS::RefLocalFEltSpace & | GetRefLocalFEltSpace (const RefGeomElt &ref_geom_elt) const |
Get the reference finite element space related to a given ref_geom_elt. | |
Dof::vector_shared_ptr & | GetNonCstProcessorWiseDofList () noexcept |
Non constant accessor to list of processor-wise Dof . | |
Dof::vector_shared_ptr & | GetNonCstGhostDofList () noexcept |
Non constant accessor to list of ghost Dof . | |
void | SetFEltList (const Mesh &mesh, const Domain &domain) |
Prepare the finite element list from the mesh and the domain. | |
void | SetMovemeshData () |
Compute data required for movemesh if relevant. | |
const Internal::FEltSpaceNS::Storage & | GetFEltStorage () const noexcept |
Get access to the object in charge of finite element storage. | |
Internal::FEltSpaceNS::Storage & | GetNonCstFEltStorage () noexcept |
Get non constant access to the object in charge of finite element storage. | |
void | AssertGodOfDofInitialized () const |
Assert GodOfDof has been properly initialized. | |
const std::map< NumberingSubsetNS::unique_id, Internal::FEltSpaceNS::MovemeshHelper > & | GetMovemeshHelperStorage () const noexcept |
Access to useful data when a mesh must be moved according to (felt_space, numbering subset) data. | |
std::map< NumberingSubsetNS::unique_id, Internal::FEltSpaceNS::MovemeshHelper > & | GetNonCstMovemeshHelperStorage () noexcept |
Access to useful data when a mesh must be moved according to (felt_space, numbering subset) data. | |
const Internal::FEltSpaceNS::MovemeshHelper & | GetMovemeshHelper (const GlobalVector &vector) const |
const Internal::FEltSpaceNS::NdofHolder & | GetNdofHolder () const noexcept |
Accessor to NdofHolder. | |
Static Private Member Functions | |
static FEltSpaceNS::unique_id | AssignUniqueId () |
If AssignationMode is automatic, generates a new unique identifier. | |
static FEltSpaceNS::unique_id | NewUniqueId (FEltSpaceNS::unique_id new_unique_id) |
If AssignationMode is manual, checks the unique identifier provided is valid. | |
static std::set< FEltSpaceNS::unique_id > & | StaticUniqueIdList () |
List of all identifiers existing for DerivedT. | |
Private Attributes | |
Internal::FEltSpaceNS::Storage::const_unique_ptr | felt_storage_ = nullptr |
Object in charge of storing the finite elements in an efficient way so that access is as fast as possible. | |
std::size_t | dimension_ = NumericNS::UninitializedIndex<std::size_t>() |
Dimension considered within the FEltSpace. | |
std::weak_ptr< const GodOfDof > | god_of_dof_ |
Weak pointer to the enclosing God of dof. | |
const Domain & | domain_ |
const ExtendedUnknown::vector_const_shared_ptr | extended_unknown_list_ |
List of all the pairs of unknowns and numbering subset. | |
const NumberingSubset::vector_const_shared_ptr | numbering_subset_list_ |
List of numbering subsets considered. | |
std::map< NumberingSubsetNS::unique_id, Internal::FEltSpaceNS::MovemeshHelper > | movemesh_helper_data_ |
Data that helps to move efficiently a mesh. | |
Dof::vector_shared_ptr | dof_list_ |
List of processor-wise dofs (ghost excluded). | |
Dof::vector_shared_ptr | ghost_dof_list_ |
List of ghost dofs. | |
Internal::FEltSpaceNS::NdofHolder::const_unique_ptr | Ndof_holder_ = nullptr |
Objects that counts the number of dofs in several configurations. | |
bool | are_dof_list_computed_ = false |
Helper data attribute to check some methods are not called unduly before the Dof lists are computed. | |
QuadratureRulePerTopology::const_unique_ptr | default_quadrature_rule_per_topology_ = nullptr |
List of default quadrature rules to use in operators for which no rule has been specified. | |
const Wrappers::Mpi & | mpi_ |
Mpi object. | |
std::unique_ptr< std::mutex > | mutex_ |
Mutex object. | |
const FEltSpaceNS::unique_id | unique_id_ |
The value of the unique id for the current DerivedT object. | |
Friends | |
struct | Internal::FEltSpaceNS::ReduceToProcessorWise |
class | Internal::FEltSpaceNS::AssignGeomEltToProcessor |
Friendship to helper class during partitioning. | |
template<class DerivedT , class ElementaryInterpolatorT > | |
class | ConformInterpolatorNS::LagrangianNS::LagrangianInterpolator |
Friendship to interpolator to allow access to RefLocalFEltSpace. | |
class | ConformInterpolatorNS::LagrangianNS::LocalLagrangianInterpolator |
Friendship to interpolator to allow access to RefLocalFEltSpace. | |
template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, std::size_t Ndim> | |
class | ParameterNS::Policy::AtDof |
Friendship to AtDof parameter policy, which requires access to BasicRefFElt ShapeFunction() method. | |
template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, std::size_t Ndim> | |
class | ParamAtDof |
Friendship to AtDof parameter policy, which requires access to BasicRefFElt ShapeFunction() method. | |
The class in charge of most of the interaction with nodes, dofs and unknowns.
|
explicit |
Constructor.
[in] | domain | Geometric domain upon which the finite element space is defined. |
[in] | god_of_dof_ptr | Shared pointer to the enclosing god of dof; a weak pointer will be kept inside current class. |
[in] | unique_id | Unique identifier of the finite element space. This is under this identifier that the finite element space is defined in the input data file. |
[in] | extended_unknown_list | List of couples (Unknown, NumberingSubset) considered within the finite element space. |
|
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. |
void MoReFEM::FEltSpace::InitLocal2Global | ( | DoConsiderProcessorWiseLocal2Global | do_consider_processor_wise_local_2_global | ) |
Init the local2global array for each combination LocalFEltSpace/numbering subset.
This method must be called before ComputeLocal2Global() one, which actually uses up what is computed here to compute the local2global array related to a subset of unknowns.
[in] | do_consider_processor_wise_local_2_global | If 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. |
void MoReFEM::FEltSpace::MoveMesh | ( | const GlobalVector & | vector | ) | const |
Use the output of the finite element space to move a mesh.
Relevant only for numbering subsets for which do_move_mesh is true.
[in] | vector | Vector which values will be used to move the coords. The numbering subset used is derived from this vector as well. |
The mesh moved here is the one covered by the god of dof that includes the finite element space.
void MoReFEM::FEltSpace::MoveMeshFromInitialPosition | ( | const GlobalVector & | vector | ) | const |
Exactly the same as MoveMesh except that the displacement is applied upon the initial position of the mesh.
[in] | vector | Vector which values will be used to move the coords. The numbering subset used is derived from this vector as well. |
|
private |
Reduce the LocalFEltSpace to processor-wise and ghost.
[in] | assign_geom_elt_to_processor | An helper object which keeps track of the choices for all GeometricElt. This helper object is used for all FEltSpace of a given GodOfDof - meaning that the processor choice for a given GeometricElt is the same for all the LocalFEltSpace to which it is related. |
void MoReFEM::FEltSpace::ComputeLocal2Global | ( | const ExtendedUnknown::vector_const_shared_ptr & | extended_unknown_list, |
DoComputeProcessorWiseLocal2Global | do_compute_processor_wise_local_2_global ) const |
Compute the local2global array required by a given global variational operator.
This method is expected to be called only from a GlobalVariationalOperator or a child class of it; it is public solely to account for the cases we need to call it within definitions of a child of GlobalVariationalOperator class.
InitLocal2Global() must have been called beforehand.
[in] | do_compute_processor_wise_local_2_global | Whether local -> global will be required for processor- wise dof indexes. This really depends on the operators considered in |
[internal]
Despite its constness, this method actually modifies one aspect of the FEltSpace: the local2global array is computed and stored within a deep class which specific attribute is mutable. The reason for this is that I would have to renounce to the constness of FEltSpace elsewhere otherwise only for an operation that happens in the very beginning of the program, in the initialization phase.
[in] | extended_unknown_list | List of unknowns handled by the global variational operator which called the present method. This list is split per numbering subset, and for each of them a local2global array is computed. |
void MoReFEM::FEltSpace::ComputeLocal2Global | ( | ExtendedUnknown::const_shared_ptr && | extended_unknown_ptr, |
DoComputeProcessorWiseLocal2Global | do_compute_processor_wise_local_2_global ) const |
Compute the local2global array required by a given global variational operator.
This method is expected to be called only from a GlobalVariationalOperator or a child class of it; it is public solely to account for the cases we need to call it within definitions of a child of GlobalVariationalOperator class.
InitLocal2Global() must have been called beforehand.
[in] | do_compute_processor_wise_local_2_global | Whether local -> global will be required for processor- wise dof indexes. This really depends on the operators considered in |
[internal]
Despite its constness, this method actually modifies one aspect of the FEltSpace: the local2global array is computed and stored within a deep class which specific attribute is mutable. The reason for this is that I would have to renounce to the constness of FEltSpace elsewhere otherwise only for an operation that happens in the very beginning of the program, in the initialization phase.
[in] | extended_unknown_ptr | Couple (Unknown, NumberingSubset) for which local -> global array must be computed. |
|
private |
|
private |
Compute the list of dofs from the one available in the GodOfDof.
[in] | dof_unique_id_list | List of all dofs unique ids involved in the finite element space before the partitioning occurs. All those still present will be put into dof_list_ container. |
[internal]
Should only be called in GodOfDof::Init().
|
private |
Fill the local finite element space list.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
[in] | mesh | Mesh considered. |
[in] | domain | Domain considered. |
[in] | ref_local_felt_space | RefLocalFEltSpace for which the list is created. |
[out] | local_felt_space_list | The LocalFEltSpace for each GeometricElt. |
This is a method rather than an anonymous function solely to 'solve' the friendship of LocalFEltSpace constructor.
|
private |
Clear both processor-wise and ghost Dof lists.
This should be called only immediately after data reduction.
|
noexcept |
Get the list of local finite element spaces sort per finite element type.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
const LocalFEltSpacePerRefLocalFEltSpace & MoReFEM::FEltSpace::GetLocalFEltSpacePerRefLocalFEltSpace | ( | const Domain & | domain | ) | const |
Get the list of local finite element spaces sort per finite element type for a given domain.
[in] | domain | Domain used as filter. |
|
private |
Get the list of local finite element spaces sort for a given RefLocalFEltSpace.
[in] | ref_felt_space | RefLocalFEltSpace used as gilter. |
const LocalFEltSpace & MoReFEM::FEltSpace::GetLocalFEltSpace | ( | const GeometricElt & | geometric_elt | ) | const |
Get the local felt space that matches a given geometric_elt.
[in] | geometric_elt | GeometricElt used as filter. |
const LocalFEltSpace::per_geom_elt_index & MoReFEM::FEltSpace::GetLocalFEltSpaceList | ( | const RefGeomElt & | ref_geom_elt | ) | const |
Get the list of local finite element spaces sort for a given ref_geom_elt.
[in] | ref_geom_elt | RefGeomElt used as filter. |
std::size_t MoReFEM::FEltSpace::NprocessorWiseDof | ( | const NumberingSubset & | numbering_subset | ) | const |
Returns the number of processor-wise Dof for given numbering_subset.
[in] | numbering_subset | NumberingSubset for which the tally is requested. |
std::size_t MoReFEM::FEltSpace::NprogramWiseDof | ( | const NumberingSubset & | numbering_subset | ) | const |
Returns the number of program-wise Dof for given numbering_subset.
[in] | numbering_subset | NumberingSubset for which the tally is requested. |
Dof::vector_shared_ptr MoReFEM::FEltSpace::GetProcessorWiseDofList | ( | const NumberingSubset & | numbering_subset | ) | const |
Get the list of processor-wise dofs covered by the finite element space and inside given numbering subset.
[in] | numbering_subset | NumberingSubset considered. |
bool MoReFEM::FEltSpace::DoCoverNumberingSubset | ( | const NumberingSubset & | numbering_subset | ) | const |
Check whether numbering_subset is covered in the finite element space.
[in] | numbering_subset | NumberingSubset being investigated. |
const NumberingSubset & MoReFEM::FEltSpace::GetNumberingSubset | ( | const Unknown & | unknown | ) | const |
Get the numbering subset associated to unknown.
[in] | unknown | Unknown which associated NumberingSubset is sought. |
const NumberingSubset::const_shared_ptr & MoReFEM::FEltSpace::GetNumberingSubsetPtr | ( | const Unknown & | unknown | ) | const |
Get the numbering subset associated to unknown.
[in] | unknown | Unknown which associated NumberingSubset is sought. |
const ExtendedUnknown & MoReFEM::FEltSpace::GetExtendedUnknown | ( | const Unknown & | unknown | ) | const |
Get the pair unknown/numbering subset associated to the given unknown.
[in] | unknown | Unknown which associated NumberingSubset is sought. |
ExtendedUnknown::const_shared_ptr MoReFEM::FEltSpace::GetExtendedUnknownPtr | ( | const Unknown & | unknown | ) | const |
Get the pair unknown/numbering subset associated to the given unknown as a smart pointer.
[in] | unknown | Unknown which associated ExtendedUnknown is sought. |
|
noexcept |
|
private |
Get the reference finite element space related to a given ref_geom_elt.
[internal]
This method assumes there is one; it is checked by an assert in debug mode.
[in] | ref_geom_elt | Reference geometric element. |
|
privatenoexcept |
|
privatenoexcept |
Prepare the finite element list from the mesh and the domain.
[internal]
This method is called in the constructor and should not be called again afterwards.
|
private |
Compute data required for movemesh if relevant.
This is done for each numbering subset that features DoMoveMesh() == true.
The data set here is movemesh_helper_data_, which allows to match the dof considered to the actual vertices of the mesh.
|
private |
Access to the movemesh helper related to a given vector.
[in] | vector | GlobalVector which content should be used to move the mesh. |
|
noexceptinherited |
Read-only access to underlying Mpi object.
|
inherited |
Get access to the mutex.
|
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 |
Friendship to a private class, which needs to use GetNonCstFEltStorage().
I do not want this method to be public: this access is quite insecure!
|
private |
Object in charge of storing the finite elements in an efficient way so that access is as fast as possible.
This can noticeably store the list of finite elements restricted on a smaller domain that the one upon which the whole finite element space is built.
|
private |
|
private |
List of all the pairs of unknowns and numbering subset.
GodOfDof is not enough here: same unknown might have been numbered with another NumberingSubset in another finite element space.
|
private |
List of numbering subsets considered.
[internal]
Could have been computed from unknown_storage_, but it is convenient to get it stored independently.
|
private |
Data that helps to move efficiently a mesh.
Key is the unique id of a numbering subset. Values gives away the list of dofs for each vertex.
Relevant only for numbering subsets for which do_move_mesh is true.
|
mutableprivateinherited |
Mutex object.
This follows item 16 of Scott Meyers's "Effective Modern C++", which advises to make const member functions thread safe.
However, it is here enclosed in a unique_ptr as mutex doesn't seem to be movable (current implementations of both clang and gcc don't define the move constructor and the move assignation; the copy is deleted).