MoReFEM
Loading...
Searching...
No Matches
Public Types | Protected Member Functions | Private Member Functions | Private Attributes
MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT > Class Template Reference

Parent class of all GlobalParameterOperator. More...

#include <GlobalParameterOperator.hpp>

Inheritance diagram for MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >:
Collaboration diagram for MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >:

Public Types

using LocalParameterOperator = LocalParameterOperatorT
 Alias over the class that handles the elementary calculation.
 

Protected Member Functions

const ParameterAtQuadraturePoint< TypeT, TimeManagerT, TimeDependencyT > & GetParameter () const noexcept
 Constant access to the parameter.
 
template<typename... Args>
void UpdateImpl (Args &&... args) const
 This method is in charge of updating the parameter at each quadrature point.
 
const ExtendedUnknown::const_shared_ptrGetExtendedUnknownPtr () const
 Return the Unknown and its associated numbering subset.
 
const ExtendedUnknownGetExtendedUnknown () const
 Return the Unknown and its associated numbering subset.
 
const FEltSpaceGetFEltSpace () const noexcept
 FEltSpace.
 
const Utilities::PointerComparison::Map< RefGeomElt::shared_ptr, typename LocalParameterOperatorT::unique_ptr > & GetLocalOperatorPerRefGeomElt () const noexcept
 Access to the container that contains the match between a reference geometric element and a local Parameters operator.
 
AllocateGradientFEltPhi DoAllocateGradientFEltPhi () const noexcept
 Whether the gradient of finite element is required or not.
 
void PerformElementaryCalculation (const LocalFEltSpace &local_felt_space, LocalParameterOperatorT &local_operator, std::tuple<> &&) const
 Perform the elementary calculation (more exactly handle the call to the LocalParameterOperator...)
 
template<typename... Args>
void PerformElementaryCalculation (const LocalFEltSpace &local_felt_space, LocalParameterOperatorT &local_operator, std::tuple< Args... > &&args) const
 Overload when there are variadic arguments to handle.
 
LocalParameterOperatorGetNonCstLocalOperator (Advanced::GeometricEltEnum ref_geom_elt_id) const
 Fetch the local operator associated to the finite element type.
 
bool DoConsider (Advanced::GeometricEltEnum ref_geom_elt_id) const
 Whether there is a local Parameters operator related to a given ref_geom_elt.
 
Special members.
template<typename... Args>
 GlobalParameterOperator (const FEltSpace &felt_space, const Unknown &unknown, const QuadratureRulePerTopology *const quadrature_rule_per_topology, AllocateGradientFEltPhi do_allocate_gradient_felt_phi, ParameterAtQuadraturePoint< TypeT, TimeManagerT, TimeDependencyT > &parameter, Args &&... args)
 Constructor.
 
 ~GlobalParameterOperator ()=default
 Protected destructor: no direct instance of this class should occur!
 
 GlobalParameterOperator (const GlobalParameterOperator &rhs)=delete
 The copy constructor.
 
 GlobalParameterOperator (GlobalParameterOperator &&rhs)=delete
 The move constructor.
 
GlobalParameterOperatoroperator= (const GlobalParameterOperator &rhs)=delete
 The (copy) operator=.
 
GlobalParameterOperatoroperator= (GlobalParameterOperator &&rhs)=delete
 The (move) operator=.
 

Private Member Functions

template<typename... Args>
void CreateLocalOperatorList (std::size_t mesh_dimension, ParameterAtQuadraturePoint< TypeT, TimeManagerT, ParameterNS::TimeDependencyNS::None > &parameter, Args &&... args)
 Create a LocalParameterOperator for each RefFEltInFEltSpace and store it into the class.
 
const QuadratureRuleGetQuadratureRule (const RefGeomElt &ref_geom_elt) const
 
const QuadratureRulePerTopologyGetQuadratureRulePerTopology () const noexcept
 Returns the quadrature rule to use for each topology.
 

Private Attributes

NodeBearer::vector_shared_ptr node_for_boundary_condition_
 List of nodes eligible for boundary conditions.
 
std::unordered_map< Advanced::GeometricEltEnum, typename LocalParameterOperatorT::unique_ptr > local_operator_per_ref_geom_elt_
 Map the finite element type to the matching local operator.
 
const FEltSpacefelt_space_
 Finite element space.
 
const QuadratureRulePerTopology *const quadrature_rule_per_topology_ = nullptr
 List of quadrature rules for each type of reference geometric element considered.
 
