an efficient C++ finite element environment
|
|
Go to the documentation of this file. 1 #ifndef _RHEOLEF_COMPOSE_H
2 #define _RHEOLEF_COMPOSE_H
80 #include "rheolef/field_expr.h"
89 template<
class NaryFunctor,
class... Exprs>
94 static const size_t N =
sizeof...(Exprs);
132 template<
size_t ...Is>
137 bool status_list[] = {(std::get<Is>(
_exprs).initialize (pops, iopt),
true)...};
139 template<
size_t ...Is>
145 bool status_list[] = {(std::get<Is>(
_exprs).initialize (Xh, pops, iopt),
true)...};
161 template<
class Result,
size_t ...Is>
165 Eigen::Matrix<Result,Eigen::Dynamic,1>&
value,
173 typename traits::template arg<Is>::type
179 vec_args_type value_i;
180 bool status_list[] = {(std::get<Is>(
_exprs).evaluate (omega_K, K, std::get<Is>(value_i)),
true)...};
181 size_type loc_nnod = std::get<0>(value_i).size();
182 static const int narg =
sizeof...(Is);
183 size_type size_list[] = {std::get<Is>(value_i).size()...};
184 for (
size_type iarg = 1; iarg < narg; ++iarg) {
185 check_macro(size_list[iarg] == loc_nnod,
"invalid "<<iarg<<
"-th arg-value size="<<size_list[iarg]
186 <<
" and 0-th arg-value size="<<loc_nnod);
188 value.resize (loc_nnod);
189 for (
size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
190 value[loc_inod] =
_f (std::get<Is>(value_i)[loc_inod]...);
193 template<
class Result>
197 Eigen::Matrix<Result,Eigen::Dynamic,1>&
value)
const
201 template<
class Result,
size_t ...Is>
205 "compose; incompatible function " << typename_macro(NaryFunctor)
207 <<
" and expected value " << typename_macro(Result));
210 typename nary_functor_traits::template arg<Is>::decay_type>()... };
212 for (
bool status_i : status_list) {
status &= status_i; }
215 template<
class Result>
236 template<
class Function,
class... Exprs>
238 typename std::enable_if <
239 sizeof...(Exprs) >= 3,
254 #endif // _RHEOLEF_COMPOSE_H
static const space_constant::valued_type valued_hint
#define rheo_default_memory_model
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
bool _valued_check_internal(Result, index_list< Is... >) const
void _initialize_internal(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt, index_list< Is... >) const
bool valued_check() const
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
see the geo_element page for the full documentation
void _initialize_internal(const piola_on_pointset< float_type > &pops, const integrate_option &iopt, index_list< Is... >) const
std::tuple< Exprs... > _exprs
geo_element::size_type size_type
see the integrate_option page for the full documentation
rheo_default_memory_model memory_type
reference_element::size_type size_type
field_expr_v2_nonlinear_node_nary(const NaryFunctor &f, const Exprs &... exprs)
space_constant::valued_type valued_tag() const
This file is part of Rheolef.
void initialize(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
scalar_traits< value_type >::type scalar_type
details::field_expr_v2_nonlinear_node_nary< typename details::function_traits< Function >::functor_type,typename details::field_expr_v2_nonlinear_terminal_wrapper_traits< Exprs >::type... > ::type compose(const Function &f, const Exprs &... exprs)
see the compose page for the full documentation
void _evaluate_internal(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value, index_list< Is... >) const
typename nary_functor_traits::result_type result_type
float_traits< value_type >::type float_type
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
static space_constant::valued_type valued_tag(space_constant::valued_type, space_constant::valued_type)
range_builder< 0, N >::type IndexRange