#define meshlessConcepts_H

//=== author:Elwardi ===//
namespace Foam
{
    namespace mff
    {
        template <class T>concept PositionType = requires(T t){{T::nComponents}->std::convertible_to<int>;{std::convertible_to<T, VectorSpace<Vector<scalar>, scalar, T::nComponents>>};}

        template <class T, class Cmpt>concept RAContainer = requires(T t, Cmpt c){std::ranges::random_access_range<Cmpt>;}

        template <class T, class Point>concept CallableWithPositions = requires(T t, Point p){{t(p)}->std::convertible_to<scalar>;PositionType<Point>;}

        template <class T, class Point>concept Shape = requires(T t, Point p){{t.contains(p)}->std::convertible_to<bool>;}
    }
}

Concepts that enable meta-programming in the core meshless library

Foam::mff::PositionType

template <class T>concept PositionType = requires(T t){{T::nComponents}->std::convertible_to<int>;{std::convertible_to<T, VectorSpace<Vector<scalar>, scalar, T::nComponents>>};}

Concept checking that a type is a VectorSpace instance with scalar components. The number of components needs to be a constexpr from T::dim


Foam::mff::RAContainer

template <class T, class Cmpt>concept RAContainer = requires(T t, Cmpt c){std::ranges::random_access_range<Cmpt>;}

Concept checking for requirements of OpenFOAM containers with random access iterators


Foam::mff::CallableWithPositions

template <class T, class Point>concept CallableWithPositions = requires(T t, Point p){{t(p)}->std::convertible_to<scalar>;PositionType<Point>;}

Concept checking for requirements of callables with positions and returning a scalar


Foam::mff::Shape

template <class T, class Point>concept Shape = requires(T t, Point p){{t.contains(p)}->std::convertible_to<bool>;}

Concept checking for requirements of shape types