Skip to content

Commit 31edabd

Browse files
committed
add new tests
1 parent 0360e98 commit 31edabd

4 files changed

Lines changed: 36 additions & 3 deletions

File tree

include/MGIS/Function/FunctionConcept.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace mgis::function::internals {
1717
constexpr decltype(auto) disambiguateGetSpace(const FunctionType& f) //
1818
requires(!EvaluatorConcept<FunctionType>) {
1919
return getSpace(f);
20-
} // end of disambiguateGetSpace
20+
} // end of disambiguateGetSpace
2121

2222
template <FunctionConcept FunctionType>
2323
constexpr mgis::size_type disambiguateGetNumberOfComponents(

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if(enable-mgis-function)
3030
Function.cxx
3131
Evaluator.cxx
3232
TensorView.cxx
33+
TensorModifier.cxx
3334
MaterialFunctionManager.cxx)
3435
endif(enable-mgis-function)
3536

src/Function.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ namespace mgis::function {
2626
function_result<FunctionView<BasicLinearSpace, {.data_size = 1}>>,
2727
real&>);
2828

29+
static_assert(FunctionConcept<Function<BasicLinearSpace>>);
2930
// This shall not work as Function is not a lightweight obect
3031
static_assert(!EvaluatorConcept<Function<BasicLinearSpace>>);
3132

32-
// This shall not work as Function is not a lightweight obect
33-
static_assert(FunctionConcept<Function<BasicLinearSpace>>);
33+
static_assert(EvaluatorConcept<FixedSizeView<Function<BasicLinearSpace>, 9>>);
34+
static_assert(FunctionConcept<FixedSizeView<Function<BasicLinearSpace>, 9>>);
3435

3536
} // end of namespace mgis::function

src/TensorModifier.cxx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*!
2+
* \file TensorModifier.cxx
3+
* \brief
4+
* \author Thomas Helfer
5+
* \date 01/09/2025
6+
*/
7+
8+
#include "MGIS/Function/BasicLinearSpace.hxx"
9+
#include "MGIS/Function/Function.hxx"
10+
#include "MGIS/Function/Tensors.hxx"
11+
#include "MGIS/Function/Tensors/TensorModifier.hxx"
12+
13+
namespace mgis::function {
14+
15+
#ifdef MGIS_HAVE_TFEL
16+
17+
static_assert(
18+
EvaluatorConcept<TensorModifier<tfel::math::stensor<3u, mgis::real>,
19+
FunctionView<BasicLinearSpace>>>);
20+
static_assert(
21+
!FunctionConcept<TensorModifier<tfel::math::stensor<3u, mgis::real>,
22+
FunctionView<BasicLinearSpace>>>);
23+
24+
static_assert(
25+
number_of_components<TensorModifier<tfel::math::stensor<3u, mgis::real>,
26+
FunctionView<BasicLinearSpace>>> ==
27+
6);
28+
29+
#endif /* MGIS_HAVE_TFEL */
30+
31+
} // end of namespace mgis::function

0 commit comments

Comments
 (0)