Subject: CGAL users discussion list
List archive
- From: Roya Rahmati <>
- To:
- Subject: [cgal-discuss] multiple copy of neighbors in periodic 2d triangulation
- Date: Thu, 2 May 2019 20:42:10 +0430
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:6JobJBzz3QsvhsDXCy+O+j09IxM/srCxBDY+r6Qd1OsWIJqq85mqBkHD//Il1AaPAdyCrawVwLuJ+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxhViDanYL5/KBq6oAHTu8ILnYZsN6E9xwfTrHBVYepW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH0169bwtRbfVwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXzmp8qFmQwLqhigaLT406G7YhMx+gqxYvRyvuQBwzpXOb42JLvdzZL/Rcc8YSGdHQ81fVzZBAoS5b4YXE+QBOuZZoJPgrFUStxS+BQysC/nzyj9Jm3T72rc63P4hEQHDxgMgA9MOvG7OrNT1L6oSXuW1w7PJzTXHdf9ZxTD96I3Rfx0nvPqCXqpwfNLPxUUzEw7JlFadpIz/Mz+LyOgBrnKX4uVvWO+plmUpsRt+oiK1yccpkoTJhpwaylTD9ShhxYY6P9y4SEpibd+qCptcqjiWN4V5T84tWW1otyE6yroJuZ6/YicG0ogoxxnaa/CfcoiI5AzsVPqJLDtmmH5ofKizihWy/ES61OHwSNS43ExFoydKitXMs2oC1x3X6siJUPt9+UKh1C6V1w/J6uFEJFo7lbbaK5I72L4xloEesUvGHiDsmUX2iLWaeVkj+uit8+jneKnppoeAN49ojQHzKrghmsOlDuQ8KwQBQmmb+f+g273+5k35W65HjuY2k6ncqJDVP94Xpq+/Aw9P04Ys8QyzDzm80IdQoX5SJ11MfFeLjpPiJkrVCPH+F/a2xVq2wxlxwPWTBLrwC933J3jGmavgNeJn4k5ZwRYyi8pOz51RA7AFZvn0Xxmi55TjEhYlPlnskK7cA9Jn29ZGADPdMuqiKKrX9GSwyKcqKuiIapUSvW+kefcg7v/qy3Q+nA1EJPT77d4scHm9W89eDQCZbH7r2IpTFG4Luk8hVrWvhgHeFzFUYHm2UuQ34TRpUNv6X7eGfZikhfm65An+BodfPzkUBVWFEHOufIKBCa8B
Hello,
I am using periodic Delaunay triangulation in my code, and producing for each vertex all neighboring vertices. For this I use Edge iterator, since in my case it will be much more faster than Vertex iterator.
But, in some of my simulations, especially for particle numbers<1000 instead of one special neighbor for each vertex I get 8 or 9 or ... copy of the same neighbor. For example I get something like this for the vertex 0: Nei[0]=[2,2,2,2,2,2,2,2,4,4,4,...]
I couldn't find an example using edge iterator in CGAL website, and nothing related in stackoverflow. I am wondering whether this implementation is correct? What should I add to my code in order to get one copy per each neighbor, I can use STL::set, but I would like to know the source of problem.
A possible work around would be to replicate main simulation box, and use non-periodic version.
here is the code snippet:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Periodic_2_triangulation_traits_2<Kernel> Gt;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned int, Gt> Vb;
typedef CGAL::Periodic_2_triangulation_face_base_2<Gt> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Periodic_2_Delaunay_triangulation_2<Gt, Tds> Triangulation;
typedef Triangulation::Iso_rectangle Iso_rectangle;
typedef Triangulation::Edge_iterator Edge_iterator;
typedef Triangulation::Vertex_handle Vertex_handle;
typedef Triangulation::Point Point;
typedef vector<pair<Point, unsigned> > Vector_Paired;
Vector_Paired points;
Iso_rectangle domain(0,0,L,L);
for(int iat = 0; iat < N; iat++)
{
points.push_back(make_pair(Point(r_tot[iat][0],r_tot[iat][1]),iat));
}
Triangulation T(points.begin(), points.end(), domain);
for(Edge_iterator ei=T.finite_edges_begin(); ei!=T.finite_edges_end(); ei++)
{
Triangulation::Face& f = *(ei->first);
int ii = ei->second;
Vertex_handle vi = f.vertex(f.cw(ii));
Vertex_handle vj = f.vertex(f.ccw(ii));
int iat = vi->info();
int jat = vj->info();
VecInd[iat].push_back(jat);
VecInd[jat].push_back(iat);
}
- [cgal-discuss] multiple copy of neighbors in periodic 2d triangulation, Roya Rahmati, 05/02/2019
Archive powered by MHonArc 2.6.18.