[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] SOLVED: Problem with mesh_region's method sup(ic)

From: Domenico Notaro
Subject: Re: [Getfem-users] SOLVED: Problem with mesh_region's method sup(ic)
Date: Wed, 13 Jan 2016 14:37:13 +0000

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,


Da: Yves Renard <address@hidden>
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
instead ? Does it change something ?

Can you send a compilable program that we can test ?


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)
    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;
        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,


Getfem-users mailing list


  Yves Renard (address@hidden)       tel : (33)
  Pole de Mathematiques, INSA-Lyon             fax : (33)
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE


reply via email to

[Prev in Thread] Current Thread [Next in Thread]