MGIS
Loading...
Searching...
No Matches
FunctionConcept.hxx File Reference
#include <span>
#include <array>
#include <utility>
#include <concepts>
#include <type_traits>
#include "MGIS/Config.hxx"
#include "MGIS/Function/CompileTimeSize.hxx"
#include "MGIS/Function/SpaceConcept.hxx"
#include "MGIS/Function/EvaluatorConcept.hxx"
#include "MGIS/Function/FunctionConcept.ixx"
#include "MGIS/Function/FixedSizeView.hxx"
#include "MGIS/Function/FixedSizeModifier.hxx"

Classes

struct  mgis::function::internals::FunctionResultTypeTraits< T >
 traits that must be specialized to allow functions to return this type. More...
 
struct  mgis::function::internals::FunctionResultTypeTraits< real & >
 partial specialization for reference to a scalar value More...
 
struct  mgis::function::internals::FunctionResultTypeTraits< std::span< real, N > >
 partial specialization for reference to a mutable span More...
 
struct  mgis::function::internals::FunctionResultTypeTraits< std::array< real, N > & >
 partial specialization for reference to a std::array More...
 
struct  mgis::function::internals::FunctionResultQueryImplementation1< bool, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation1< true, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation2< bool, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation2< true, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation3< bool, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation3< true, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation4< bool, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation4< true, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation< bool, FunctionType >
 
struct  mgis::function::internals::FunctionResultQueryImplementation< true, FunctionType >
 
struct  mgis::function::internals::FunctionResultQuery< FunctionType >
 
struct  mgis::function::LightweightViewTraits< FunctionType >
 
struct  mgis::function::internals::ViewResultType< bool, FunctionType >
 
struct  mgis::function::internals::ViewResultType< false, FunctionType >
 
struct  mgis::function::internals::NumberOfComponents< FunctionType >
 number of components of a type when known at compile-time, dynamic_extent otherwise More...
 
struct  mgis::function::internals::fixed_size_modifier< N >
 

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.
 

Concepts

concept  mgis::function::internals::mutable_return_value
 
concept  mgis::function::LightweightViewConcept
 
concept  mgis::function::FunctionConcept
 a concept that must satisfy a function
 
concept  mgis::function::ElementFunctionConcept
 concept defining evaluators working on an element space
 
concept  mgis::function::QuadratureFunctionConcept
 concept defining evaluators working on a quadrature space
 

Typedefs

template<FunctionConcept FunctionType>
using mgis::function::function_view = std::conditional_t< LightweightViewConcept< FunctionType >, FunctionType, typename internals::ViewResultType< LightweightViewConcept< FunctionType >, FunctionType >::type >
 an alias which returns a view corresponding to the given function type
 
template<FunctionConcept FunctionType>
using mgis::function::function_space = std::decay_t< decltype(getSpace(std::declval< FunctionType >()))>
 
template<FunctionConcept FunctionType>
using mgis::function::function_result = typename internals::FunctionResultQuery< FunctionType >::result_type
 type of the result of an function
 
template<FunctionConcept FunctionType>
using mgis::function::function_const_result = typename internals::FunctionResultQuery< FunctionType >::const_result_type
 type of the result of an function
 

Functions

template<FunctionConcept FunctionType>
constexpr function_view< FunctionTypemgis::function::make_view (FunctionType &f)
 an helper function to create a view when required
 
template<FunctionConcept FunctionType>
requires (!EvaluatorConcept<FunctionType>)
constexpr decltype(automgis::function::internals::disambiguateGetSpace (const FunctionType &)
 
template<FunctionConcept FunctionType>
requires (!EvaluatorConcept<FunctionType>)
constexpr mgis::size_type mgis::function::internals::disambiguateGetNumberOfComponents (const FunctionType &)
 
template<EvaluatorConcept EvaluatorType, FunctionConcept FunctionType>
requires ( std::same_as<evaluator_space<EvaluatorType>, function_space<FunctionType>>)
bool mgis::function::operator| (EvaluatorType, FunctionType &)
 assign an evaluator to a mutable function view
 
template<FunctionConcept FunctionType, size_type N>
requires (number_of_components<FunctionType> == dynamic_extent ? true : N == number_of_components<FunctionType>)
constexpr auto mgis::function::operator| (FunctionType &f, const internals::fixed_size_modifier< N > &m)
 

Variables

template<FunctionConcept FunctionType>
constexpr auto mgis::function::isFunctionResultTypeMappable
 
template<FunctionConcept FunctionType>
constexpr auto mgis::function::isFunctionConstResultTypeMappable
 
template<size_type N>
constexpr auto mgis::function::as_array = internals::fixed_size_modifier<N>{}
 
constexpr auto mgis::function::as_scalar = internals::fixed_size_modifier<1>{}
 

Detailed Description

Author
Thomas Helfer
Date
14/05/2025

Function Documentation

◆ disambiguateGetNumberOfComponents()

template<FunctionConcept FunctionType>
requires (!EvaluatorConcept<FunctionType>)
constexpr mgis::size_type mgis::function::internals::disambiguateGetNumberOfComponents ( const FunctionType f)
constexpr

This helper function allows to disambiguate the call to the getNumberOfComponents function

◆ disambiguateGetSpace()

template<FunctionConcept FunctionType>
requires (!EvaluatorConcept<FunctionType>)
constexpr decltype(auto) mgis::function::internals::disambiguateGetSpace ( const FunctionType f)
constexpr

This helper function allows to disambiguate the call to the getSpace function

◆ operator|()

template<EvaluatorConcept EvaluatorType, FunctionConcept FunctionType>
requires ( std::same_as<evaluator_space<EvaluatorType>, function_space<FunctionType>>)
bool mgis::function::operator| ( EvaluatorType  e,
FunctionType f 
)

assign an evaluator to a mutable function view

Parameters
[in]ctxexecution context
[in]eevaluator
[in]ffunction

Variable Documentation

◆ isFunctionConstResultTypeMappable

template<FunctionConcept FunctionType>
constexpr auto mgis::function::isFunctionConstResultTypeMappable
inlineconstexpr
Initial value:
=
requires(function_const_result<FunctionType> rf) {
{ rf.data() } -> std::same_as<const real*>;
}

◆ isFunctionResultTypeMappable

template<FunctionConcept FunctionType>
constexpr auto mgis::function::isFunctionResultTypeMappable
inlineconstexpr
Initial value:
=
requires(function_result<FunctionType> rf) {
{ rf.data() } -> std::same_as<real*>;
}