40 #ifndef BGEOT_POLY_COMPOSITE_H__
41 #define BGEOT_POLY_COMPOSITE_H__
56 mutable int exp_max, exp_min;
57 mutable scalar_type c_max;
64 base = ba; exp_max = ema; exp_min = emi;
65 c_max = pow(
double(base),
double(-exp_max));
71 struct mesh_precomposite {
73 typedef dal::dynamic_tree_sorted<base_node, imbricated_box_less> PTAB;
75 const basic_mesh *msh;
78 std::map<size_type, std::vector<size_type>> box_to_convexes_map;
79 std::vector<base_matrix> gtrans, gtransinv;
80 std::vector<scalar_type> det;
81 std::vector<base_node> orgs;
83 const basic_mesh &linked_mesh(
void)
const {
return *msh; }
84 size_type nb_convex(
void)
const {
return gtrans.size(); }
85 dim_type dim(
void)
const {
return msh->dim(); }
87 {
return msh->trans_of_convex(ic); }
88 void initialise(
const basic_mesh &m);
90 mesh_precomposite(
const basic_mesh &m);
91 mesh_precomposite(
void) : msh(0), box_tree(1e-13) {}
94 typedef const mesh_precomposite *pmesh_precomposite;
97 stored_base_poly(
const base_poly &p) : base_poly(p) {}
99 typedef std::shared_ptr<const stored_base_poly> pstored_base_poly;
102 class polynomial_composite {
105 const mesh_precomposite *mp;
106 std::map<size_type, pstored_base_poly> polytab;
107 bool local_coordinate;
111 std::vector<base_poly> default_polys;
114 scalar_type eval(
const base_node &p,
size_type l)
const;
116 template <
class ITER> scalar_type eval(
const ITER &it,
119 void set_poly_of_subelt(
size_type l,
const base_poly &poly);
120 const base_poly &poly_of_subelt(
size_type l)
const;
121 size_type nb_subelt()
const {
return polytab.size(); }
123 polynomial_composite(
bool lc =
true,
bool ff =
false)
124 : local_coordinate(lc), faces_first(ff) {}
125 polynomial_composite(
const mesh_precomposite &m,
bool lc =
true,
130 inline std::ostream &
operator <<
131 (std::ostream &o,
const polynomial_composite& P) {
132 o <<
"poly_composite [";
133 for (
size_type i = 0; i < P.nb_subelt(); ++i) {
134 if (i != 0) o <<
", " << P.poly_of_subelt(i);
140 template <
class ITER>
141 scalar_type polynomial_composite::eval(
const ITER &it,
size_type l)
const {
142 base_node p(mp->dim());
143 std::copy(it, it+mp->dim(), p.begin());
148 pbasic_mesh &pm, pmesh_precomposite &pmp,
149 bool force_simplexification=
false);
170 const std::vector<std::unique_ptr<mesh_structure>>&
Multivariate polynomials.
region-tree for window/point search on a set of rectangles.
Balanced tree of n-dimensional rectangles.
base class for static stored objects
gmm::uint16_type short_type
used as the common short type integer in the library
const basic_mesh * refined_simplex_mesh_for_convex(pconvex_ref cvr, short_type k)
simplexify a convex_ref.
void structured_mesh_for_convex(pconvex_ref cvr, short_type k, pbasic_mesh &pm, pmesh_precomposite &pmp, bool force_simplexification)
This function returns a mesh in pm which contains a refinement of the convex cvr if force_simplexific...
const std::vector< std::unique_ptr< mesh_structure > > & refined_simplex_mesh_for_convex_faces(pconvex_ref cvr, short_type k)
simplexify the faces of a convex_ref
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
A comparison function for bgeot::base_node.
int operator()(const base_node &x, const base_node &y) const
comparaison function