34 scalar_type is_in(
const base_node& point)
const{
35 GMM_ASSERT1(point.size() >= 2,
"Invalid dimension of pt " << point);
38 return ori_ref_convex_->is_in(point_2d);
42 GMM_ASSERT1(point.size() >= 2,
"Invalid dimension of pt " << point);
43 base_node point2D = point;
45 return ori_ref_convex_->is_in_face(f, point2D);
47 torus_reference(bgeot::pconvex_ref ori_ref_convex) :
49 torus_structure_descriptor(ori_ref_convex->structure()), ori_ref_convex->is_basic())
51 ori_ref_convex_ = ori_ref_convex;
52 convex<base_node>::points().resize(cvs->nb_points());
53 normals_.resize(ori_ref_convex->normals().size());
55 const std::vector<base_small_vector> &ori_normals = ori_ref_convex->normals();
56 const stored_point_tab &ori_points = ori_ref_convex->points();
57 for(
size_type n = 0; n < ori_normals.size(); ++n){
58 normals_[n] = ori_normals[n];
59 normals_[n].resize(3);
62 std::copy(ori_points.begin(), ori_points.end(), convex<base_node>::points().begin());
63 for(
size_type pt = 0; pt < convex<base_node>::points().size(); ++pt){
64 convex<base_node>::points()[pt].resize(3);
66 ppoints = store_point_tab(convex<base_node>::points());
70 bgeot::pconvex_ref ori_ref_convex_;
77 dal::pstatic_stored_object_key
78 pk = std::make_shared<torus_structure_key>(ori_structure);
80 if (o)
return std::dynamic_pointer_cast<const convex_structure>(o);
82 auto p = std::make_shared<torus_structure>();
84 p->Nc = dim_type(ori_structure->dim() + 1);
85 p->nbpt = ori_structure->nb_points();
86 p->nbf = ori_structure->nb_faces();
88 p->faces_struct.resize(p->nbf);
89 p->faces.resize(p->nbf);
92 p->faces_struct[j] = ori_structure->faces_structure()[j];
93 short_type nbIndex = ori_structure->nb_points_of_face(j);
94 p->faces[j].resize(nbIndex);
95 p->faces[j] = ori_structure->ind_points_of_face(j);
98 p->dir_points_.resize(ori_structure->ind_dir_points().size());
99 p->dir_points_ = ori_structure->ind_dir_points();
107 DAL_SIMPLE_KEY(torus_reference_key, pconvex_ref);
109 pconvex_ref ptorus_reference(pconvex_ref ori_convex_reference)
111 dal::pstatic_stored_object_key
112 pk = std::make_shared<torus_reference_key>(ori_convex_reference);
115 if (o)
return std::dynamic_pointer_cast<const bgeot::convex_of_reference>(o);
116 pconvex_ref p = std::make_shared<torus_reference>(ori_convex_reference);
118 dal::PERMANENT_STATIC_OBJECT);
125 poriginal_trans_->poly_vector_val(pt_2d, val);
129 bgeot::base_vector &val)
const{
132 poriginal_trans_->poly_vector_val(pt_2d, ind_ct, val);
139 poriginal_trans_->poly_vector_grad(pt2D, pc2D);
141 bgeot::base_vector base_value;
142 poriginal_trans_->poly_vector_val(pt2D, base_value);
147 for (bgeot::dim_type n = 0; n < 2; ++n) pc(i, n) = pc2D(i, n);
148 pc(i, 2) = base_value[i];
153 const bgeot::convex_ind_ct &ind_ct, bgeot::base_matrix &pc)
const{
156 bgeot::base_matrix pc2D(ind_ct.size(), 2);
157 poriginal_trans_->poly_vector_grad(pt2D, pc2D);
158 pc.resize(ind_ct.size(),
dim());
159 for (
size_type i = 0; i < ind_ct.size(); ++i){
160 for (bgeot::dim_type n = 0; n < 2; ++n) pc(i, n) = pc2D(i, n);
165 (
const bgeot::base_matrix &G,
const bgeot::base_matrix &pc, bgeot::base_matrix &K)
const{
168 for (
short_type j = 0; j < nb_points(); ++ j) K(2, 2) += G(0, j) * pc(j, 2);
169 for (
short_type i = 0; i < 2; ++i) K(2, i) = K(i, 2) = 0;
173 bgeot::base_matrix & )
const{
174 GMM_ASSERT1(
false,
"Sorry, Hessian is not supported in axisymmetric transformation.");
177 void torus_geom_trans::project_into_reference_convex(
base_node &pt)
const {
178 poriginal_trans_->project_into_reference_convex(pt);
182 : poriginal_trans_(poriginal_trans){
183 geometric_trans::is_lin = poriginal_trans_->is_linear();
184 geometric_trans::cvr = ptorus_reference(poriginal_trans_->convex_ref());
185 complexity_ = poriginal_trans_->complexity();
186 fill_standard_vertices();
187 name_ = poriginal_trans->debug_name();
191 return poriginal_trans_;
195 const torus_structure *cvs_torus =
dynamic_cast<const torus_structure *
>(cvs.get());
196 return cvs_torus != NULL;
202 dal::pstatic_stored_object_key
203 pk = std::make_shared<torus_geom_trans_key>(poriginal_trans);
206 if (o)
return std::dynamic_pointer_cast<const torus_geom_trans>(o);
214 const torus_geom_trans *pgt_torus =
dynamic_cast<const torus_geom_trans *
>(pgt.get());
215 return pgt_torus != NULL;