1 #ifndef _RHEOLEF_FORM_EXPR_QUADRATURE_H
2 #define _RHEOLEF_FORM_EXPR_QUADRATURE_H
43 #include "rheolef/form_expr_variational.h"
44 #include "rheolef/init_expr_quadrature.h"
88 template<class Sfinae = typename std::enable_if<is_form_expr_v2_variational_arg<Expr>::value, Expr>
::type>
102 template<
class Value>
106 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& ak)
const;
108 template<
class Value>
128 template<
class Sfinae>
144 _pops.initialize (omega_K.get_piola_basis(), quad, new_iopt);
145 _expr.initialize (_pops, new_iopt);
155 _pops.initialize (
gh.band().get_piola_basis(), quad, new_iopt);
156 _expr.initialize (
gh, _pops, new_iopt);
159 template<
class Value>
164 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& ak)
const
166 const Eigen::Matrix<float_type,Eigen::Dynamic,1>& w = _pops.get_weight (omega_K, K);
167 _expr.
evaluate (omega_K, K, _value_i);
170 size_t ni = _value_i.dimension(0);
171 size_t nj = _value_i.dimension(1);
172 size_t nk = _value_i.dimension(2);
174 for (
size_t j = 0; j < nj; ++j) {
175 for (
size_t k = 0; k < nk; ++k) {
177 for (
size_t i = 0; i < ni; ++i) {
178 sum += w[i] * _value_i(i,j,k);
215 template<class Sfinae = typename std::enable_if<is_form_expr_v2_variational_arg<Expr>::value, Expr>
::type>
229 template<
class Value>
233 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& ak)
const;
235 template<
class Value>
257 template<
class Sfinae>
262 _ignore_sys_coord(false),
276 _pops.initialize (omega_K.get_piola_basis(), quad, new_iopt);
277 _expr.initialize (_pops, new_iopt);
287 _pops.initialize (
gh.band().get_piola_basis(), quad, new_iopt);
288 _expr.initialize (
gh, _pops, new_iopt);
289 fatal_macro(
"on_local_sides: banded-level set not yet supported, sorry");
292 template<
class Value>
297 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>&
value)
const
300 size_type nyi = get_test_space().get_constitution().assembly_loc_ndof (omega_K, K);
301 size_type nxj = get_trial_space().get_constitution().assembly_loc_ndof (omega_K, K);
304 const geo_element& S = omega_K.dis_get_geo_element (sid_dim, dis_isid);
307 _expr.evaluate_on_side (omega_K, K, sid, _value_i);
308 const Eigen::Matrix<float_type,Eigen::Dynamic,1>& w = _pops.get_weight (omega_K, S);
310 size_t ni = _value_i.dimension(0);
311 size_t nj = _value_i.dimension(1);
312 size_t nk = _value_i.dimension(2);
314 value = Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>::Zero(nj, nk);
316 for (
size_t j = 0; j < nj; ++j) {
317 for (
size_t k = 0; k < nk; ++k) {
319 for (
size_t i = 0; i < ni; ++i) {
320 sum += w[i] * _value_i(i,j,k);
349 template<
class UnaryFunction,
class Expr>
359 typename Expr::value_type
376 template<class Sfinae = typename std::enable_if<is_form_expr_quadrature_arg<Expr>::value, Expr>
::type>
389 return _expr.initialize (omega_K, iopt); }
391 return _expr.initialize (
gh, iopt); }
393 template<
class Value>
397 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>&
value)
const
406 template<
class Value>
424 #define _RHEOLEF_make_form_expr_quadrature_unary(FUNCTION,FUNCTOR) \
425 template<class Expr> \
429 details::is_form_expr_quadrature_arg<Expr>::value \
430 ,details::form_expr_quadrature_unary< \
435 FUNCTION (const Expr& expr) \
437 return details::form_expr_quadrature_unary <FUNCTOR,Expr> (FUNCTOR(), expr); \
442 #undef _RHEOLEF_make_form_expr_quadrature_unary
454 template<
class BinaryFunction,
class Expr1,
class Expr2>
463 typename Expr1::value_type
466 typename Expr1::value_type
467 ,
typename Expr2::value_type
473 typename Expr1::vf_tag_type,
479 typename Expr2::dual_self_type>
481 typedef typename and_type<
typename Expr1::maybe_symmetric::type,
482 typename Expr2::maybe_symmetric::type>
::type
489 template<
class Sfinae
490 =
typename std::enable_if<
510 _expr1.initialize (omega_K, new_iopt);
511 _expr2.initialize (omega_K, new_iopt);
518 template<
class Value>
522 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>&
value)
const
529 Eigen::Matrix<A2,Eigen::Dynamic,Eigen::Dynamic> value2 (
value.cols(),
value.cols());
531 _expr2.evaluate (omega_K, K, value2);
537 template<
class Value>
563 #define _RHEOLEF_form_expr_quadrature_binary(FUNCTION,FUNCTOR) \
564 template <class Expr1, class Expr2> \
568 details::is_form_expr_quadrature_arg <Expr1>::value \
569 && details::is_form_expr_quadrature_arg <Expr2>::value \
570 ,details::form_expr_quadrature_binary< \
576 FUNCTION (const Expr1& expr1, const Expr2& expr2) \
578 return details::form_expr_quadrature_binary \
579 <FUNCTOR, Expr1, Expr2> \
580 (FUNCTOR(), expr1, expr2); \
582 template <class Expr1, class ExprVar2> \
586 details::is_form_expr_quadrature_arg <Expr1>::value \
587 && details::is_form_expr_v2_variational_arg <ExprVar2>::value \
588 ,details::form_expr_quadrature_binary< \
591 ,details::form_expr_quadrature_on_element<ExprVar2> \
594 FUNCTION (const Expr1& expr1, const ExprVar2& expr_var2) \
596 using Expr2 = details::form_expr_quadrature_on_element<ExprVar2>; \
597 return details::form_expr_quadrature_binary \
598 <FUNCTOR, Expr1, Expr2> \
599 (FUNCTOR(), expr1, Expr2(expr_var2)); \
601 template <class ExprVar1, class Expr2> \
605 details::is_form_expr_v2_variational_arg <ExprVar1>::value \
606 && details::is_form_expr_quadrature_arg <Expr2>::value \
607 ,details::form_expr_quadrature_binary< \
609 ,details::form_expr_quadrature_on_element<ExprVar1> \
613 FUNCTION (const ExprVar1& expr_var1, const Expr2& expr2) \
615 using Expr1 = details::form_expr_quadrature_on_element<ExprVar1>; \
616 return details::form_expr_quadrature_binary \
617 <FUNCTOR, Expr1, Expr2> \
618 (FUNCTOR(), Expr1(expr_var1), expr2); \
624 #undef _RHEOLEF_form_expr_quadrature_binary
635 template<
class Expr1,
class Expr2,
class Sfinae =
void>
638 template<
class Expr1,
class Expr2>
644 is_rheolef_arithmetic <Expr1>::value
645 && is_form_expr_quadrature_arg<Expr2>::value
651 template<
class Expr1,
class Expr2>
657 #define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_left(FUNCTION,FUNCTOR) \
658 template<class Expr1, class Expr2> \
662 details::is_form_expr_quadrature_binary_multiplies_divides_constant_left <Expr1,Expr2>::value \
663 ,details::form_expr_quadrature_unary< \
664 details::binder_first <FUNCTOR, Expr1> \
668 FUNCTION (const Expr1& expr1, const Expr2& expr2) \
670 return details::form_expr_quadrature_unary \
671 <details::binder_first <FUNCTOR,Expr1>, Expr2> \
672 (details::binder_first <FUNCTOR,Expr1> (FUNCTOR(), expr1), expr2); \
675 #define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right(FUNCTION,FUNCTOR) \
676 template<class Expr1, class Expr2> \
680 details::is_form_expr_quadrature_binary_multiplies_divides_constant_right <Expr1,Expr2>::value \
681 ,details::form_expr_quadrature_unary< \
682 details::binder_second <FUNCTOR, Expr2> \
686 FUNCTION (const Expr1& expr1, const Expr2& expr2) \
688 return details::form_expr_quadrature_unary \
689 <details::binder_second <FUNCTOR,Expr2>, Expr1> \
690 (details::binder_second <FUNCTOR,Expr2> (FUNCTOR(), expr2), expr1); \
693 #define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant(FUNCTION,FUNCTOR) \
694 _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_left (FUNCTION,FUNCTOR) \
695 _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right (FUNCTION,FUNCTOR)
701 #undef _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right
702 #undef _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_left
703 #undef _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant
field gh(Float epsilon, Float t, const field &uh, const test &v)
see the geo_element page for the full documentation
size_type edge(size_type i) const
size_type face(size_type i) const
reference_element::size_type size_type
size_type dimension() const
orientation_type get_side_informations(const geo_element &S, size_type &loc_isid, size_type &shift) const
size_type n_subgeo(size_type subgeo_dim) const
see the integrate_option page for the full documentation
bool _is_inside_on_local_sides
rheolef::std BinaryFunction
rheolef::std Expr1
dot(x,y): see the expression page for the full documentation
#define fatal_macro(message)
integrate_option expr_quadrature_init_iopt(const geo_basic< T, M > &omega_K, const space_basic< T, M > &X, size_t n_derivative, const integrate_option &iopt)
This file is part of Rheolef.
std::enable_if< details::is_field_expr_v2_variational_arg< Expr >::value,details::field_expr_quadrature_on_sides< Expr > >::type on_local_sides(const Expr &expr)
on_local_sides(expr): see the expression page for the full documentation
_RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant(operator*, details::multiplies) _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right(operator/
_RHEOLEF_make_form_expr_quadrature_unary(operator+, details::unary_plus) _RHEOLEF_make_form_expr_quadrature_unary(operator-
_RHEOLEF_form_expr_quadrature_binary(operator+, details::plus) _RHEOLEF_form_expr_quadrature_binary(operator-