34class PiecewiseLinearInterpolation;
67 std::vector<std::unique_ptr<ParameterBase>>
const& )
83 if (values.size() == 1)
87 if (values.size() == 2)
91 return {result(0, 0), result(0, 1), result(1, 0), result(1, 1)};
93 if (values.size() == 3)
98 result(0, 0), result(0, 1), result(0, 2),
99 result(1, 0), result(1, 1), result(1, 2),
100 result(2, 0), result(2, 1), result(2, 2),
103 if (values.size() == 4)
107 return {result(0, 0), result(0, 1), result(1, 0), result(1, 1)};
109 if (values.size() == 9)
114 result(0, 0), result(0, 1), result(0, 2),
115 result(1, 0), result(1, 1), result(1, 2),
116 result(2, 0), result(2, 1), result(2, 2),
120 "Coordinate transformation for a {:d}-component parameter is not "
163 virtual Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
165 double const t)
const
169 Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> result(n_nodes,
174 auto const nodes = element.
getNodes();
175 for (
int i = 0; i < n_nodes; ++i)
178 nodes[i]->getID(), element.
getID(), std::nullopt, *nodes[i]);
179 auto const& values = this->
operator()(t, x_position);
180 auto const row_values =
181 Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1>
const>(
182 values.data(), values.size());
183 result.row(i) = row_values;
197 const std::vector<std::unique_ptr<MeshLib::Mesh>>& meshes,
198 std::vector<GeoLib::NamedRaster>
const& named_rasters,
199 std::map<std::string,
200 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
Definition of the Element class.
Definition of the Node class.
Definition of the GeoLib::Raster class.
virtual unsigned getNumberOfNodes() const =0
virtual Node *const * getNodes() const =0
Get array of element nodes.
virtual std::size_t getID() const final
Returns the ID of the element.
void setAll(std::optional< std::size_t > const &node_id, std::optional< std::size_t > const &element_id, std::optional< unsigned > const &integration_point, std::optional< MathLib::Point3d > const &coordinates)
std::optional< std::string > isDefinedOnSameMesh(ParameterBase const ¶meter, MeshLib::Mesh const &mesh)
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< GeoLib::NamedRaster > const &named_rasters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
MeshLib::Mesh const * _mesh
virtual bool isTimeDependent() const =0
MeshLib::Mesh const * mesh() const
virtual void initialize(std::vector< std::unique_ptr< ParameterBase > > const &)
std::vector< double > rotateWithCoordinateSystem(std::vector< double > const &values, SpatialPosition const &pos) const
ParameterBase(std::string name_, MeshLib::Mesh const *mesh=nullptr)
std::optional< CoordinateSystem > _coordinate_system
void setCoordinateSystem(CoordinateSystem const &coordinate_system)
virtual ~ParameterBase()=default
~Parameter() override=default
virtual int getNumberOfGlobalComponents() const =0
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.
virtual std::vector< T > operator()(double const t, SpatialPosition const &pos) const =0
Returns the parameter value at the given time and position.