const ParameterAtQuadraturePoint< TypeT, TimeManagerT, TimeDependencyT > & parameter_
 Constant reference to parameter.
 
const AllocateGradientFEltPhi do_allocate_gradient_felt_phi_
 Whether the gradient matrix of finite element phi will be required or not.
 
const ExtendedUnknown::const_shared_ptr extended_unknown_
 Unknown/numbering subset list.
 

Detailed Description

template<class DerivedT, class LocalParameterOperatorT, ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
class MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >

Parent class of all GlobalParameterOperator.

This kind of operator is used to update Parameters.

Attention
Contrary to variational operators, no local2global is automatically defined here, as only a subset of such parameter might need it. If you need one that might not already be defined, call FEltSpace::ComputeLocal2Global. Make sure to do so before the end of the initialization phase (which ends at the end of Model::Initialize() call).
Template Parameters
LocalParameterOperatorTClass that defines the expected elementary behaviour at each quadrature point; it must be derived from LocalParameterOperator.

Constructor & Destructor Documentation

◆ GlobalParameterOperator() [1/3]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
template<typename... Args>
MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::GlobalParameterOperator ( const FEltSpace & felt_space,
const Unknown & unknown,
const QuadratureRulePerTopology *const quadrature_rule_per_topology,
AllocateGradientFEltPhi do_allocate_gradient_felt_phi,
ParameterAtQuadraturePoint< TypeT, TimeManagerT, TimeDependencyT > & parameter,
Args &&... args )
explicitprotected

Constructor.

Parameters
[in]felt_spaceFinite element space upon which the operator is defined.
[in]unknownUnknown considered.
[in]parameterParameter at quadrature point on which the operator is defined.
[in]argsVariadic arguments that will be perfect-forwarded to the constructor of each LocalParameterOperator.
Parameters
[in]quadrature_rule_per_topologyQuadrature rule for each relevant topology (if one useful in the Model is not specified there an exception will be thrown when usage is attempted). Do not deallocate this raw pointer: it is assumed the actual object is stored in an object such as VariationalFormulation or a Model, probably under a const_unique_ptr to avoid bothering with manual deallocation. If nullptr, the rules defined in the FEltSpace are used.
Parameters
[in]do_allocate_gradient_felt_phiWhether the gradient matrix of finite element phi will be required or not. If not allocated when it should an assert will warn you in debug mode; so you may specify no by default if you're not entirely sure whether it is required ot not.

◆ GlobalParameterOperator() [2/3]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::GlobalParameterOperator ( const GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT > & rhs)
protecteddelete

The copy constructor.

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

◆ GlobalParameterOperator() [3/3]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::GlobalParameterOperator ( GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT > && rhs)
protecteddelete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
GlobalParameterOperator & MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::operator= ( const GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT > & rhs)
protecteddelete

The (copy) operator=.

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

◆ operator=() [2/2]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
GlobalParameterOperator & MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::operator= ( GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT > && rhs)
protecteddelete

The (move) operator=.

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

◆ UpdateImpl()

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
template<typename... Args>
void MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::UpdateImpl ( Args &&... args) const
protected

This method is in charge of updating the parameter at each quadrature point.

This method uses the new C++ 11 feature of variadic template; so that these methods can handle generically all the operators, whatever argument they might require. The drawback is that it isn't clear which arguments are expected for a specific global operator; that's the reason the following method is NOT called Assemble() and is protected rather than public. When a developer introduces a new operator, he must therefore define a public Assemble() that calls the present one.

For instance for UpdateFiberDeformation operator, which requires an additional displacement_increment argument:

inline void UpdateFiberDeformation::Update(const GlobalVector& increment_displacement) const
{
return parent::UpdateImpl(increment_displacement);
}
Class which encapsulates both the Petsc vector and the numbering subset used to described it.
Definition GlobalVector.hpp:75
Parameters
[in]argsVariadic template arguments, specific to the operator being implemented. These arguments might be global: they are to be given to DerivedT::SetComputeEltArrayArguments() which will produce the local ones.

◆ PerformElementaryCalculation() [1/2]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
void MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::PerformElementaryCalculation ( const LocalFEltSpace & local_felt_space,
LocalParameterOperatorT & local_operator,
std::tuple<> &&  ) const
protected

Perform the elementary calculation (more exactly handle the call to the LocalParameterOperator...)

This method is called in UpdateImpl() and has no business being called elsewhere.

Parameters
[in]local_felt_spaceLocal finite element space considered.
[in,out]local_operatorLocal operator in charge of the elementary computation at each quadrature point.

