39 #ifndef GETFEM_MAT_ELEM_H__
40 #define GETFEM_MAT_ELEM_H__
51 struct mat_elem_integration_callback {
56 std::vector<const bgeot::base_tensor*> eltm;
68 virtual void exec(bgeot::base_tensor &t,
bool first, scalar_type c) = 0;
69 virtual ~mat_elem_integration_callback() {}
82 mutable base_matrix pa;
86 virtual void compute(base_tensor &t,
const base_matrix &a,
88 mat_elem_integration_callback *icb = 0)
const = 0;
89 virtual void compute_on_face(base_tensor &t,
const base_matrix &a,
91 mat_elem_integration_callback *icb = 0)
101 template <
class CONT>
void
102 gen_compute(base_tensor &t,
const CONT &a,
size_type elt,
103 mat_elem_integration_callback *icb = 0)
const {
104 bgeot::vectors_to_base_matrix(pa, a);
105 compute(t, pa, elt, icb);
110 template <
class CONT>
void
111 gen_compute_on_face(base_tensor &t,
113 mat_elem_integration_callback *icb = 0)
const {
114 bgeot::vectors_to_base_matrix(pa, a);
115 compute_on_face(t, pa, f, elt, icb);
118 mat_elem_computation()
119 { DAL_STORED_OBJECT_DEBUG_CREATED(
this,
"Mat elem computation"); }
120 virtual ~mat_elem_computation()
121 { DAL_STORED_OBJECT_DEBUG_DESTROYED(
this,
"Mat elem computation"); }
125 typedef std::shared_ptr<const mat_elem_computation>
126 pmat_elem_computation;
134 pmat_elem_computation
mat_elem(pmat_elem_type pm,
135 pintegration_method pi,
137 bool prefer_comp_on_real_element=
false);
139 class mat_elem_pool {
140 std::set<pmat_elem_computation> mat_elems;
143 pmat_elem_computation operator()(pmat_elem_type pm,
144 pintegration_method pi,
146 bool prefer_comp_on_real_element=
false) {
147 pmat_elem_computation p=
mat_elem(pm, pi, pg, prefer_comp_on_real_element);
152 for (
auto it = mat_elems.begin(); it != mat_elems.end(); ++it)
156 ~mat_elem_pool() {
clear(); }
base class for static stored objects
Definition of the finite element methods.
Build elementary tensors descriptors, used by generic assembly.
void clear(L &l)
clear (fill with zeros) a vector or matrix.
gmm::uint16_type short_type
used as the common short type integer in the library
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
void del_stored_object(const pstatic_stored_object &o, bool ignore_unstored)
Delete an object and the object which depend on it.
GEneric Tool for Finite Element Methods.
pmat_elem_computation mat_elem(pmat_elem_type pm, pintegration_method pi, bgeot::pgeometric_trans pg, bool prefer_comp_on_real_element=false)
allocate a structure for computation (integration over elements or faces of elements) of elementary t...