1 #ifndef _RHEO_INTEGRATE_H
2 #define _RHEO_INTEGRATE_H
174 #include "rheolef/field_expr.h"
175 #include "rheolef/field_expr_variational.h"
176 #include "rheolef/form_expr_variational.h"
178 #include "rheolef/field_expr_value_assembly.h"
179 #include "rheolef/field_vf_assembly.h"
180 #include "rheolef/form_vf_assembly.h"
181 #include "rheolef/form_expr_quadrature.h"
182 #include "rheolef/field_expr_quadrature.h"
184 #include "rheolef/functor.h"
193 template <
class T,
class M,
class Expr,
194 class Result =
typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr>::type::value_type>
196 typename std::enable_if<
197 details::is_field_expr_v2_nonlinear_arg<Expr>::value
198 && ! is_undeterminated<Result>::value,
203 Result
dummy = Result())
206 if (omega.map_dimension() < omega.get_background_geo().map_dimension()) {
207 omega.get_background_geo().neighbour_guard();
216 template <
class T,
class M>
221 if (iopt.
get_order() == std::numeric_limits<integrate_option::size_type>::max()) {
231 template<
class T,
class M,
class Expr>
233 typename std::enable_if<
234 details::is_field_expr_v2_nonlinear_arg<Expr>::value
235 && is_undeterminated<typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr>::type::value_type>
::value,
236 typename scalar_traits<typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr>::type::value_type>
::type
243 switch (
expr.valued_tag()) {
253 <<
"' valued expression");
262 template <
class T,
class M,
class Expr>
266 details::is_field_expr_quadrature_arg<Expr>::value
279 template <
class T,
class M,
class Expr>
283 details::is_field_expr_v2_variational_arg<Expr>::value
298 template <
class Expr>
302 details::is_field_expr_quadrature_arg<Expr>::value
303 ,field_basic <typename Expr::scalar_type, typename Expr::memory_type>
312 dom =
expr.get_vf_space().get_constitution().get_geo();
313 lh.assembly (dom,
expr, iopt);
316 template <
class Expr>
320 details::is_field_expr_v2_variational_arg<Expr>::value
321 ,field_basic <typename Expr::scalar_type, typename Expr::memory_type>
334 template <
class Expr>
338 details::is_field_expr_quadrature_arg<Expr>::value
339 ,field_basic <typename Expr::scalar_type, typename Expr::memory_type>
343 const std::string& domname,
349 dom =
expr.get_vf_space().get_constitution().get_geo() [domname];
350 lh.assembly (dom,
expr, iopt);
353 template <
class Expr>
357 details::is_field_expr_v2_variational_arg<Expr>::value
358 ,field_basic <typename Expr::scalar_type, typename Expr::memory_type>
362 const std::string& domname,
367 return integrate (domname, expr_quad, fopt);
374 template <
class T,
class M,
class Expr>
378 details::is_form_expr_quadrature_arg<Expr>::value
379 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
391 template <
class T,
class M,
class Expr>
395 details::is_form_expr_v2_variational_arg<Expr>::value
396 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
410 template <
class Expr>
414 details::is_form_expr_quadrature_arg<Expr>::value
415 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
424 dom_trial =
expr.get_trial_space().get_constitution().get_geo(),
425 dom_test =
expr.get_test_space().get_constitution().get_geo(),
428 if (dom_trial.is_broken() && dom_test.is_broken() &&
429 expr.get_trial_space().get_constitution().is_hierarchical() &&
430 expr.get_test_space().get_constitution().is_hierarchical() ) {
431 dom = dom_test.get_background_geo();
432 }
else if (dom_trial.name() == dom_test.name() ||
433 dom_trial.name() == dom_test.get_background_geo().name() ||
434 dom_trial.is_broken()) {
436 }
else if (dom_test.name() == dom_trial.get_background_geo().name() ||
437 dom_test.is_broken()) {
440 error_macro(
"integrate: incompatible domains: trial \""<<dom_trial.name()
441 <<
"\" and \"" << dom_test.name() <<
"\"");
443 trace_macro (
"dom_trial="<<dom_trial.name()<<
" dom_test="<<dom_test.name()<<
" -> dom="<<dom.name());
444 a.assembly (dom,
expr, fopt);
447 template <
class Expr>
451 details::is_form_expr_v2_variational_arg<Expr>::value
452 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
465 template <
class Expr>
469 details::is_form_expr_quadrature_arg<Expr>::value
470 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
474 const std::string& domname,
480 dom =
expr.get_trial_space().get_constitution().get_background_geo()[domname];
481 a.assembly (dom,
expr, fopt);
484 template <
class Expr>
488 details::is_form_expr_v2_variational_arg<Expr>::value
489 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
493 const std::string& domname,
498 return integrate (domname, expr_quad, fopt);
503 template <
class T,
class M,
class Expr>
507 details::is_field_expr_quadrature_arg<Expr>::value
508 ,field_basic <typename Expr::scalar_type, typename Expr::memory_type>
512 const band_basic<T,M>&
gh,
520 template <
class T,
class M,
class Expr>
524 details::is_field_expr_v2_variational_arg<Expr>::value
525 ,field_basic <typename Expr::scalar_type, typename Expr::memory_type>
529 const band_basic<T,M>&
gh,
537 template <
class T,
class M,
class Expr>
541 details::is_form_expr_quadrature_arg<Expr>::value
542 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
546 const band_basic<T,M>&
gh,
554 template <
class T,
class M,
class Expr>
558 details::is_form_expr_v2_variational_arg<Expr>::value
559 ,form_basic <typename Expr::scalar_type, typename Expr::memory_type>
563 const band_basic<T,M>&
gh,
572 #endif // _RHEO_INTEGRATE_H