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

This class holds all Finite elements related to a given GeometricElt. More...

#include <LocalFEltSpace.hpp>

Inheritance diagram for MoReFEM::LocalFEltSpace:
Collaboration diagram for MoReFEM::LocalFEltSpace:

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 GeometricEltGetGeometricElt () 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_ptrGetNodeBearerList () 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::FEltGetFElt (const Unknown &unknown) const
 Access to the FElt matching the given unknown.
 
const Internal::FEltGetFElt (const ExtendedUnknown &extended_unknown) const
 
Internal::FEltGetNonCstFElt (const ExtendedUnknown &extended_unknown)
 
const Internal::FElt::vector_shared_ptrGetFEltList () const noexcept
 Access to all FElts.
 
Internal::FEltAddFElt (const Internal::RefFEltNS::RefFEltInFEltSpace &ref_felt)
 Add a new finite element and returns a non-constant reference to it.
 
Internal::FElt::vector_shared_ptrGetNonCstFEltList () noexcept
 Non constant access to all FElts.
 
const Internal::RefFEltNS::RefLocalFEltSpaceGetRefLocalFEltSpace () const noexcept
 Access to the reference felt space.
 
template<MpiScale MpiScaleT>
const Internal::FEltNS::Local2GlobalStorageGetLocal2GlobalStorageForNumberingSubset (const NumberingSubset &numbering_subset) const
 
template<MpiScale MpiScaleT>
Internal::FEltNS::Local2GlobalStorageGetNonCstLocal2GlobalStorageForNumberingSubset (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::RefLocalFEltSpaceref_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.
 
LocalFEltSpaceoperator= (const LocalFEltSpace &rhs)=delete
 The (copy) operator=.
 
LocalFEltSpaceoperator= (LocalFEltSpace &&rhs)=delete
 The (move) operator=.
 

Detailed Description

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.

Member Typedef Documentation

◆ per_geom_elt_index

Convenient storage: key is the index of the geometric element, value the actual pointer to the LocalFEltSpace.

Constructor & Destructor Documentation

◆ LocalFEltSpace() [1/3]

MoReFEM::LocalFEltSpace::LocalFEltSpace ( const Internal::RefFEltNS::RefLocalFEltSpace & ref_felt_space,
const GeometricElt::shared_ptr & geometric_elt )
explicitprivate

Constructor.

Parameters
[in]ref_felt_spaceRefLocalFEltSpace upon which the object is built.
[in]geometric_eltConcrete GeometricElt for which the object is built.

◆ LocalFEltSpace() [2/3]

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

The copy constructor.

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

◆ LocalFEltSpace() [3/3]

MoReFEM::LocalFEltSpace::LocalFEltSpace ( LocalFEltSpace && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

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

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

The (move) operator=.

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

◆ SetNodeBearerList()

void MoReFEM::LocalFEltSpace::SetNodeBearerList ( NodeBearer::vector_shared_ptr && node_bearer_list)

Set the list of node bearers.

Parameters
[in]node_bearer_listList of NodeBearer computed outside the class.

◆ InitLocal2Global()

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).

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]numbering_subset_listList 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.

◆ ComputeLocal2Global()

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.

Parameters
[in]extended_unknown_listList 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_globalIf yes, compute the processor-wise local2global as well. Program-wise one is generated in any case.

◆ GetLocal2Global() [1/2]

template<MpiScale MpiScaleT>
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.

Template Parameters
MpiScaleTWhether processor- or program-wise local2global array is required.
Warning
Beware: processor-wise one must have been explicitly built with a dedicated argument in ComputeLocal2Global.
Parameters
[in]extended_unknown_listList of unknowns considered, along with their associated NumberingSubset in the FEltSpace.
Returns
Local2global array related to a list of unknowns.

◆ GetLocal2Global() [2/2]

template<MpiScale MpiScaleT>
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).

