ParameterLib::Parameter< T > Struct Template Referenceabstract

Detailed Description

template<typename T>
struct ParameterLib::Parameter< T >

A Parameter is a function \( (t, x) \mapsto f(t, x) \in T^n \).

Where \( t \) is the time and \( x \) is the SpatialPosition. \( n \) is the number of components of \(f\)'s results, i.e., 1 for a scalar parameter and >1 for a vectorial or tensorial parameter.

Definition at line 139 of file Parameter.h.

#include <Parameter.h>

Inheritance diagram for ParameterLib::Parameter< T >:
Collaboration diagram for ParameterLib::Parameter< T >:

Public Member Functions

 ~Parameter () override=default
virtual int getNumberOfGlobalComponents () const =0
virtual std::vector< T > operator() (double const t, SpatialPosition const &pos) const =0
 Returns the parameter value at the given time and position. More...
virtual Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > getNodalValuesOnElement (MeshLib::Element const &element, double const t) const
 Returns a matrix of values for all nodes of the given element. More...
 ParameterBase (std::string name_, MeshLib::Mesh const *mesh=nullptr)
- Public Member Functions inherited from ParameterLib::ParameterBase
 ParameterBase (std::string name_, MeshLib::Mesh const *mesh=nullptr)
virtual ~ParameterBase ()=default
virtual bool isTimeDependent () const =0
void setCoordinateSystem (CoordinateSystem const &coordinate_system)
virtual void initialize (std::vector< std::unique_ptr< ParameterBase >> const &)
MeshLib::Mesh const * mesh () const

Additional Inherited Members

- Public Attributes inherited from ParameterLib::ParameterBase
std::string const name
- Protected Member Functions inherited from ParameterLib::ParameterBase
std::vector< double > rotateWithCoordinateSystem (std::vector< double > const &values, SpatialPosition const &pos) const
- Protected Attributes inherited from ParameterLib::ParameterBase
std::optional< CoordinateSystem_coordinate_system
MeshLib::Mesh const * _mesh

Constructor & Destructor Documentation

◆ ~Parameter()

template<typename T >
ParameterLib::Parameter< T >::~Parameter ( )

Member Function Documentation

◆ getNodalValuesOnElement()

template<typename T >
virtual Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> ParameterLib::Parameter< T >::getNodalValuesOnElement ( MeshLib::Element const &  element,
double const  t 
) const

Returns a matrix of values for all nodes of the given element.

Reimplemented in ParameterLib::ConstantParameter< T >, ParameterLib::RandomFieldMeshElementParameter< T >, ParameterLib::MeshNodeParameter< T >, and ParameterLib::MeshElementParameter< T >.

Definition at line 163 of file Parameter.h.

165  {
166  auto const n_nodes = static_cast<int>(element.getNumberOfNodes());
167  auto const n_components = getNumberOfGlobalComponents();
168  Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> result(n_nodes,
169  n_components);
171  // Column vector of values, copied for each node.
172  SpatialPosition x_position;
173  auto const nodes = element.getNodes();
174  for (int i = 0; i < n_nodes; ++i)
175  {
176  x_position.setAll(
177  nodes[i]->getID(), element.getID(), std::nullopt, *nodes[i]);
178  auto const& values = this->operator()(t, x_position);
179  auto const row_values =
180  Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1> const>(
181  values.data(), values.size());
182  result.row(i) = row_values;
183  }
185  return result;
186  }
virtual std::vector< T > operator()(double const t, SpatialPosition const &pos) const =0
Returns the parameter value at the given time and position.
virtual int getNumberOfGlobalComponents() const =0

References MeshLib::Element::getID(), MeshLib::Element::getNodes(), ParameterLib::Parameter< T >::getNumberOfGlobalComponents(), MeshLib::Element::getNumberOfNodes(), ParameterLib::Parameter< T >::operator()(), and ParameterLib::SpatialPosition::setAll().

Referenced by ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::VariableDependentNeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), and ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleComponentTransportEquation().

◆ getNumberOfGlobalComponents()

◆ operator()()

◆ ParameterBase()

template<typename T >

Definition at line 48 of file Parameter.h.

50  : name(std::move(name_)), _mesh(mesh)
51  {
52  }
MeshLib::Mesh const * _mesh
Definition: Parameter.h:129
std::string const name
Definition: Parameter.h:72
MeshLib::Mesh const * mesh() const
Definition: Parameter.h:70

The documentation for this struct was generated from the following files: