MoReFEM
|
Read from an Ensight file values given at dofs and interpret then in term of a Parameter object. More...
#include <FiberList.hpp>
Public Types | |
using | self = FiberList<FiberPolicyT, TypeT, TimeManagerT> |
Alias to the type of the class. | |
using | local_coords_type = QuadraturePoint |
Convenient alias to decide where a Parameter is computed. | |
using | unique_ptr = std::unique_ptr<self> |
Alias to unique pointer. | |
using | parent = Parameter<TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None> |
Alias to parent. | |
using | parameter_type = ParameterAtQuadraturePoint<TypeT, TimeManagerT, ParameterNS::TimeDependencyNS::None> |
Alias to underlying parameter. | |
using | return_type = typename parent::return_type |
'Inherit' alias from parent. | |
using | value_type = typename parent::value_type |
'Inherit' alias from parent. | |
using | underlying_type |
Type used for the unique id. | |
using | const_unique_ptr |
Alias to unique pointer to const object. | |
using | array_unique_ptr |
Alias to array of unique pointer. | |
using | traits |
Alias to traits. | |
using | time_dependency_type |
Alias to time dependency. | |
Public Member Functions | |
void | Initialize (const QuadratureRulePerTopology *const quadrature_rule_per_topology=nullptr) |
Initialize by converting into a ParameterAtQuadraturePoint. | |
bool | IsConstant () const noexcept override final |
Whether the parameter is constant spatially (False for this one). | |
const GlobalVector & | GetGlobalVector () const noexcept |
Accessor to the global vector which entails the values at dof. | |
void | SetConstantValue (storage_value_type) override |
Enables to modify the constant value of a parameter. Deactivated for this kind of Parameter. | |
const parameter_type & | GetUnderlyingParameter () const noexcept |
Accesspor to underlying parameter. | |
FiberListNS::unique_id | GetUniqueId () const |
Get the value of the internal unique ID. | |
virtual void | TimeUpdate () |
Apply the time dependency if relevant. | |
virtual void | TimeUpdate (double time) |
Apply the time dependency if relevant. | |
void | SetTimeDependency (typename time_dependency_type::unique_ptr &&time_dependency) |
Set the time dependency functor. | |
return_type | GetValue (const QuadraturePoint &local_coords, const GeometricElt &geom_elt) const |
Get the value of the parameter at a given local position in a given geom_elt. | |
return_type | GetConstantValue () const |
Returns the constant value (if the parameter is constant). | |
virtual void | SetConstantValue (value_type value)=0 |
Enables to modify the constant value of a parameter. | |
void | Write (std::ostream &stream) const |
Write the content of the Parameter in a stream. | |
void | Write (const FilesystemNS::File &filename) const |
Write the content of the Parameter in a file. | |
const Domain & | GetDomain () const noexcept |
Returns the Domain upon which the parameter is defined. | |
const time_dependency_type & | GetTimeDependency () const noexcept |
Constant accessor to the object which handles if relevant the time dependency (computation of the time related factor, etc...). | |
Static Public Member Functions | |
static IGNORE_BLOCK_IN_DOXYGEN const std::string & | ClassName () |
Return the name of the class. | |
static FiberListNS::unique_id | GenerateNewEligibleId () |
Generate a unique id. | |
static void | ClearUniqueIdList () |
Clear all unique ids. | |
static constexpr bool | IsTimeDependent () |
Whether the class is time-dependent or not. | |
Protected Member Functions | |
const std::string & | GetName () const |
Name that will appear in outputs. | |
Private Types | |
using | unique_id_parent = Crtp::UniqueId<self, FiberListNS::unique_id, UniqueIdNS::AssignationMode::manual> |
Alias to unique id parent. | |
using | storage_value_type = std::decay_t<return_type> |
Alias to the way each value is stored. | |
using | value_holder_type = Internal::ParameterNS::AtQuadraturePointNS::ValueHolder<storage_value_type> |
Alias to value holder. | |
using | storage_type |
Alias to the type of the value actually stored. | |
Private Member Functions | |
virtual return_type | SupplGetConstantValue () const override final |
Returns the constant value (if the parameters is constant). | |
virtual return_type | SupplGetValue (const local_coords_type &quad_pt, const GeometricElt &geom_elt) const override final |
Get the (spatially-only) value of the parameter at a given local position in a given geom_elt. | |
virtual return_type | SupplGetAnyValue () const override final |
Returns a stored value (Any: the point is actually to assert its type for some functions overload). | |
virtual void | SupplWrite (std::ostream &stream) const override final |
virtual void | SupplTimeUpdate () override final |
Add here any additional TimeUpdate that might be relevant. | |
virtual void | SupplTimeUpdate (double time) override final |
Add here any additional TimeUpdate that might be relevant. | |
GlobalVector & | GetNonCstGlobalVector () noexcept |
Non constant accessor to the global vector which entails the values at dof. | |
const FEltSpace & | GetFeltSpace () const noexcept |
Accessor to the finite element space. | |
const TimeManagerT & | GetTimeManager () const noexcept |
Accessor to the time manager. | |
const Unknown & | GetUnknown () const noexcept |
Accessor to the unknown. | |
time_dependency_type & | GetNonCstTimeDependency () noexcept |
Non constant accessor to the object which handles if relevant the time dependency (computation of the time related factor, etc...). | |
Static Private Member Functions | |
static FiberListNS::unique_id | AssignUniqueId () |
If AssignationMode is automatic, generates a new unique identifier. | |
static FiberListNS::unique_id | NewUniqueId (FiberListNS::unique_id new_unique_id) |
If AssignationMode is manual, checks the unique identifier provided is valid. | |
static std::set< FiberListNS::unique_id > & | StaticUniqueIdList () |
List of all identifiers existing for DerivedT. | |
Private Attributes | |
const FEltSpace & | felt_space_ |
Finite element space to define the Parameter at Dof. | |
const TimeManagerT & | time_manager_ |
Time manager. | |
const Unknown & | unknown_ |
Unknown. | |
parameter_type::unique_ptr | underlying_parameter_ { nullptr } |
Parameter upon which most functionalities will be built. | |
GlobalVector::unique_ptr | global_vector_ { nullptr } |
Global vector which entails the values at dof. | |
::MoReFEM::GeomEltNS::index_type | first_index_program_wise_ { 0ul } |
Index of the first geometric element which belongs to the domain's parameter. Used to reset the index of the. | |
std::size_t | Nprogram_wise_geom_elt = 0ul |
Number of elements used to do a sanity check on the length of the fiber files defined at quadrature points. | |
std::size_t | Nprocessor_wise_geom_elt = 0ul |
Number of elements used to check that each processor read the right number of values out of the fiber files. | |
FilesystemNS::File | fiber_file_ |
Fiber file. | |
bool | was_initialize_already_called_ { false } |
In debug mode, data attribute to check Initialize is not called more than one. | |
const FiberListNS::unique_id | unique_id_ |
The value of the unique id for the current DerivedT object. | |
std::string | name_ |
Name that will appear in outputs. | |
const Domain & | domain_ |
Domain upon which the parameter is defined. Must be consistent with mesh. | |
time_dependency_type::unique_ptr | time_dependency_ |
Object which handles if relevant the time dependency (computation of the time related factor, etc...). | |
Special members. | |
FiberList (FiberListNS::unique_id unique_id, const FilesystemNS::File &fiber_file, const Domain &domain, const FEltSpace &felt_space, const TimeManagerT &time_manager, const Unknown &unknown) | |
Constructor. | |
~FiberList () override=default | |
Destructor. | |
FiberList (const FiberList &rhs)=delete | |
The copy constructor. | |
FiberList (FiberList &&rhs)=delete | |
The move constructor. | |
FiberList & | operator= (const FiberList &rhs)=delete |
The (copy) operator=. | |
FiberList & | operator= (FiberList &&rhs)=delete |
The (move) operator=. | |
Read from an Ensight file values given at dofs and interpret then in term of a Parameter object.
PolicyT | Whether the fiber file was defined at the nodes of the mesh or at the quadrature points. |
TypeT | Whether a scalar or vectorial parameter is to be considered. |
using MoReFEM::FiberList< FiberPolicyT, TypeT, TimeManagerT >::self = FiberList<FiberPolicyT, TypeT, TimeManagerT> |
Alias to the type of the class.
using MoReFEM::FiberList< FiberPolicyT, 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 unique identifier of a GeometricElement. Index of the vector is the quadrature point unique id.
|
explicitprivate |
Constructor.
[in] | unique_id | Unique id of the FilberList as read in the input file. |
[in] | fiber_file | File at the Ensight format which will be interpreted. Its format is specified by Ensight specifications; typically scalar files get a 'scl' extension and their first line is 'Scalar per node' whereas vectorial get a 'vct' extension and first line is 'Vector per node'. |
[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] | felt_space | Finite element space upon which the Parameter should be defined. |
[in] | unknown | A scalar or vectorial unknown that acts a bit as a strawman: dofs are defined only in relationship to an unknown, so you must create one if none fulfill your purposes (for instance if you deal with a vectorial unknown and need a scalar Dof field, you must create another unknown only for the Parameter. To save space, it's better if this unknown is in its own numbering subset, but this is not mandatory. Unknown should be scalar for TypeT == ParameterNS::Type::scalar and vectorial for TypeT == ParameterNS::Type::vectorial. |
[in,out] | time_manager | Object in charge of keeping track of the time-related information. |
|
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::FiberList< FiberPolicyT, TypeT, TimeManagerT >::Initialize | ( | const QuadratureRulePerTopology *const | quadrature_rule_per_topology = nullptr | ) |
Initialize by converting into a ParameterAtQuadraturePoint.
[in] | quadrature_rule_per_topology | If specified, the quadrature rule to use for each topology. If nullptr, just take the choices stored in the FEltSpace. |
|
finaloverridevirtualnoexcept |
Whether the parameter is constant spatially (False for this one).
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
finaloverrideprivatevirtual |
Returns the constant value (if the parameters is constant).
If the Parameter gets a time dependency (which is of the form f(x) * g(t)), current method returns only f(x). This method is expected to be called only in GetConstantValue() method, which adds up the g(t) contribution
This choice also makes us respect a C++ idiom that recommends avoiding virtual public methods.
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
finaloverrideprivatevirtual |
Get the (spatially-only) value of the parameter at a given local position in a given geom_elt.
If the Parameter gets a time dependency (which is of the form f(x) * g(t)), current method returns only f(x). This method is expected to be called only in GetValue() method, which adds up the g(t) contribution
This choice also makes us respect a C++ idiom that recommends avoiding virtual public methods.
[in] | geom_elt | GeometricElt inside which the value is computed. |
[in] | quad_pt | QuadraturePoint at which the value is computed. |
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
finaloverrideprivatevirtual |
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.
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
finaloverrideprivatevirtual |
Write the content of the Parameter in a stream.
[in,out] | stream | Stream upon which object information are written. |
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
finaloverrideprivatevirtual |
Add here any additional TimeUpdate that might be relevant.
For instance, if a Parameter depends on other parameters, you must make sure those are correctly updated, and possibly some internals might have to be recomputed.
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
finaloverrideprivatevirtual |
Add here any additional TimeUpdate that might be relevant.
For instance, if a Parameter depends on other parameters, you must make sure those are correctly updated, and possibly some internals might have to be recomputed.
One should prefer to use the default one if one wants to use the current time. Extra security to verify the synchro of the parameter to the current time is done in he default one. This method is for particular cases only when the user knows exactly what is he doing.
[in] | time | Time for the update. |
Implements MoReFEM::Parameter< TypeT, QuadraturePoint, TimeManagerT, ParameterNS::TimeDependencyNS::None >.
|
inherited |
Get the value of the internal unique ID.
|
staticinherited |
Generate a unique id.
No new objects is created, and the new identifier is not counted in the list - the purpose here is just to provide a value that don't collide with existing objects. This is really used in a very edge case; think twice before using this functionality as it really might not be what you really seek.
|
staticinherited |
Clear all unique ids.
|
staticprivateinherited |
If AssignationMode is automatic, generates a new unique identifier.
|
staticprivateinherited |
If AssignationMode is manual, checks the unique identifier provided is valid.
[in] | new_unique_id | The proposed new unique id. If it already exists an exception will be thrown. |
|
virtualinherited |
Apply the time dependency if relevant.
One should prefer to use the default one if one wants to use the current time. Extra security to verify the synchro of the parameter to the current time is done in he default one. This method is for particular cases only when the user knows exactly what is he doing.
[in] | time | Time for the update. |
|
inherited |
Set the time dependency functor.
This is relevant only for TimeDependencyT != TimeDependencyNS::None.
[in] | time_dependency | Unique pointer to the time dependency object to set. |
|
inherited |
Get the value of the parameter at a given local position in a given geom_elt.
[internal]
This method is actually called when IsConstant() yields false; if true GetConstantValue() is called instead.
[in] | local_coords | Local object at which the Parameter is evaluated. |
[in] | geom_elt | GeometricElt inside which the value is computed. |
|
inherited |
Returns the constant value (if the parameter is constant).
If not constant, an assert is raised (in debug mode).
|
pure virtualinherited |
Enables to modify the constant value of a parameter.
[in] | value | Value to modify the constant value with. |
|
inherited |
Write the content of the Parameter in a stream.
In first draft the output format is up to the policy (maybe later we may prefer to write at all quadrature points for all cases); the exact content is indeed defined in the virtual method SupplWrite(), to be defined in each inherited classes.
[in,out] | stream | Stream upon which object information are written. |
|
inherited |
Write the content of the Parameter in a file.
This method calls the namesake method that writes on a stream.
[in] | filename | Path to the file in which value will be written. The path must be valid (all directories must exist) and if a namesake already exists it is overwritten. |
|
noexceptinherited |
Constant accessor to the object which handles if relevant the time dependency (computation of the time related factor, etc...).
Shouldn't be called very often...
|
privateinherited |
Object which handles if relevant the time dependency (computation of the time related factor, etc...).
May remain nullptr if the policy is there is no time dependency.