11#ifndef INCG7e4ffaa81e244723acbfbbaea68e03b1
12#define INCG7e4ffaa81e244723acbfbbaea68e03b1
14#include <lf/mesh/mesh.h>
25using MeshFunctionReturnType_t =
decltype(std::declval<T>()(
26 std::declval<const Entity>(), std::declval<const Eigen::MatrixXd>()));
29struct VectorElementType {
33template <
typename T,
typename A>
34struct VectorElementType<std::vector<T, A>> {
39using VectorElement_t =
typename VectorElementType<T>::type;
41template <
class T,
class RETURN_TYPE>
42 requires(!std::is_same_v<VectorElement_t<MeshFunctionReturnType_t<T>>,
void>)
43constexpr bool IsMeshFunctionCallable(
int ) {
44 if constexpr (std::is_same_v<RETURN_TYPE, void>) {
51 return std::is_same_v<VectorElement_t<MeshFunctionReturnType_t<T>>,
55template <
class T,
class RETURN_TYPE>
56constexpr bool IsMeshFunctionCallable(
long ) {
148template <
class MF,
class R =
void>
153 std::is_object_v<MF> && std::copy_constructible<MF> &&
154 internal::IsMeshFunctionCallable<MF, R>(0);
189 std::vector<R> operator()(const
Entity& e,
190 const Eigen::MatrixXd& local)
const {
192 LF_VERIFY_MSG(
false,
"Should never be called, this is an archetype");
203 internal::VectorElement_t<internal::MeshFunctionReturnType_t<R>>;
Interface class representing a topological entity in a cellular complex
A MeshFunction is a function object that can be evaluated at any point on the mesh.
Contains helper functions and classes that all operate on the interface classes defined in lf::mesh.
internal::VectorElement_t< internal::MeshFunctionReturnType_t< R > > MeshFunctionReturnType
Determine the type of objects returned by a MeshFunction.
Archetype for the MeshFunction concept.
MeshFunctionAT(MeshFunctionAT &&) noexcept=default
Move constructor.
MeshFunctionAT(const MeshFunctionAT &) noexcept=default
Copy constructor.