MoReFEM
|
Parameter policy when the parameter gets a value at each pair geometric element/quadrature point. More...
#include <AtQuadraturePoint.hpp>
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. | |
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 Domain & | GetDomain () const noexcept |
Domain upon which the parameter is defined. | |
const value_holder_type & | FindValue (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt) const |
value_holder_type & | FindNonCstValue (const QuadraturePoint &quad_pt, const GeometricElt &geom_elt) |
const parameter_storage_type & | GetStorage () const noexcept |
Access to the storage. | |
parameter_storage_type & | GetNonCstStorage () noexcept |
Access to the storage. | |
const QuadratureRule & | GetQuadratureRule (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 Domain & | domain_ |
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 QuadratureRulePerTopology & | quadrature_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. | |
Parameter policy when the parameter gets a value at each pair geometric element/quadrature point.
TypeT | Type 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. |
using MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::self = AtQuadraturePoint<TypeT, TimeManagerT> |
Alias to the type of the class.
using MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::local_coords_type = QuadraturePoint |
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).
|
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.
|
explicit |
Constructor.
[in] | name | Name of the Parameter. |
[in] | domain | Domain 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_topology | Specify which quadrature rule to use for each topology that might be considered. |
[in] | initial_value | When 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_manager | TimeManager of the model. |
|
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. |
|
protected |
Get the value of the Parameter at a specific location for a given GeometricElt.
[in] | quad_pt | Local position for which the Parameter value is sought. |
[in] | geom_elt | GeometricElt for which the Parameter value is sought. |
|
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.
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.
[in] | quad_pt | Quadrature point for which parameter value needs to be updated. |
[in] | geom_elt | Geometric element to which the quadrature point belongs to. |
[in] | update_functor | Lambda function (or straight functor if you really fancy them) which gives away the formula to use to update the parameter value. |
UpdateFunctorT | The 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.
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.
[in] | quad_pt | Quadrature point for which parameter value needs to be updated. |
[in] | geom_elt | Geometric element to which the quadrature point belongs to. |
[in] | update_functor | Lambda function (or straight functor if you really fancy them) which gives away the formula to use to update the parameter value. |
UpdateFunctorT | The 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.
void MoReFEM::ParameterNS::Policy::AtQuadraturePoint< TypeT, TimeManagerT >::Copy | ( | const AtQuadraturePoint< TypeT, TimeManagerT > & | parameter_at_quad_point | ) |
Copy the content of another AtQuadraturePoint.
[in] | parameter_at_quad_point | Parameter which data are copied. |
|
protected |
Write the content of the parameter for which policy is used in a stream.
[in,out] | stream | Stream upon which object information are written. |
|
private |
Get the reference to the requested value.
[in] | quad_pt | QuadraturePoint for which the value is sought. |
[in] | geom_elt | GeometricElt for which the value is sought. |
|
private |
Get the non constant reference to the requested value.
[in] | quad_pt | QuadraturePoint for which the value is sought. |
[in] | geom_elt | GeometricElt for which the value is sought. |
|
private |
Returns the quadrature rule used for a given topology.
[in] | topology_id | Topology identifier. |