41 #ifndef BGEOT_POLY_COMPOSITE_H__ 42 #define BGEOT_POLY_COMPOSITE_H__ 55 :
public std::binary_function<base_node, base_node, int>
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;
78 std::vector<base_matrix> gtrans;
79 std::vector<scalar_type> det;
80 std::vector<base_node> orgs;
82 const basic_mesh &linked_mesh(
void)
const {
return *msh; }
83 size_type nb_convex(
void)
const {
return gtrans.size(); }
84 dim_type dim(
void)
const {
return msh->dim(); }
86 {
return msh->trans_of_convex(ic); }
88 mesh_precomposite(
const basic_mesh &m);
89 mesh_precomposite(
void) : msh(0) {}
92 typedef const mesh_precomposite *pmesh_precomposite;
94 class polynomial_composite {
97 const mesh_precomposite *mp;
98 std::map<size_type, dal::pstatic_stored_object_key> polytab;
99 bool local_coordinate;
105 template <
class ITER> scalar_type eval(
const ITER &it)
const;
106 scalar_type eval(
const base_node &pt)
const;
110 size_type nb_subelt()
const {
return polytab.size(); }
112 polynomial_composite(
bool lc =
true) : local_coordinate(lc) {}
113 polynomial_composite(
const mesh_precomposite &m,
bool lc =
true);
117 inline std::ostream &
operator <<
118 (std::ostream &o,
const polynomial_composite& P) {
119 o <<
"poly_composite [";
120 for (
size_type i = 0; i < P.nb_subelt(); ++i) {
121 if (i != 0) o <<
", " << P.poly_of_subelt(i);
127 template <
class ITER>
128 scalar_type polynomial_composite::eval(
const ITER &it)
const {
130 std::copy(it, it + mp->dim(), pt.begin());
135 pbasic_mesh &pm, pmesh_precomposite &pmp,
136 bool force_simplexification=
false);
157 const std::vector<std::unique_ptr<mesh_structure>>&
const basic_mesh * refined_simplex_mesh_for_convex(pconvex_ref cvr, short_type k)
simplexify a convex_ref.
Multivariate polynomials.
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
A comparison function for bgeot::base_node.
size_t size_type
used as the common size type in the library
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...
int operator()(const base_node &x, const base_node &y) const
comparaison function
gmm::uint16_type short_type
used as the common short type integer in the library
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation