40 #ifndef GETFEM_MAT_ELEM_H__ 
   41 #define GETFEM_MAT_ELEM_H__ 
   52   struct mat_elem_integration_callback {
 
   57     std::vector<const bgeot::base_tensor*> eltm;
 
   69     virtual void exec(bgeot::base_tensor &t, 
bool first, scalar_type c) = 0;
 
   70     virtual ~mat_elem_integration_callback() {}
 
   83     mutable base_matrix pa;
 
   87     virtual void compute(base_tensor &t, 
const base_matrix &a,
 
   89                          mat_elem_integration_callback *icb = 0) 
const = 0;
 
   90     virtual void compute_on_face(base_tensor &t, 
const base_matrix &a,
 
   92                                  mat_elem_integration_callback *icb = 0)
 
  102     template <
class CONT> 
void  
  103     gen_compute(base_tensor &t, 
const CONT &a,  
size_type elt, 
 
  104                 mat_elem_integration_callback *icb = 0)
 const { 
 
  105       bgeot::vectors_to_base_matrix(pa, a); 
 
  106       compute(t, pa, elt, icb); 
 
  111     template <
class CONT> 
void  
  112     gen_compute_on_face(base_tensor &t,
 
  114                         mat_elem_integration_callback *icb = 0)
 const {
 
  115       bgeot::vectors_to_base_matrix(pa, a); 
 
  116       compute_on_face(t, pa, f, elt, icb); 
 
  119     mat_elem_computation()
 
  120     { DAL_STORED_OBJECT_DEBUG_CREATED(
this, 
"Mat elem computation"); }
 
  121     virtual ~mat_elem_computation()
 
  122     { DAL_STORED_OBJECT_DEBUG_DESTROYED(
this, 
"Mat elem computation"); }
 
  126   typedef std::shared_ptr<const mat_elem_computation>
 
  127   pmat_elem_computation;
 
  135   pmat_elem_computation 
mat_elem(pmat_elem_type pm, 
 
  136                                  pintegration_method pi,
 
  138                                  bool prefer_comp_on_real_element=
false);
 
  140   class mat_elem_pool {
 
  141     std::set<pmat_elem_computation> mat_elems;
 
  144     pmat_elem_computation operator()(pmat_elem_type pm, 
 
  145                                      pintegration_method pi,
 
  147                                      bool prefer_comp_on_real_element=
false) {
 
  148       pmat_elem_computation p=
mat_elem(pm, pi, pg, prefer_comp_on_real_element);
 
  153       for (
auto it = mat_elems.begin(); it != mat_elems.end(); ++it)
 
  157     ~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...