Template Parameters
MpiScaleTWhether processor- or program-wise local2global array is required.
Warning
Beware: processor-wise one must have been explicitly built with a dedicated argument in ComputeLocal2Global.
Parameters
[in]extended_unknownCouple unknown/numbering subset for which the local -> global array is sought.
Returns
Local2global array related to extended_unknown.

◆ GetFElt() [1/2]

const Internal::FElt & MoReFEM::LocalFEltSpace::GetFElt ( const Unknown & unknown) const
private

Access to the FElt matching the given unknown.

Parameters
[in]unknownUnknown used as filter.

◆ GetFElt() [2/2]

const Internal::FElt & MoReFEM::LocalFEltSpace::GetFElt ( const ExtendedUnknown & extended_unknown) const
private

Access to the FElt matching the given extended_unknown.

Parameters
[in]extended_unknownExtendedUnknown used as filter.

◆ GetNonCstFElt()

Internal::FElt & MoReFEM::LocalFEltSpace::GetNonCstFElt ( const ExtendedUnknown & extended_unknown)
private

Non-constant access to the FElt matching the given extended_unknown.

Parameters
[in]extended_unknownExtendedUnknown used as filter.

◆ AddFElt()

Internal::FElt & MoReFEM::LocalFEltSpace::AddFElt ( const Internal::RefFEltNS::RefFEltInFEltSpace & ref_felt)
private

Add a new finite element and returns a non-constant reference to it.

[internal] This method should only be called within friend MatchInterfaceNodeBearer.

Parameters
[in]ref_feltDescription of a reference finite element associated to an Unknown, a NumberingSubset and a RefGeomElt.
Returns
Reference to the newly created FElt.

◆ GetLocal2GlobalStorageForNumberingSubset()

template<MpiScale MpiScaleT>
const Internal::FEltNS::Local2GlobalStorage & MoReFEM::LocalFEltSpace::GetLocal2GlobalStorageForNumberingSubset ( const NumberingSubset & numbering_subset) const
private

Constant access to local_2_global_per_numbering_subset_.

Parameters
[in]numbering_subsetNumberingSubset for which the local->global is sought.

◆ GetNonCstLocal2GlobalStorageForNumberingSubset()

template<MpiScale MpiScaleT>
Internal::FEltNS::Local2GlobalStorage & MoReFEM::LocalFEltSpace::GetNonCstLocal2GlobalStorageForNumberingSubset ( const NumberingSubset & numbering_subset)
private

Non constant access to local_2_global_per_numbering_subset_.

Parameters
[in]numbering_subsetNumberingSubset for which the local->global is sought.

◆ GetMutex()

std::mutex & MoReFEM::Crtp::Mutex< LocalFEltSpace >::GetMutex ( ) const
inherited

Get access to the mutex.

Returns
Non constant reference to std::mutex underlying object.

Field Documentation

◆ felt_list_

Internal::FElt::vector_shared_ptr MoReFEM::LocalFEltSpace::felt_list_
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.

◆ local_2_global_program_wise_per_numbering_subset_

std::vector<std::pair<NumberingSubsetNS::unique_id, Internal::FEltNS::Local2GlobalStorage::unique_ptr> > MoReFEM::LocalFEltSpace::local_2_global_program_wise_per_numbering_subset_
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.

◆ local_2_global_processor_wise_per_numbering_subset_

std::vector<std::pair<NumberingSubsetNS::unique_id, Internal::FEltNS::Local2GlobalStorage::unique_ptr> > MoReFEM::LocalFEltSpace::local_2_global_processor_wise_per_numbering_subset_
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.

◆ do_consider_processor_wise_local_2_global_

DoComputeProcessorWiseLocal2Global MoReFEM::LocalFEltSpace::do_consider_processor_wise_local_2_global_
private

Whether the local -> global (processor-wise) must also be built. If not local_2_global_processor_wise_ remains empty.

◆ mutex_

std::unique_ptr<std::mutex> MoReFEM::Crtp::Mutex< LocalFEltSpace >::mutex_
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).


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