Skip to content

Commit f3e610c

Browse files
authored
Merge pull request #178 from thelfer/177-mgis-function-rework-the-assign-algorithm-to-use-a-view
177 mgis function rework the assign algorithm to use a view
2 parents e5f586d + 6bac451 commit f3e610c

27 files changed

Lines changed: 280 additions & 294 deletions

cmake/modules/clang.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ if(enable-parallel-stl-algorithms)
8484
if(UNIX AND NOT APPLE)
8585
if(NOT enable-libcxx)
8686
find_package(TBB REQUIRED)
87+
list(APPEND MGIS_REQUIRED_ADDITIONAL_PACKAGES "TBB")
8788
list(APPEND MGIS_ADDITIONAL_LIBRARIES "TBB::tbb")
8889
endif(NOT enable-libcxx)
8990
endif(UNIX AND NOT APPLE)

cmake/modules/compiler.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# MGIS_CMAKE_REQUIRED_INCLUDES = list of include directories
1212
# MGIS_CMAKE_REQUIRED_LIBRARIES = list of libraries to link
1313
# MGIS_ADDITIONAL_LINK_FLAGS = additional flags for the MFrontGenericInterface library
14+
# MGIS_REQUIRED_ADDITIONAL_PACKAGES = additional required packages for the MFrontGenericInterface library
1415
#
1516
# This macro is a copy of CheckCXXSourceCompiles.cmake
1617
# Copyright 2005-2009 Kitware, Inc.
@@ -128,6 +129,7 @@ set(OPTIMISATION_FLAGS "")
128129
set(COMPILER_WARNINGS "")
129130
set(MGIS_ADDITIONAL_LIBRARIES "")
130131
set(MGIS_ADDITIONAL_LINK_FLAGS "")
132+
set(MGIS_REQUIRED_ADDITIONAL_PACKAGES "")
131133

132134
option(enable-gpu-offloading "enable offloading on GPUS. Support of offloading depends on compiler support" OFF)
133135
option(enable-fast-math "enable -ffast-math compiler flag" OFF)

cmake/modules/gcc.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ set(COMPILER_C_WARNINGS "-Wall -W -pedantic")
112112

113113
if(enable-parallel-stl-algorithms)
114114
find_package(TBB REQUIRED)
115+
list(APPEND MGIS_REQUIRED_ADDITIONAL_PACKAGES "TBB")
115116
list(APPEND MGIS_ADDITIONAL_LIBRARIES "TBB::tbb")
116117
endif(enable-parallel-stl-algorithms)
117118

include/MGIS/Function/Algorithms.hxx

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,11 @@ namespace mgis::function {
5757
FunctionType&,
5858
const ExecutionPolicy,
5959
const EvaluatorType) //
60-
requires(((LinearElementSpaceConcept<std::decay_t<
61-
decltype(getSpace(std::declval<EvaluatorType>()))>>) ||
62-
(LinearQuadratureSpaceConcept<std::decay_t<
63-
decltype(getSpace(std::declval<EvaluatorType>()))>>)) &&
64-
internals::same_decay_type<
65-
decltype(getSpace(std::declval<FunctionType>())),
66-
decltype(getSpace(std::declval<EvaluatorType>()))>);
60+
requires(
61+
((LinearElementSpaceConcept<evaluator_space<EvaluatorType>>) ||
62+
(LinearQuadratureSpaceConcept<evaluator_space<EvaluatorType>>)) &&
63+
std::same_as<function_space<FunctionType>,
64+
evaluator_space<EvaluatorType>>);
6765
/*!
6866
* \brief assign the evaluator to a function
6967
* \param[in] ctx: execution context
@@ -80,10 +78,7 @@ namespace mgis::function {
8078
const ExecutionPolicy,
8179
const EvaluatorType,
8280
const OperatorType,
83-
const real) requires(LinearElementSpaceConcept<std::
84-
decay_t<decltype(getSpace(
85-
std::declval<
86-
EvaluatorType>()))>>);
81+
const real) requires(LinearElementSpaceConcept<evaluator_space<EvaluatorType>>);
8782
#endif /* MGIS_HAS_STL_PARALLEL_ALGORITHMS */
8883

8984
/*!
@@ -96,13 +91,11 @@ namespace mgis::function {
9691
[[nodiscard]] constexpr bool assign(AbstractErrorHandler&,
9792
FunctionType&,
9893
const EvaluatorType) //
99-
requires(((LinearElementSpaceConcept<std::decay_t<
100-
decltype(getSpace(std::declval<EvaluatorType>()))>>) ||
101-
(LinearQuadratureSpaceConcept<std::decay_t<
102-
decltype(getSpace(std::declval<EvaluatorType>()))>>)) &&
103-
internals::same_decay_type<
104-
decltype(getSpace(std::declval<FunctionType>())),
105-
decltype(getSpace(std::declval<EvaluatorType>()))>);
94+
requires(
95+
((LinearElementSpaceConcept<evaluator_space<EvaluatorType>>) ||
96+
(LinearQuadratureSpaceConcept<evaluator_space<EvaluatorType>>)) &&
97+
std::same_as<function_space<FunctionType>,
98+
evaluator_space<EvaluatorType>>);
10699
/*!
107100
* \brief assign the evaluator to a function
108101
* \param[in] ctx: execution context
@@ -115,10 +108,7 @@ namespace mgis::function {
115108
AbstractErrorHandler&,
116109
const EvaluatorType,
117110
const OperatorType,
118-
const real) requires(LinearElementSpaceConcept<std::
119-
decay_t<decltype(getSpace(
120-
std::declval<
121-
EvaluatorType>()))>>);
111+
const real) requires(LinearElementSpaceConcept<evaluator_space<EvaluatorType>>);
122112

123113
#endif /* MSC_VER */
124114

0 commit comments

Comments
 (0)