MoReFEM
|
This class holds all Finite elements related to a given GeometricElt. More...
#include <LocalFEltSpace.hpp>
Public Types | |
using | shared_ptr = std::shared_ptr<LocalFEltSpace> |
Alias to shared pointer. | |
using | vector_shared_ptr = std::vector<shared_ptr> |
Alias to vector of shared_pointer. | |
using | per_geom_elt_index = std::unordered_map<::MoReFEM::GeomEltNS::index_type, LocalFEltSpace::shared_ptr> |
Public Member Functions | |
const GeometricElt & | GetGeometricElt () const noexcept |
Access to the geometric element as a const reference. | |
GeometricElt::shared_ptr | GetGeometricEltPtr () const noexcept |
Access to the geometric element as a smart pointer. | |
const NodeBearer::vector_shared_ptr & | GetNodeBearerList () const noexcept |
Access to the list of nodes bearer. | |
void | SetNodeBearerList (NodeBearer::vector_shared_ptr &&node_bearer_list) |
void | InitLocal2Global (const NumberingSubset::vector_const_shared_ptr &numbering_subset_list, DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global) |
Init for each numbering subset a global local2global array. | |
void | ComputeLocal2Global (const ExtendedUnknown::vector_const_shared_ptr &extended_unknown_list, DoComputeProcessorWiseLocal2Global do_compute_processor_wise_local_2_global) |
Compute Local2GLobal for a subset of the unknowns. | |
template<MpiScale MpiScaleT> | |
const std::vector< PetscInt > & | GetLocal2Global (const ExtendedUnknown::vector_const_shared_ptr &extended_unknown_list) const |
Get the local2global array related to a list of unknowns. | |
template<MpiScale MpiScaleT> | |
const std::vector< PetscInt > & | GetLocal2Global (const ExtendedUnknown &extended_unknown) const |
Get the local2global array related to a single unknown (in other terms, it is the local2global related to a single finite element). | |
Private Member Functions | |
const Internal::FElt & | GetFElt (const Unknown &unknown) const |
Access to the FElt matching the given unknown. | |
const Internal::FElt & | GetFElt (const ExtendedUnknown &extended_unknown) const |
Internal::FElt & | GetNonCstFElt (const ExtendedUnknown &extended_unknown) |
const Internal::FElt::vector_shared_ptr & | GetFEltList () const noexcept |
Access to all FElts. | |
Internal::FElt & | AddFElt (const Internal::RefFEltNS::RefFEltInFEltSpace &ref_felt) |
Add a new finite element and returns a non-constant reference to it. | |
Internal::FElt::vector_shared_ptr & | GetNonCstFEltList () noexcept |
Non constant access to all FElts. | |
const Internal::RefFEltNS::RefLocalFEltSpace & | GetRefLocalFEltSpace () const noexcept |
Access to the reference felt space. | |
template<MpiScale MpiScaleT> | |
const Internal::FEltNS::Local2GlobalStorage & | GetLocal2GlobalStorageForNumberingSubset (const NumberingSubset &numbering_subset) const |
template<MpiScale MpiScaleT> | |
Internal::FEltNS::Local2GlobalStorage & | GetNonCstLocal2GlobalStorageForNumberingSubset (const NumberingSubset &numbering_subset) |
template<MpiScale MpiScaleT> | |
const std::vector< std::pair< NumberingSubsetNS::unique_id, Internal::FEltNS::Local2GlobalStorage::unique_ptr > > & | GetLocal2GlobalStorage () const noexcept |
Constant access to the whole local_2_global storage per numbering subset. | |
void | ClearTemporaryData () const noexcept |
Clear the temporary data used to build properly the Internal::FEltNS::Local2GlobalStorage objects. | |
std::mutex & | GetMutex () const |
Private Attributes | |
const Internal::RefFEltNS::RefLocalFEltSpace & | ref_felt_space_ |
Reference to the related RefLocalFEltSpace. | |
Internal::FElt::vector_shared_ptr | felt_list_ |
Finite element list. | |
GeometricElt::shared_ptr | geometric_elt_ |
Pointer to the related GeometricElt. | |
NodeBearer::vector_shared_ptr | node_bearer_list_ |
List of nodes that belong to the LocalFEltSpace. | |
std::vector< std::pair< NumberingSubsetNS::unique_id, Internal::FEltNS::Local2GlobalStorage::unique_ptr > > | local_2_global_program_wise_per_numbering_subset_ |
Store for each numbering subset all the required program-wise local2global arrays. | |
std::vector< std::pair< NumberingSubsetNS::unique_id, Internal::FEltNS::Local2GlobalStorage::unique_ptr > > | local_2_global_processor_wise_per_numbering_subset_ |
Store for each numbering subset all the required processor-wise local2global arrays. | |
DoComputeProcessorWiseLocal2Global | do_consider_processor_wise_local_2_global_ |
std::unique_ptr< std::mutex > | mutex_ |
Mutex object. | |
Friends | |
class | FEltSpace |
Friendship to FEltSpace, the only class entitled to build a new LocalFEltSpace. | |
class | Internal::FEltSpaceNS::MatchInterfaceNodeBearer |
Friendship to the only class entitled to add finite elements to the local felt space. | |
template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, std::size_t NfeltSpaceT> | |
class | ParameterNS::Policy::AtDof |
Friendship to a specific Parameter policy (that needs access to private FEllt). | |
Special members. | |
LocalFEltSpace (const Internal::RefFEltNS::RefLocalFEltSpace &ref_felt_space, const GeometricElt::shared_ptr &geometric_elt) | |
~LocalFEltSpace () | |
Destructor. | |
LocalFEltSpace (const LocalFEltSpace &rhs)=delete | |
The copy constructor. | |
LocalFEltSpace (LocalFEltSpace &&rhs)=delete | |
The move constructor. | |
LocalFEltSpace & | operator= (const LocalFEltSpace &rhs)=delete |
The (copy) operator=. | |
LocalFEltSpace & | operator= (LocalFEltSpace &&rhs)=delete |
The (move) operator=. | |
This class holds all Finite elements related to a given GeometricElt.
There might be several: there is in fact one FElt per Unknown present in the LocalFEltSpace.
This is also this class that is in charge of giving away the local2global arrays.
using MoReFEM::LocalFEltSpace::per_geom_elt_index = std::unordered_map<::MoReFEM::GeomEltNS::index_type, LocalFEltSpace::shared_ptr> |
Convenient storage: key is the index of the geometric element, value the actual pointer to the LocalFEltSpace.
|
explicitprivate |
Constructor.
[in] | ref_felt_space | RefLocalFEltSpace upon which the object is built. |
[in] | geometric_elt | Concrete GeometricElt for which the object is built. |
|
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. |
|
delete |
The (copy) operator=.
[in] | rhs | The object from which the affectation occurs. |
|
delete |
The (move) operator=.
[in] | rhs | The object from which the affectation occurs. |
void MoReFEM::LocalFEltSpace::SetNodeBearerList | ( | NodeBearer::vector_shared_ptr && | node_bearer_list | ) |
Set the list of node bearers.
[in] | node_bearer_list | List of NodeBearer computed outside the class. |
void MoReFEM::LocalFEltSpace::InitLocal2Global | ( | const NumberingSubset::vector_const_shared_ptr & | numbering_subset_list, |
DoConsiderProcessorWiseLocal2Global | do_consider_processor_wise_local_2_global ) |
Init for each numbering subset a global local2global array.
In this array all the unknowns within the numbering subset are considered; their ordering is the same as the ordering in felt_list_.
This array is not accessible publicly; it is used only to generate the local2global required by the operators (that are computed through a call to ComputeLocal2Global, issued in each GlobalVariationalOperator constructor).
[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. |
[in] | numbering_subset_list | List of all numbering subsets for which local2global array should be computed. |
[internal]
Processor- and program-wise local2global arrays are actually stored in two different containers.
void MoReFEM::LocalFEltSpace::ComputeLocal2Global | ( | const ExtendedUnknown::vector_const_shared_ptr & | extended_unknown_list, |
DoComputeProcessorWiseLocal2Global | do_compute_processor_wise_local_2_global ) |
Compute Local2GLobal for a subset of the unknowns.
This method is supposed to be called by each operator, that asks upon its creation that the local2global it will need are correctly built.
It assumes that InitLocal2Global has been correctly called beforehand.
[in] | extended_unknown_list | List of unknowns for which the local2global array is required. They must all belong to the same numbering subset. |
[in] | do_compute_processor_wise_local_2_global | If yes, compute the processor-wise local2global as well. Program-wise one is generated in any case. |
const std::vector< PetscInt > & MoReFEM::LocalFEltSpace::GetLocal2Global | ( | const ExtendedUnknown::vector_const_shared_ptr & | extended_unknown_list | ) | const |
Get the local2global array related to a list of unknowns.
MpiScaleT | Whether processor- or program-wise local2global array is required. |
[in] | extended_unknown_list | List of unknowns considered, along with their associated NumberingSubset in the FEltSpace. |
const std::vector< PetscInt > & MoReFEM::LocalFEltSpace::GetLocal2Global | ( | const ExtendedUnknown & | extended_unknown | ) | const |
Get the local2global array related to a single unknown (in other terms, it is the local2global related to a single finite element).
MpiScaleT | Whether processor- or program-wise local2global array is required. |
[in] | extended_unknown | Couple unknown/numbering subset for which the local -> global array is sought. |
|
private |
Access to the FElt matching the given unknown.
[in] | unknown | Unknown used as filter. |
|
private |
Access to the FElt matching the given extended_unknown.
[in] | extended_unknown | ExtendedUnknown used as filter. |
|
private |
Non-constant access to the FElt matching the given extended_unknown.
[in] | extended_unknown | ExtendedUnknown used as filter. |
|
private |
Add a new finite element and returns a non-constant reference to it.
[internal]
This method should only be called within friend MatchInterfaceNodeBearer.
[in] | ref_felt | Description of a reference finite element associated to an Unknown, a NumberingSubset and a RefGeomElt. |
|
private |
Constant access to local_2_global_per_numbering_subset_.
[in] | numbering_subset | NumberingSubset for which the local->global is sought. |
|
private |
Non constant access to local_2_global_per_numbering_subset_.
[in] | numbering_subset | NumberingSubset for which the local->global is sought. |
|
inherited |
Get access to the mutex.
|
private |
Finite element list.
There is one finite element per relevant unknown: a same unknown can be associated to only one numbering subset in a given (global) finite element space.
|
private |
Store for each numbering subset all the required program-wise local2global arrays.
Key is the unique id of the numbering subset. Value is the object in charge of holding the information.
|
private |
Store for each numbering subset all the required processor-wise local2global arrays.
Key is the unique id of the numbering subset. Value is the object in charge of holding the information.
|
private |
Whether the local -> global (processor-wise) must also be built. If not local_2_global_processor_wise_ remains empty.
|
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).