33 scalar_type is_in(
const base_node& point)
const{
34 GMM_ASSERT1(point.size() >= 2,
"Invalid dimension of pt " << point);
37 return ori_ref_convex_->is_in(point_2d);
41 GMM_ASSERT1(point.size() >= 2,
"Invalid dimension of pt " << point);
42 base_node point2D = point;
44 return ori_ref_convex_->is_in_face(f, point2D);
46 torus_reference(bgeot::pconvex_ref ori_ref_convex) :
48 torus_structure_descriptor(ori_ref_convex->structure()), ori_ref_convex->is_basic())
50 ori_ref_convex_ = ori_ref_convex;
51 convex<base_node>::points().resize(cvs->nb_points());
52 normals_.resize(ori_ref_convex->normals().size());
54 const std::vector<base_small_vector> &ori_normals = ori_ref_convex->normals();
55 const stored_point_tab &ori_points = ori_ref_convex->points();
56 for(
size_type n = 0; n < ori_normals.size(); ++n){
57 normals_[n] = ori_normals[n];
58 normals_[n].resize(3);
61 std::copy(ori_points.begin(), ori_points.end(), convex<base_node>::points().begin());
62 for(
size_type pt = 0; pt < convex<base_node>::points().size(); ++pt){
63 convex<base_node>::points()[pt].resize(3);
65 ppoints = store_point_tab(convex<base_node>::points());
69 bgeot::pconvex_ref ori_ref_convex_;
76 dal::pstatic_stored_object_key
77 pk = std::make_shared<torus_structure_key>(ori_structure);
79 if (o)
return std::dynamic_pointer_cast<const convex_structure>(o);
81 auto p = std::make_shared<torus_structure>();
83 p->Nc = dim_type(ori_structure->dim() + 1);
84 p->nbpt = ori_structure->nb_points();
85 p->nbf = ori_structure->nb_faces();
87 p->faces_struct.resize(p->nbf);
88 p->faces.resize(p->nbf);
91 p->faces_struct[j] = ori_structure->faces_structure()[j];
92 short_type nbIndex = ori_structure->nb_points_of_face(j);
93 p->faces[j].resize(nbIndex);
94 p->faces[j] = ori_structure->ind_points_of_face(j);
97 p->dir_points_.resize(ori_structure->ind_dir_points().size());
98 p->dir_points_ = ori_structure->ind_dir_points();
106 DAL_SIMPLE_KEY(torus_reference_key, pconvex_ref);
108 pconvex_ref ptorus_reference(pconvex_ref ori_convex_reference)
110 dal::pstatic_stored_object_key
111 pk = std::make_shared<torus_reference_key>(ori_convex_reference);
114 if (o)
return std::dynamic_pointer_cast<const bgeot::convex_of_reference>(o);
115 pconvex_ref p = std::make_shared<torus_reference>(ori_convex_reference);
117 dal::PERMANENT_STATIC_OBJECT);
124 poriginal_trans_->poly_vector_val(pt_2d, val);
128 bgeot::base_vector &val)
const{
131 poriginal_trans_->poly_vector_val(pt_2d, ind_ct, val);
138 poriginal_trans_->poly_vector_grad(pt2D, pc2D);
140 bgeot::base_vector base_value;
141 poriginal_trans_->poly_vector_val(pt2D, base_value);
146 for (bgeot::dim_type n = 0; n < 2; ++n) pc(i, n) = pc2D(i, n);
147 pc(i, 2) = base_value[i];
152 const bgeot::convex_ind_ct &ind_ct, bgeot::base_matrix &pc)
const{
155 bgeot::base_matrix pc2D(ind_ct.size(), 2);
156 poriginal_trans_->poly_vector_grad(pt2D, pc2D);
157 pc.resize(ind_ct.size(),
dim());
158 for (
size_type i = 0; i < ind_ct.size(); ++i){
159 for (bgeot::dim_type n = 0; n < 2; ++n) pc(i, n) = pc2D(i, n);
164 (
const bgeot::base_matrix &G,
const bgeot::base_matrix &pc, bgeot::base_matrix &K)
const{
168 for (
short_type i = 0; i < 2; ++i) K(2, i) = K(i, 2) = 0;
172 bgeot::base_matrix & )
const{
173 GMM_ASSERT1(
false,
"Sorry, Hessian is not supported in axisymmetric transformation.");
176 void torus_geom_trans::project_into_reference_convex(
base_node &pt)
const {
177 poriginal_trans_->project_into_reference_convex(pt);
181 : poriginal_trans_(poriginal_trans){
182 geometric_trans::is_lin = poriginal_trans_->is_linear();
183 geometric_trans::cvr = ptorus_reference(poriginal_trans_->convex_ref());
184 complexity_ = poriginal_trans_->complexity();
185 fill_standard_vertices();
186 name_ = poriginal_trans->debug_name();
190 return poriginal_trans_;
194 const torus_structure *cvs_torus =
dynamic_cast<const torus_structure *
>(cvs.get());
195 return cvs_torus != NULL;
201 dal::pstatic_stored_object_key
202 pk = std::make_shared<torus_geom_trans_key>(poriginal_trans);
205 if (o)
return std::dynamic_pointer_cast<const torus_geom_trans>(o);
213 const torus_geom_trans *pgt_torus =
dynamic_cast<const torus_geom_trans *
>(pgt.get());
214 return pgt_torus != NULL;
Base class for reference convexes.
dim_type dim() const
Dimension of the reference element.
size_type nb_points() const
Number of geometric nodes.
virtual void compute_K_matrix(const base_matrix &G, const base_matrix &pc, base_matrix &K) const
compute K matrix from multiplication of G with gradient
torus_structure which extends a 2 dimensional structure with a radial dimension
gmm::uint16_type short_type
used as the common short type integer in the library
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
pconvex_structure basic_structure(pconvex_structure cv)
Original structure (if concerned)
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation
void add_stored_object(pstatic_stored_object_key k, pstatic_stored_object o, permanence perm)
Add an object with two optional dependencies.
pstatic_stored_object search_stored_object(pstatic_stored_object_key k)
Gives a pointer to an object from a key pointer.
virtual void poly_vector_val(const base_node &, bgeot::base_vector &) const
Gives the value of the functions vector at a certain point.
virtual void compute_K_matrix(const bgeot::base_matrix &, const bgeot::base_matrix &, bgeot::base_matrix &) const
compute K matrix from multiplication of G with gradient
virtual void poly_vector_grad(const base_node &, bgeot::base_matrix &) const
Gives the gradient of the functions vector at a certain point.
virtual void poly_vector_hess(const base_node &, bgeot::base_matrix &) const
Gives the hessian of the functions vector at a certain point.