93 #ifndef GETFEM_INTEGRATION_H__ 94 #define GETFEM_INTEGRATION_H__ 117 mutable std::vector<long_scalar_type> int_monomials;
118 mutable std::vector< std::vector<long_scalar_type> > int_face_monomials;
123 dim_type
dim(
void)
const {
return cvs->dim(); }
133 long_scalar_type
int_poly(
const base_poly &P)
const;
144 typedef std::shared_ptr<const poly_integration> ppoly_integration;
153 typedef std::shared_ptr<const integration_method> pintegration_method;
156 class approx_integration {
160 bgeot::pconvex_ref cvr;
161 bgeot::pstored_point_tab pint_points;
162 std::vector<scalar_type> int_coeffs;
163 std::vector<size_type> repartition;
166 std::vector<PT_TAB> pt_to_store;
168 bool built_on_the_fly;
173 dim_type
dim(
void)
const {
return cvr->structure()->dim(); }
174 size_type nb_points(
void)
const {
return int_coeffs.size(); }
176 size_type nb_points_on_convex(
void)
const {
return repartition[0]; }
179 {
return repartition[f+1] - repartition[f]; }
181 {
return repartition[f]; }
184 {
return cvr->structure()->nb_faces(); }
185 bool is_built_on_the_fly(
void)
const {
return built_on_the_fly; }
186 void set_built_on_the_fly(
void) { built_on_the_fly =
true; }
190 bgeot::pconvex_ref ref_convex(
void)
const {
return cvr; }
192 const std::vector<size_type> &repart(
void)
const {
return repartition; }
197 bgeot::pstored_point_tab pintegration_points(
void)
const 198 {
return pint_points; }
200 const base_node &point(
size_type i)
const 201 {
return (*pint_points)[i]; }
205 {
return (*pint_points)[repartition[f] + i]; }
207 const std::vector<scalar_type> &integration_coefficients(
void)
const 208 {
return int_coeffs; }
210 scalar_type coeff(
size_type i)
const {
return int_coeffs[i]; }
213 {
return int_coeffs[repartition[f] + i]; }
215 void add_point(
const base_node &pt, scalar_type w,
217 bool include_empty =
false);
218 void add_point_norepeat(
const base_node &pt, scalar_type w,
220 void add_point_full_symmetric(base_node pt, scalar_type w);
221 void add_method_on_face(pintegration_method ppi,
short_type f);
222 void valid_method(
void);
224 approx_integration(
void) : valid(
false), built_on_the_fly(
false) { }
225 approx_integration(bgeot::pconvex_ref cr)
226 : cvr(cr), repartition(cr->structure()->nb_faces()+1),
227 pt_to_store(cr->structure()->nb_faces()+1), valid(
false),
228 built_on_the_fly(
false)
229 { std::fill(repartition.begin(), repartition.end(), 0); }
230 virtual ~approx_integration() {}
233 typedef std::shared_ptr<const approx_integration> papprox_integration;
245 ppoly_integration ppi;
246 papprox_integration pai;
247 integration_method_type im_type;
248 void remove() { pai = papprox_integration(); ppi = ppoly_integration(); }
251 integration_method_type type(
void)
const {
return im_type; }
252 const papprox_integration &approx_method(
void)
const {
return pai; }
253 const ppoly_integration &exact_method(
void)
const {
return ppi; }
255 void set_approx_method(papprox_integration paii)
256 {
remove(); pai = paii; im_type = IM_APPROX; }
257 void set_exact_method(ppoly_integration ppii)
258 {
remove(); ppi = ppii; im_type = IM_EXACT; }
260 bgeot::pstored_point_tab pintegration_points(
void)
const {
261 if (type() == IM_EXACT) {
263 std::vector<base_node> spt(1); spt[0] = base_node(n);
264 return store_point_tab(spt);
266 else if (type() == IM_APPROX)
267 return pai->pintegration_points();
268 else GMM_ASSERT1(
false,
"IM_NONE has no points");
276 case IM_EXACT:
return ppi->structure();
277 case IM_APPROX:
return pai->structure();
278 case IM_NONE: GMM_ASSERT1(
false,
"IM_NONE has no structure");
279 default: GMM_ASSERT3(
false,
"");
285 DAL_STORED_OBJECT_DEBUG_CREATED(
this,
"Exact integration method");
286 ppi = p; im_type = IM_EXACT;
290 DAL_STORED_OBJECT_DEBUG_CREATED(
this,
"Approximate integration method");
291 pai = p; im_type = IM_APPROX;
295 DAL_STORED_OBJECT_DEBUG_CREATED(
this,
"Integration method");
300 { DAL_STORED_OBJECT_DEBUG_DESTROYED(
this,
"Integration method"); }
312 bool throw_if_not_found =
true);
340 pintegration_method
im_none(
void);
344 papprox_integration composite_approx_int_method(
const bgeot::mesh_precomposite &mp,
346 bgeot::pconvex_ref cr);
350 scalar_type test_integration_error(papprox_integration pim, dim_type order);
352 papprox_integration get_approx_im_or_fail(pintegration_method pim);
357 typedef dal::naming_system<integration_method>::param_list im_param_list;
359 void add_integration_name(std::string name,
Geometric transformations on convexes.
integration_method_type
the list of main integration method types
base class for static stored objects
Handle composite polynomials.
Description of an exact integration of polynomials.
pintegration_method int_method_descriptor(std::string name, bool throw_if_not_found=true)
Get an integration method from its name .
Describe an integration method linked to a mesh.
Structure which dynamically collects points identifying points that are nearer than a certain very sm...
pintegration_method exact_parallelepiped_im(size_type n)
return IM_EXACT_PARALLELEPIPED(n)
dim_type dim(void) const
Dimension of convex of reference.
pintegration_method exact_classical_im(bgeot::pgeometric_trans pgt) IS_DEPRECATED
use classical_exact_im instead.
long_scalar_type int_poly(const base_poly &P) const
Evaluate the integral of the polynomial P on the reference element.
Associate a name to a method descriptor and store method descriptors.
std::shared_ptr< const convex_structure > pconvex_structure
Pointer on a convex structure description.
size_t size_type
used as the common size type in the library
Vector of integer (16 bits type) which represent the powers of a monomial.
pintegration_method im_none(void)
return IM_NONE
std::string name_of_int_method(pintegration_method p)
Get the string name of an integration method .
GEneric Tool for Finite Element Methods.
pintegration_method classical_exact_im(bgeot::pgeometric_trans pgt)
return an exact integration method for convex type handled by pgt.
gmm::uint16_type short_type
used as the common short type integer in the library
bgeot::pconvex_structure structure(void) const
{Structure of convex of reference.
Store a set of points, identifying points that are nearer than a certain very small distance...
pintegration_method classical_approx_im(bgeot::pgeometric_trans pgt, dim_type degree)
try to find an approximate integration method for the geometric transformation pgt which is able to i...
pconvex_structure basic_structure(pconvex_structure cv)
Original structure (if concerned)
this structure is not intended to be used directly.
pintegration_method exact_prism_im(size_type n)
return IM_EXACT_PRISM(n)
long_scalar_type int_poly_on_face(const base_poly &P, short_type f) const
Evaluate the integral of the polynomial P on the face f of the reference element. ...
pintegration_method exact_simplex_im(size_type n)
return IM_EXACT_SIMPLEX(n)
defines and typedefs for namespace getfem
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation