MoReFEM
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT > Class Template Reference

Parameter policy when the parameter gets a value at each pair geometric element/quadrature point. More...

#include <AtQuadraturePoint.hpp>

Collaboration diagram for MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >:

Public Types

using self = AtQuadraturePoint<TypeT, TimeManagerT>
 Alias to the type of the class.
 
using local_coords_type = QuadraturePoint
 Convenient alias to decide where a Parameter is computed.
 
using return_type = typename traits::return_type
 Alias to the return type.
 

Public Member Functions

void SetConstantValue (value_type)
 Enables to modify the constant value of a parameter. Disable for this Policy.
 
template<class UpdateFunctorT >
void UpdateValue (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt, const UpdateFunctorT &update_functor)
 Update the value for the new time iteration.
 
template<class UpdateFunctorT >
return_type UpdateAndGetValue (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt, const UpdateFunctorT &update_functor)
 Update the value for the new time iteration and returns it.
 
void Copy (const AtQuadraturePoint &parameter_at_quad_point)
 
const QuadratureRulePerTopologyGetQuadratureRulePerTopology () const noexcept
 Access to the object that indicates which quadrature rule is used for each topology.
 
Special members.
 AtQuadraturePoint (const std::string &name, const Domain &domain, const QuadratureRulePerTopology &quadrature_rule_per_topology, storage_value_type initial_value, const TimeManagerT &time_manager)
 Constructor.
 
 ~AtQuadraturePoint ()=default
 Destructor.
 
 AtQuadraturePoint (const AtQuadraturePoint &rhs)=delete
 The copy constructor.
 
 AtQuadraturePoint (AtQuadraturePoint &&rhs)=delete
 The move constructor.
 
AtQuadraturePointoperator= (const AtQuadraturePoint &rhs)=delete
 The (copy) operator=.
 
AtQuadraturePointoperator= (AtQuadraturePoint &&rhs)=delete
 The (move) operator=.
 

Protected Member Functions

return_type GetConstantValueFromPolicy () const
 Provided here to make the code compile, but should never be called.
 
return_type GetValueFromPolicy (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt) const
 Get the value of the Parameter at a specific location for a given GeometricElt.
 
return_type GetAnyValueFromPolicy () const
 Returns a stored value (Any: the point is actually to assert its type for some functions overload).
 
bool IsConstant () const
 Whether the parameter varies spatially or not.
 
void WriteFromPolicy (std::ostream &stream) const
 Write the content of the parameter for which policy is used in a stream.
 

Private Types

using traits = Internal::ParameterNS::Traits<TypeT>
 Alias to traits class related to TypeT.
 
using storage_value_type = std::decay_t<return_type>
 Alias to the way each value is stored.
 
using value_type = std::decay_t<return_type>
 Alias.
 
using value_holder_type = Internal::ParameterNS::AtQuadraturePointNS::ValueHolder<storage_value_type>
 Alias to value holder.
 
using parameter_storage_type = std::unordered_map<GeomEltNS::index_type, std::vector<value_holder_type>>
 Alias to the type of the value actually stored.
 

Private Member Functions

const DomainGetDomain () const noexcept
 Domain upon which the parameter is defined.
 
const value_holder_typeFindValue (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt) const
 
value_holder_typeFindNonCstValue (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt)
 
const parameter_storage_typeGetStorage () const noexcept
 Access to the storage.
 
parameter_storage_typeGetNonCstStorage () noexcept
 Access to the storage.
 
const QuadratureRuleGetQuadratureRule (TopologyNS::Type topology_id) const
 
const TimeManagerT & GetTimeManager () const noexcept
 Access to the time manager.
 
const std::string & GetParameterName () const noexcept
 Name of the Parameter for which the policy is defined.
 

Private Attributes

const std::string & parameter_name_
 Name of the Parameter for which the policy is defined.
 
const Domaindomain_
 Part of the mesh upon which the parameter is defined.
 
parameter_storage_type storage_
 Storage of all the values (see parameter_storage_type for details about its layout).
 
storage_value_type initial_value_
 Initial value.
 
const QuadratureRulePerTopologyquadrature_rule_per_topology_
 Stores which quadrature rule is used for each topology.
 
const TimeManagerT & time_manager_
 Time manager.
 

Friends

class MoReFEM::TestNS::UpdateCauchyGreenTensorNS::Model
 Frienship to test class.
 

Detailed Description

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
class MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >

Parameter policy when the parameter gets a value at each pair geometric element/quadrature point.

Template Parameters
TypeTType of the parameter considered. If 'scalar', the underlying storage is a double. If 'vector', the underlying storage is a LocalVector. If 'matrix', the underlying storage is a LocalMatrix.

Member Typedef Documentation

◆ self

Alias to the type of the class.

◆ local_coords_type

Convenient alias to decide where a Parameter is computed.

Parameters are by construct objects that are evaluated at a local position in a given GeometricElt. Depending on the exact type of the Parameter, the local position might be given by either a LocalCoords or a QuadraturePoint (the latter being a child of the former).

◆ parameter_storage_type

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
using MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::parameter_storage_type = std::unordered_map<GeomEltNS::index_type, std::vector<value_holder_type>>
private

Alias to the type of the value actually stored.

Key is the index of a GeometricElement. Index of the vector is the quadrature point unique id.

Constructor & Destructor Documentation

◆ AtQuadraturePoint() [1/3]

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::AtQuadraturePoint ( const std::string & name,
const Domain & domain,
const QuadratureRulePerTopology & quadrature_rule_per_topology,
storage_value_type initial_value,
const TimeManagerT & time_manager )
explicit

