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();
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(); }
114 { mfs.clear(); mfs.push_back(&mf1); mfs.push_back(&mf2); adapt(); }
118 mfs.push_back(&mf1); mfs.push_back(&mf2); mfs.push_back(&mf3);
Implement a special mesh_fem with merges the FEMs of two (or more) mesh_fems.
Define the getfem::mesh_fem class.
Describe a mesh (collection of convexes (elements) and points).
void set_smart_global_dof_linking(bool b)
enabled "smart" dof linking between the mesh_fems.
size_t size_type
used as the common size type in the library
GEneric Tool for Finite Element Methods.
std::shared_ptr< const getfem::virtual_fem > pfem
type of pointer on a fem description
Describe a finite element method linked to a mesh.
void update_from_context(void) const
this function has to be defined and should update the object when the context is modified.
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation