39 #ifndef GETFEM_MESH_SUM_H__
40 #define GETFEM_MESH_SUM_H__
47 class fem_sum :
public virtual_fem {
48 std::vector<pfem> pfems;
49 bool smart_global_dof_linking_;
55 fem_sum(
const std::vector<pfem> &pfs,
size_type i,
56 bool smart_global_dof_linking)
57 : pfems(pfs), smart_global_dof_linking_(smart_global_dof_linking),
61 void base_value(
const base_node &x, base_tensor &t)
const;
62 void grad_base_value(
const base_node &x, base_tensor &t)
const;
63 void hess_base_value(
const base_node &x, base_tensor &t)
const;
65 void real_base_value(
const fem_interpolation_context& c,
66 base_tensor &t,
bool =
true)
const;
67 void real_grad_base_value(
const fem_interpolation_context& c,
68 base_tensor &t,
bool =
true)
const;
69 void real_hess_base_value(
const fem_interpolation_context& c,
70 base_tensor &t,
bool =
true)
const;
71 void mat_trans(base_matrix &M,
const base_matrix &G,
81 std::vector<const mesh_fem *> mfs;
83 mutable std::map< std::vector<pfem>,
pfem> situations;
84 mutable std::vector<pfem> build_methods;
85 mutable bool is_adapted;
86 bool smart_global_dof_linking_;
87 void clear_build_methods();
95 return mesh_fem::memsize();
98 mesh_fem_sum(
const mesh &me,
bool smart_global_dof_linking =
false)
99 : mesh_fem(me), smart_global_dof_linking_(smart_global_dof_linking)
100 { is_adapted =
false; }
101 void set_mesh_fems(
const std::vector<const mesh_fem *> &mefs)
102 { mfs = mefs; adapt(); }
109 { smart_global_dof_linking_ = b; }
110 void set_mesh_fems(
const mesh_fem &mf1)
111 { mfs.clear(); mfs.push_back(&mf1); adapt(); }
112 void set_mesh_fems(
const mesh_fem &mf1,
const mesh_fem &mf2)
113 { mfs.clear(); mfs.push_back(&mf1); mfs.push_back(&mf2); adapt(); }
114 void set_mesh_fems(
const mesh_fem &mf1,
const mesh_fem &mf2,
115 const mesh_fem &mf3) {
117 mfs.push_back(&mf1); mfs.push_back(&mf2); mfs.push_back(&mf3);
121 ~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.