The description of an integration method on a whole mesh is done thanks to the structure getfem::mesh_im, defined in the file getfem/getfem_mesh_im.h. Basically, this structure describes the integration method on each element of the mesh. One can instantiate a getfem::mesh_im object as follows:
getfem::mesh_im mim(mymesh);
where mymesh is an already existing mesh. The structure will be linked to this mesh and will react when modifications will be done on it (for example when the mesh is refined, the integration method will be also refined).
It is possible to specify element by element the integration method, so that element of mixed types can be treated, even if the dimensions are different.
To select a particular integration method on a given element, one can use:
mim.set_integration_method(i, ppi);
where i is the index of the element and ppi is the descriptor of the integration method. Alternative forms of this member function are:
void mesh_im::set_integration_method(const dal::bit_vector &cvs,
getfem::pintegration_method ppi);
void mesh_im::set_integration_method(getfem::pintegration_method ppi);
which set the integration method for either the convexes listed in the bit_vector cvs, or all the convexes of the mesh.
The list of all available descriptors of integration methods is in the file getfem/getfem_integration.h. Descriptors for integration methods are available thanks to the following function:
getfem::pintegration_method ppi = getfem::int_method_descriptor("name of method");
where "name of method" is to be chosen among the existing methods. A name of a method can be retrieved with:
std::string im_name = getfem::name_of_int_method(ppi);
A non exhaustive list (see Appendix B. Cubature method list or getfem/getfem_integration.h for exhaustive lists) of integration methods is given below.
Examples of exact integration methods:
Examples of approximated integration methods:
Note
Note that "IM_QUAD(3)" is not able to integrate exactly the base functions of the "FEM_QK(2,3)" finite element! Since its base function are tensorial product of 1D polynomials of degree 3, one would need to use "IM_QUAD(7)" (6 is not available). Hence "IM_GAUSS_PARALLELEPIPED(2,k)" should always be preferred over "IM_QUAD(2*k)" since it has less integration points.
An alternative way to obtain integration methods:
getfem::pintegration_method ppi =
getfem::classical_exact_im(bgeot::pgeometric_trans pgt);
getfem::pintegration_method ppi =
getfem::classical_approx_im(bgeot::pgeometric_trans pgt, dim_type d);
These functions return an exact (i.e. analytical) integration method, or select an approximate integration method which is able to integrate exactly polynomials of degree <= d (at least) for convexes defined with the specified geometric transformation.
Once an integration method is defined on a mesh, it is possible to obtain information on it with the following methods (the list is not exhaustive).
Set of indexes (a dal::bit_vector) on which an integration method is defined.
Gives a reference to the linked mesh.
Gives a descriptor on the integration method defined on element of index i.
Clear the structure. There are no further integration method defined on the mesh.