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);
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;
53 normals_.resize(ori_ref_convex->normals().size());
55 const std::vector<base_small_vector> &ori_normals = ori_ref_convex->normals();
57 for(
size_type n = 0; n < ori_normals.size(); ++n){
58 normals_[n] = ori_normals[n];
59 normals_[n].resize(3);
63 for(
size_type pt = 0; pt < convex<base_node>::points().size(); ++pt){
70 bgeot::pconvex_ref ori_ref_convex_;
77 dal::pstatic_stored_object_key
78 pk = std::make_shared<torus_structure_key>(ori_structure);
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);
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{
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.");
178 : poriginal_trans_(poriginal_trans){
179 geometric_trans::is_lin = poriginal_trans_->is_linear();
180 geometric_trans::cvr = ptorus_reference(poriginal_trans_->convex_ref());
181 complexity_ = poriginal_trans_->complexity();
182 fill_standard_vertices();
186 return poriginal_trans_;
191 return cvs_torus != NULL;
197 dal::pstatic_stored_object_key
198 pk = std::make_shared<torus_geom_trans_key>(poriginal_trans);
210 return pgt_torus != NULL;
friend pconvex_structure basic_structure(pconvex_structure cv)
Original structure (if concerned)
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
generic definition of a convex ( bgeot::convex_structure + vertices coordinates ) ...
pstatic_stored_object search_stored_object(pstatic_stored_object_key k)
Gives a pointer to an object from a key pointer.
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
void add_stored_object(pstatic_stored_object_key k, pstatic_stored_object o, permanence perm)
Add an object with two optional dependencies.
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
short_type nb_points() const
Number of vertices.
virtual void poly_vector_hess(const base_node &, bgeot::base_matrix &) const
Gives the hessian of the functions vector at a certain point.
virtual void poly_vector_grad(const base_node &, bgeot::base_matrix &) const
Gives the gradient of the functions vector at a certain point.
Base class for reference convexes.
gmm::uint16_type short_type
used as the common short type integer in the library
virtual void poly_vector_val(const base_node &, bgeot::base_vector &) const
Gives the value of the functions vector at a certain point.
dim_type dim() const
Dimension of the convex.
An adaptor that adapts a two dimensional geometric_trans to include radial dimension.
torus_structure which extends a 2 dimensional structure with a radial dimension
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation