39 #ifndef GETFEM_MESH_SUM_H__
40 #define GETFEM_MESH_SUM_H__
45 typedef std::vector<const std::string *> dof_enrichments;
48 class fem_sum :
public virtual_fem {
49 std::vector<pfem> pfems;
50 bool smart_global_dof_linking_;
56 fem_sum(
const std::vector<pfem> &pfs,
size_type i,
57 bool smart_global_dof_linking)
58 : pfems(pfs), smart_global_dof_linking_(smart_global_dof_linking),
62 void base_value(
const base_node &x, base_tensor &t)
const;
63 void grad_base_value(
const base_node &x, base_tensor &t)
const;
64 void hess_base_value(
const base_node &x, base_tensor &t)
const;
66 void real_base_value(
const fem_interpolation_context& c,
67 base_tensor &t,
bool =
true)
const;
68 void real_grad_base_value(
const fem_interpolation_context& c,
69 base_tensor &t,
bool =
true)
const;
70 void real_hess_base_value(
const fem_interpolation_context& c,
71 base_tensor &t,
bool =
true)
const;
72 void mat_trans(base_matrix &M,
const base_matrix &G,
82 std::vector<const mesh_fem *> mfs;
84 mutable std::map< std::vector<pfem>,
pfem> situations;
85 mutable std::vector<pfem> build_methods;
86 mutable bool is_adapted;
87 bool smart_global_dof_linking_;
88 void clear_build_methods();
96 return mesh_fem::memsize();
99 mesh_fem_sum(
const mesh &me,
bool smart_global_dof_linking =
false)
100 : mesh_fem(me), smart_global_dof_linking_(smart_global_dof_linking)
101 { is_adapted =
false; }
102 void set_mesh_fems(
const std::vector<const mesh_fem *> &mefs)
103 { mfs = mefs; adapt(); }
110 { smart_global_dof_linking_ = b; }
111 void set_mesh_fems(
const mesh_fem &mf1)
112 { mfs.clear(); mfs.push_back(&mf1); adapt(); }
113 void set_mesh_fems(
const mesh_fem &mf1,
const mesh_fem &mf2)
114 { mfs.clear(); mfs.push_back(&mf1); mfs.push_back(&mf2); adapt(); }
115 void set_mesh_fems(
const mesh_fem &mf1,
const mesh_fem &mf2,
116 const mesh_fem &mf3) {
118 mfs.push_back(&mf1); mfs.push_back(&mf2); mfs.push_back(&mf3);
122 ~mesh_fem_sum() { clear_build_methods(); }