◆ PerformElementaryCalculation() [2/2]

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
template<typename... Args>
void MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::PerformElementaryCalculation ( const LocalFEltSpace & local_felt_space,
LocalParameterOperatorT & local_operator,
std::tuple< Args... > && args ) const
protected

Overload when there are variadic arguments to handle.

This method is called in UpdateImpl() and has no business being called elsewhere.

Parameters
[in]local_felt_spaceLocal finite element space considered.
[in,out]local_operatorLocal operator in charge of the elementary computation.
[in]argsVariadic template arguments, specific to the operator being implemented. These arguments might be global: they are to be given to DerivedT::SetComputeEltArrayArguments() which will produce the local ones.

◆ GetNonCstLocalOperator()

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
LocalParameterOperator & MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::GetNonCstLocalOperator ( Advanced::GeometricEltEnum ref_geom_elt_id) const
protected

Fetch the local operator associated to the finite element type.

Returns
Local operator associated to a given reference geometric element. This method assumes the ref_geom_elt is valid and gets an associated LocalOperator (an assert is there in debug mode to check that); the check of such an assumption may be performed by a call to DoConsider() in case there is a genuine reason to check that in a release mode context.
Parameters
[in]ref_geom_elt_idIdentifier of the reference geometric element which local Parameters operator is requested.

◆ DoConsider()

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
bool MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::DoConsider ( Advanced::GeometricEltEnum ref_geom_elt_id) const
protected

Whether there is a local Parameters operator related to a given ref_geom_elt.

Parameters
[in]ref_geom_elt_idIdentifier of the reference geometric element which pertinence is evaluated.
Returns
True if a local Parameters operator was found.

It might not if there is a restriction of the domain of definition (for instance elastic stiffness operator does not act upon geometric objects of dimension 1).

This method should be called prior to GetNonCstLocalOperator(): the latter will assert if the ref_felt is invalid.

◆ CreateLocalOperatorList()

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
template<typename... Args>
void MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::CreateLocalOperatorList ( std::size_t mesh_dimension,
ParameterAtQuadraturePoint< TypeT, TimeManagerT, ParameterNS::TimeDependencyNS::None > & parameter,
Args &&... args )
private

Create a LocalParameterOperator for each RefFEltInFEltSpace and store it into the class.

Parameters
[in]mesh_dimensionDimension of the mesh considered.
Parameters
[in]argsVariadic arguments (see the forecoming section about it in C++ MoReFEM documentation).
[in,out]parameterThe ParameterAtQuadraturePoint object to be updated by the current operator.

◆ GetQuadratureRule()

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
const QuadratureRule & MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::GetQuadratureRule ( const RefGeomElt & ref_geom_elt) const
private

Return the quadrature rule that match a given reference geometric element.

Parameters
[in]ref_geom_eltRefGeomElt for which the QuadratureRule is sought.

◆ GetQuadratureRulePerTopology()

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
const QuadratureRulePerTopology & MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::GetQuadratureRulePerTopology ( ) const
privatenoexcept

Returns the quadrature rule to use for each topology.

Returns
List of quadrature rule to use for each topology.

Field Documentation

◆ quadrature_rule_per_topology_

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
const QuadratureRulePerTopology* const MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::quadrature_rule_per_topology_ = nullptr
private

List of quadrature rules for each type of reference geometric element considered.

If left empty (nullptr) default one from FEltSpace is used.

This list is given in the constructor; it is up to the caller of the operator to make sure all cases are covered. If not an exception is thrown.

◆ parameter_

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
const ParameterAtQuadraturePoint<TypeT, TimeManagerT, TimeDependencyT>& MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::parameter_
private

Constant reference to parameter.

Reference might be constant here as the global parameter won't attempt any change directly; it is the responsibility of LocalParameterOperator.

◆ do_allocate_gradient_felt_phi_

template<class DerivedT , class LocalParameterOperatorT , ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT, template<::MoReFEM::ParameterNS::Type, TIME_MANAGER_TEMPLATE_KEYWORD > class TimeDependencyT = ParameterNS::TimeDependencyNS::None>
const AllocateGradientFEltPhi MoReFEM::GlobalParameterOperator< DerivedT, LocalParameterOperatorT, TypeT, TimeManagerT, TimeDependencyT >::do_allocate_gradient_felt_phi_
private

Whether the gradient matrix of finite element phi will be required or not.

If not allocated when it should an assert will warn you in debug mode; so you may specify no by default if you're not entirely sure whether it is required ot not.


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