Constructor.

Parameters
[in]nameName of the Parameter.
Parameters
[in]domainDomain upon which the Parameter is defined; this Domain MUST be associated with a Mesh (more often than not domain encompasses all the Coords of its associated Mesh). The reason it is a Domain and not a Mesh is that in some cases (fibers for instance) we might want to define it only on a subset of a Mesh.
[in]quadrature_rule_per_topologySpecify which quadrature rule to use for each topology that might be considered.
[in]initial_valueWhen the object is built the convention is to set this value at all of the quadrature points. Needless to say something more sophisticated could be done (reading each value from a file for instance); if you need such feature don't hesitate to ask for it!
[in]time_managerTimeManager of the model.

◆ AtQuadraturePoint() [2/3]

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::AtQuadraturePoint ( const AtQuadraturePoint< TypeT, TimeManagerT > & rhs)
delete

The copy constructor.

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

◆ AtQuadraturePoint() [3/3]

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::AtQuadraturePoint ( AtQuadraturePoint< TypeT, TimeManagerT > && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

The (copy) operator=.

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

◆ operator=() [2/2]

The (move) operator=.

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

◆ GetValueFromPolicy()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
return_type MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::GetValueFromPolicy ( const QuadraturePoint & quad_pt,
const GeometricElt & geom_elt ) const
protected

Get the value of the Parameter at a specific location for a given GeometricElt.

Parameters
[in]quad_ptLocal position for which the Parameter value is sought.
[in]geom_eltGeometricElt for which the Parameter value is sought.

◆ GetAnyValueFromPolicy()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
return_type MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::GetAnyValueFromPolicy ( ) const
protected

Returns a stored value (Any: the point is actually to assert its type for some functions overload).

[internal] The point here is not the value itself, but the information that might be retrieved from it, such as number of rows and columns if TypeT == Type::matrix.

Returns
Any value of the relevant type for the Parameter.

◆ UpdateValue()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
template<class UpdateFunctorT >
void MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::UpdateValue ( const QuadraturePoint & quad_pt,
const GeometricElt & geom_elt,
const UpdateFunctorT & update_functor )

Update the value for the new time iteration.

[internal] This method is not an override: it can only be used when the Parameter object is STATICALLY a child of AtQuadraturePointPolicy.

Parameters
[in]quad_ptQuadrature point for which parameter value needs to be updated.
[in]geom_eltGeometric element to which the quadrature point belongs to.
[in]update_functorLambda function (or straight functor if you really fancy them) which gives away the formula to use to update the parameter value.
Template Parameters
UpdateFunctorTThe expected prototype of the update_functor functor is:
std::decay_t< return_type > storage_value_type
Alias to the way each value is stored.
Definition AtQuadraturePoint.hpp:94
std::string Name()
Returns a name as a string that describes the type considered.

For instance, argument type storage_value_type is double& for TypeT = scalar, LocalVector& for TypeT = vector and LocalMatrix& for TypeT = matrix.

◆ UpdateAndGetValue()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
template<class UpdateFunctorT >
return_type MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::UpdateAndGetValue ( const QuadraturePoint & quad_pt,
const GeometricElt & geom_elt,
const UpdateFunctorT & update_functor )

Update the value for the new time iteration and returns it.

[internal] This method is not an override: it can only be used when the Parameter object is STATICALLY a child of AtQuadraturePointPolicy.

Parameters
[in]quad_ptQuadrature point for which parameter value needs to be updated.
[in]geom_eltGeometric element to which the quadrature point belongs to.
[in]update_functorLambda function (or straight functor if you really fancy them) which gives away the formula to use to update the parameter value.
Template Parameters
UpdateFunctorTThe expected prototype of the update_functor functor is:

For instance, argument type storage_value_type is double& for TypeT = scalar, LocalVector& for TypeT = vector and LocalMatrix& for TypeT = matrix.

Returns
Updated value.

◆ Copy()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
void MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::Copy ( const AtQuadraturePoint< TypeT, TimeManagerT > & parameter_at_quad_point)

Copy the content of another AtQuadraturePoint.

Parameters
[in]parameter_at_quad_pointParameter which data are copied.

◆ WriteFromPolicy()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
void MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::WriteFromPolicy ( std::ostream & stream) const
protected

Write the content of the parameter for which policy is used in a stream.

Parameters
[in,out]streamStream upon which object information are written.

◆ FindValue()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
const value_holder_type & MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::FindValue ( const QuadraturePoint & quad_pt,
const GeometricElt & geom_elt ) const
private

Get the reference to the requested value.

Parameters
[in]quad_ptQuadraturePoint for which the value is sought.
[in]geom_eltGeometricElt for which the value is sought.

◆ FindNonCstValue()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
value_holder_type & MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::FindNonCstValue ( const QuadraturePoint & quad_pt,
const GeometricElt & geom_elt )
private

Get the non constant reference to the requested value.

Parameters
[in]quad_ptQuadraturePoint for which the value is sought.
[in]geom_eltGeometricElt for which the value is sought.

◆ GetQuadratureRule()

template<ParameterNS::Type TypeT, TIME_MANAGER_TEMPLATE_KEYWORD TimeManagerT>
const QuadratureRule & MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::GetQuadratureRule ( TopologyNS::Type topology_id) const
private

Returns the quadrature rule used for a given topology.

Parameters
[in]topology_idTopology identifier.

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