LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
mesh_function_constant.h
1
10#ifndef INCGd0f3b8f133da4af980ce21ffffdf719a
11#define INCGd0f3b8f133da4af980ce21ffffdf719a
12#include <vector>
13
14#include "lf/mesh/mesh_interface.h"
15
16namespace lf::mesh::utils {
17
25template <class R>
27 public:
33 explicit MeshFunctionConstant(R value) : value_(std::move(value)) {}
34
38 std::vector<R> operator()(const mesh::Entity& /*unused*/,
39 const Eigen::MatrixXd& local) const {
40 return std::vector<R>(local.cols(), value_);
41 }
42
43 private:
45};
46
47} // namespace lf::mesh::utils
48
49#endif // INCGd0f3b8f133da4af980ce21ffffdf719a
Interface class representing a topological entity in a cellular complex
Definition entity.h:42
A MeshFunction which takes the same constant value on the whole mesh.
std::vector< R > operator()(const mesh::Entity &, const Eigen::MatrixXd &local) const
the key evaluation operator to be supplied by all MeshFunctions
MeshFunctionConstant(R value)
Create a new MeshFunctionConstant by passing the globally constant value.
Contains helper functions and classes that all operate on the interface classes defined in lf::mesh.