Dear Professor Renard,
I found the solution. Trivially, I was printing the wrong number with
<< mymesh.region(1000).index().size()
In fact "index()" returns a dal::bit_vector whose size does not change with
"sup(cv)"!
If I count the number of non-null values within mymesh.region(1000).index(), it
decreases as expected!
Thank you,
Domenico
________________________________
Da: Yves Renard <[email protected]>
Inviato: martedì 12 gennaio 2016 10.10
A: Domenico Notaro; getfem-users
Oggetto: Re: [Getfem-users] Problem with mesh_region's method sup(ic)
Dear Domenico,
A priori, It should work. Can you try with
mymesh.region(1000).sup_all(cv);
instead ? Does it change something ?
Can you send a compilable program that we can test ?
Yves.
Le 10/01/2016 18:35, Domenico Notaro a écrit :
Dear Users,
I tried to use the method sup(ic) to remove some convexes from a mesh region
but it seems to do nothing. Maybe I am missing something...
Would you kindly have a look to the following very simple code?
// Add all convex to the region
for (dal::bv_visitor cv(mymesh.convex_index()); !cv.finished(); ++cv)
mymesh.region(1000).add(cv);
cout << "Region 1000 contains "
<< mymesh.region(1000).index().size()
<< " convexes" << endl;
bgeot::base_node point(0.0, 0.5, 0.5);
for (size_type j=0; j<length; ++j){
// Find the global idx of point
size_type pidx = 0;
bool found = false;
while (pidx < mymesh.points().size() && !found){
if (fabs(mymesh.points()[pidx][0] - point[0]) < 1E-6 &&
fabs(mymesh.points()[pidx][1] - point[1]) < 1E-6 &&
fabs(mymesh.points()[pidx][2] - point[2]) < 1E-6)
found = true;
else
pidx++;
}
GMM_ASSERT1(pidx < mymesh.points().size(),
"error: point not found");
// Remove all convexes to the point
for (auto cv : mymesh.convex_to_point(pidx))
mymesh.region(1000).sup(cv); // ? //
// Update the point
point[0] += 1.0/length;
}
cout << "Region 1000 contains "
<< mymesh.region(1000).index().size()
<< " convexes" << endl;
The aim is to build a region with a hole from (0.0,0.5,0.5) to (1.0,0.5,0.5).
Unexpectedly, the number of convexes within the region after the manipulation
does not change.
Thank you,
Domenico
_______________________________________________
Getfem-users mailing list
[email protected]<mailto:[email protected]>
https://mail.gna.org/listinfo/getfem-users
--
Yves Renard ([email protected]<mailto:[email protected]>)
tel : (33) 04.72.43.87.08
Pole de Mathematiques, INSA-Lyon fax : (33) 04.72.43.85.29
20, rue Albert Einstein
69621 Villeurbanne Cedex, FRANCE
http://math.univ-lyon1.fr/~renard
---------
_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users