38 #ifndef GETFEM_MESH_SUM_H__
39 #define GETFEM_MESH_SUM_H__
46 class fem_sum :
public virtual_fem {
47 std::vector<pfem> pfems;
48 bool smart_global_dof_linking_;
54 fem_sum(
const std::vector<pfem> &pfs,
size_type i,
55 bool smart_global_dof_linking)
56 : pfems(pfs), smart_global_dof_linking_(smart_global_dof_linking),
60 void base_value(
const base_node &x, base_tensor &t)
const;
61 void grad_base_value(
const base_node &x, base_tensor &t)
const;
62 void hess_base_value(
const base_node &x, base_tensor &t)
const;
64 void real_base_value(
const fem_interpolation_context& c,
65 base_tensor &t,
bool =
true)
const;
66 void real_grad_base_value(
const fem_interpolation_context& c,
67 base_tensor &t,
bool =
true)
const;
68 void real_hess_base_value(
const fem_interpolation_context& c,
69 base_tensor &t,
bool =
true)
const;
70 void mat_trans(base_matrix &M,
const base_matrix &G,
80 std::vector<const mesh_fem *> mfs;
82 mutable std::map< std::vector<pfem>,
pfem> situations;
83 mutable std::vector<pfem> build_methods;
84 mutable bool is_adapted;
85 bool smart_global_dof_linking_;
86 void clear_build_methods();
94 return mesh_fem::memsize();
97 mesh_fem_sum(
const mesh &me,
bool smart_global_dof_linking =
false)
98 : mesh_fem(me), smart_global_dof_linking_(smart_global_dof_linking)
99 { is_adapted =
false; }
100 void set_mesh_fems(
const std::vector<const mesh_fem *> &mefs)
101 { mfs = mefs; adapt(); }
108 { smart_global_dof_linking_ = b; }
109 void set_mesh_fems(
const mesh_fem &mf1)
110 { mfs.clear(); mfs.push_back(&mf1); adapt(); }
111 void set_mesh_fems(
const mesh_fem &mf1,
const mesh_fem &mf2)
112 { mfs.clear(); mfs.push_back(&mf1); mfs.push_back(&mf2); adapt(); }
113 void set_mesh_fems(
const mesh_fem &mf1,
const mesh_fem &mf2,
114 const mesh_fem &mf3) {
116 mfs.push_back(&mf1); mfs.push_back(&mf2); mfs.push_back(&mf3);
120 ~mesh_fem_sum() { clear_build_methods(); }
Implement a special mesh_fem with merges the FEMs of two (or more) mesh_fems.
void set_smart_global_dof_linking(bool b)
enabled "smart" dof linking between the mesh_fems.
void update_from_context() const
this function has to be defined and should update the object when the context is modified.
Describe a finite element method linked to a mesh.
Define the getfem::mesh_fem class.
std::shared_ptr< const getfem::virtual_fem > pfem
type of pointer on a fem description
size_t size_type
used as the common size type in the library
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation
GEneric Tool for Finite Element Methods.