1 #ifndef _RHEO_FIELD_WDOF_CONVERT_H
2 #define _RHEO_FIELD_WDOF_CONVERT_H
47 #include "rheolef/field_lazy.h"
48 #include "rheolef/field_wdof.h"
49 #include "rheolef/band.h"
51 namespace rheolef {
namespace details {
53 template<
class FieldWdof,
class FieldLazy,
class SetPlusOp>
54 typename std::enable_if<
55 has_field_lazy_interface<FieldLazy>::value
56 && has_field_wdof_interface<FieldWdof>::value
60 const FieldLazy& expr0,
61 const SetPlusOp& my_set_plus_op,
65 using scalar_type =
typename FieldWdof::scalar_type;
66 using memory_type =
typename FieldWdof::memory_type;
67 using geo_type =
typename FieldWdof::geo_type;
68 using space_type =
typename FieldWdof::space_type;
70 FieldLazy expr = expr0;
74 const space_type& Xh = expr.get_space();
75 check_macro (uh.get_space() == Xh,
"invalid spaces");
76 geo_type omega = expr.get_geo();
77 expr.initialize (omega);
78 std::vector<size_type> dis_idx;
79 Eigen::Matrix<scalar_type,Eigen::Dynamic,1> lk;
82 if (Xh.get_constitution().is_discontinuous()) {
83 Xh.get_constitution().neighbour_guard();
85 bool is_on_band = expr.is_on_band();
87 if (is_on_band)
gh = expr.get_band();
91 for (
size_type ie = 0, ne = omega.size(map_d); ie < ne; ie++) {
92 const geo_element& K = omega.get_geo_element (map_d, ie);
97 Xh.get_constitution().assembly_dis_idof (omega, K, dis_idx);
101 Xh.dis_idof (
L, dis_idx);
106 expr.evaluate (omega, K, lk);
111 "incompatible sizes dis_idx("<<dis_idx.size()<<
") and lk("<<lk.size()<<
")");
112 for (
size_type loc_idof = 0, loc_ndof = lk.size(); loc_idof < loc_ndof; loc_idof++) {
121 uh.dis_dof_update (generic_set_plus_op());
field::size_type size_type
field gh(Float epsilon, Float t, const field &uh, const test &v)
see the geo_element page for the full documentation
typename scalar_traits< value_type >::type scalar_type
typename Expr1::memory_type memory_type
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
std::enable_if< has_field_lazy_interface< FieldLazy >::value &&has_field_wdof_interface< FieldWdof >::value,FieldWdof & >::type convert_lazy2wdof(const FieldLazy &expr0, const SetPlusOp &my_set_plus_op, FieldWdof &uh)
void dis_idof(const basis_basic< T > &b, const geo_size &gs, const geo_element &K, typename std::vector< size_type >::iterator dis_idof_tab)
This file is part of Rheolef.