Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Looping through particles that make up the vertices of the Delaunay triangulation and updating their positions

Subject: CGAL users discussion list

List archive

[cgal-discuss] Looping through particles that make up the vertices of the Delaunay triangulation and updating their positions


Chronological Thread 
  • From: "Julien T." <>
  • To:
  • Subject: [cgal-discuss] Looping through particles that make up the vertices of the Delaunay triangulation and updating their positions
  • Date: Fri, 10 Apr 2020 08:56:59 -0500 (CDT)
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Neutral ; spf=Pass
  • Ironport-phdr: 9a23:zQXqpRGT7HbIcChaiAQy0p1GYnF86YWxBRYc798ds5kLTJ7zos+wAkXT6L1XgUPTWs2DsrQY0reQ6fqrBz1Ioc7Y9ixbLNoUD15NoP5VtjJjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9fbytScbdgMutyu+95YDYbRlWizqhe7NyKwi9oRnMusUMjoZuN6Y8xgHXrndWdOhbxGdlLk+Xkxrg+8u85pFu/zlftv4768JMTaD2dLkkQLJFCzgrL2866Mr3uBfZUACB/GEcUmIYkhpJBwjK8hT3VYrvvyX5q+RwxjCUMdX5Qr4oVzui6bxrSALzhyccKzE56mDXhddug69dvRmsugZww4/QYIGSKfp+YqbQds4USGZdQspcUTFKD4WhZIUNEuUBJ/5VoYf9qVUQrhWwGAajC//gxDJTmn/737E23/g9HQ3awgAtGc8FvnTOrNXyMacfSe65wq3VzTXHbvNZxzH945XWfBw7r/2HQLV9f87MyUkrFgPKkFOQpZb5PzyP1+QNt2yb4PR9VeK1kGMntgdxojmxxss1konGnJgVylHf9Slg3Yk1JMC3R1BhYd6jDJtcrS+aN5FvT84kXmpmtiE6yrgctp66eigH0JInyATEZPOcd4iH/AjvW/qWITd9gn9uZbGxhw6q/ES9zuDxUtO43VhJoyZfkdTBt2oB2h3S58WBV/Bz5F2u2SyV2ADW8uxEIV47la7cK5M5xL49mYAfsULZESDtg0r2iLGZel849eiv7uTrerTmppmCOI9okgzyL6Ajl8ilDek2MQUCRWuW9OWm2LDi/ED1WLBKgec3kqndvpDaP8MbpquhDgFRz4Yj7xe/ACmg0NgCgXkINlNFeBaDj4f3JlHOOuv1Deq5g1Stjjdn3ujGMaf7ApXMNXjPiarufbdg5EFC0gozysxf64haCrEbOP7zQFP+tMTEDh8lNAy52/roCNpn2YMaQG6AH66ZMLjOvl+V/eIvOPKBZJQVuTb4M/gq/eTijX4/mV8HfKmmx4EbaH6iHqcuH0LManXlhpINEHwBoxElZO3sklyLFzBJNFioWKdprBMmDIOrC8//AMrl1J6c2Ca2GNtKb2FCDl2RC1/1cYSaHu8FciOJZ8NgnjEeUqTnRZV3hkLmjxPz17cydrmcwSYfr5+2jIEktd2Wrgk78HlPN+rY1miMS29umWZSHG0r2qFh5FR00FaYlKR5j/FCEsAV6ekbCF5nZ66Z9PRzDpXJYiyEftqNTw/7ENP6Rzc4RNg1zpkFZEMvQoz+3CCG5DKjBvour5LOHIY9qPmOwn7wOYNlwmzHz+wtjlUrWMxTc2O81PZy

Dear all,

I am writing a code in which particles moves in 2D (with periodic boundary
conditions) and (will, later) interact with their neighbors in a Delaunay
triangulation. I thus need to move all my particles at every time step and
to update the corresponding Delaunay graph efficiently. Each particle thus
corresponds to one vertex of the triangulation.

At every time step, I need to loop through the particles. I thus tried to
use a loop over the vertices, move the corresponding particle, and then
update the triangulation. A simple loop would look like that:

for(Vertex_iterator it = T1.vertices_begin(); it != T1.vertices_end();
++it){

// New position
double New_x = it->point().x()+2.3;
double New_y = it->point().y()+2.3;

Point New_point = Point(New_x, New_y);
T1.move_point(it, New_point);
}

(T1 is the already defined triangulation). However, because moving the point
changes the order of the triangulation, I am not looping through all
vertices, and sometimes ends up going twice through the same vertex (which
has moved) and not through other particles/vertices.

My question is thus: Is there a way to access directly the vertices so that
I would loop through all vertices/particles exactly once ? I have added
labels to my vertices using info() :

for(int i=0;i<N;i++){
vh = T1.insert(Point((i%Nx)*d, (i/Nx)*d));
vh->info()=i;
}

But then I do not know how to loop (efficiently!) over the values "i" and
the corresponding vertices.

Thanks for your help !

Best,

Julien




--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page