41 #ifndef BGEOT_POLY_COMPOSITE_H__
42 #define BGEOT_POLY_COMPOSITE_H__
57 mutable int exp_max, exp_min;
58 mutable scalar_type c_max;
65 base = ba; exp_max = ema; exp_min = emi;
66 c_max = pow(
double(base),
double(-exp_max));
72 struct mesh_precomposite {
74 typedef dal::dynamic_tree_sorted<base_node, imbricated_box_less> PTAB;
76 const basic_mesh *msh;
79 std::map<size_type, std::vector<size_type>> box_to_convexes_map;
80 std::vector<base_matrix> gtrans, gtransinv;
81 std::vector<scalar_type> det;
82 std::vector<base_node> orgs;
84 const basic_mesh &linked_mesh(
void)
const {
return *msh; }
85 size_type nb_convex(
void)
const {
return gtrans.size(); }
86 dim_type dim(
void)
const {
return msh->dim(); }
88 {
return msh->trans_of_convex(ic); }
89 void initialise(
const basic_mesh &m);
91 mesh_precomposite(
const basic_mesh &m);
92 mesh_precomposite(
void) : msh(0), box_tree(1e-13) {}
95 typedef const mesh_precomposite *pmesh_precomposite;
98 stored_base_poly(
const base_poly &p) : base_poly(p) {}
100 typedef std::shared_ptr<const stored_base_poly> pstored_base_poly;
103 class polynomial_composite {
106 const mesh_precomposite *mp;
107 std::map<size_type, pstored_base_poly> polytab;
108 bool local_coordinate;
112 std::vector<base_poly> default_polys;
115 scalar_type eval(
const base_node &p,
size_type l)
const;
117 template <
class ITER> scalar_type eval(
const ITER &it,
120 void set_poly_of_subelt(
size_type l,
const base_poly &poly);
121 const base_poly &poly_of_subelt(
size_type l)
const;
122 size_type nb_subelt()
const {
return polytab.size(); }
124 polynomial_composite(
bool lc =
true,
bool ff =
false)
125 : local_coordinate(lc), faces_first(ff) {}
126 polynomial_composite(
const mesh_precomposite &m,
bool lc =
true,
131 inline std::ostream &
operator <<
132 (std::ostream &o,
const polynomial_composite& P) {
133 o <<
"poly_composite [";
134 for (
size_type i = 0; i < P.nb_subelt(); ++i) {
135 if (i != 0) o <<
", " << P.poly_of_subelt(i);
141 template <
class ITER>
142 scalar_type polynomial_composite::eval(
const ITER &it,
size_type l)
const {
143 base_node p(mp->dim());
144 std::copy(it, it+mp->dim(), p.begin());
149 pbasic_mesh &pm, pmesh_precomposite &pmp,
150 bool force_simplexification=
false);
171 const std::vector<std::unique_ptr<mesh_structure>>&