Subject: CGAL users discussion list
List archive
- From: Stephane Tayeb <>
- To:
- Subject: Re: [cgal-discuss] Re: Neighbours list in 3D meshing
- Date: Thu, 29 Apr 2010 17:39:29 +0200
Ianic wrote:
I've edited the File_medit.h file to add a "Neighbours" section, like so:
os << "Neighbours" << std::endl
<< c3t3.number_of_cells() << std::endl;
for( Cell_iterator cit = c3t3.cells_begin() ;
cit != c3t3.cells_end() ;
++cit )
{
const Cell_handle& c = cit;
for ( int i=0 ; i<4 ; ++i ) {
const Cell_handle& neighbor = c->neighbor(i);
if ( c3t3.is_in_complex(neighbor) )
os << C[neighbor] << " ";
else
os << -1 << " ";
}
os << std::endl;
}
Here C is std::map<Cell_handle, int> to keep track of cell numbers. The
point of doubt that I have is whether my detection of boundary elements is
correct. What exactly does c3t3.is_in_complex() check for? My naive
understanding right now is that if a neighbour is outside a complex, it
means that the element I look from (const Cell_handle& c) lies on a boundary
and therefore some of its neighbours do not belong to a mesh. Am I right
here?
From the documentation: (http://www.cgal.org/Manual/last/doc_html/cgal_manual/Mesh_3_ref/Concept_MeshComplex_3InTriangulation_3.html#Cross_link_anchor_1476)
bool c3t3.is_in_complex(Cell_handle c) "Returns true iff the cell c belongs to the 3D complex.".
It means that it checks whether a tetrahedron belongs to the mesh (= the discretization of your input domain) or not.
In your case, if c->neighbor(i) does not belongs to the mesh (c does), there is a boundary facet between c and c->neighbor(i). So I think you are right :).
Best,
Stéphane.
--
Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team
- [cgal-discuss] Neighbours list in 3D meshing, Ianic, 04/29/2010
- Re: [cgal-discuss] Neighbours list in 3D meshing, Stephane Tayeb, 04/29/2010
- Re: [cgal-discuss] Neighbours list in 3D meshing, Mariette Yvinec, 04/29/2010
- [cgal-discuss] Re: Neighbours list in 3D meshing, Ianic, 04/29/2010
- [cgal-discuss] Re: Neighbours list in 3D meshing, Ianic, 04/29/2010
- [cgal-discuss] Re: Neighbours list in 3D meshing, Ianic, 04/29/2010
- Re: [cgal-discuss] Re: Neighbours list in 3D meshing, Stephane Tayeb, 04/29/2010
- [cgal-discuss] Re: Neighbours list in 3D meshing, Ianic, 04/29/2010
- Re: [cgal-discuss] Re: Neighbours list in 3D meshing, Stephane Tayeb, 04/29/2010
- [cgal-discuss] Re: Neighbours list in 3D meshing, Ianic, 04/29/2010
- [cgal-discuss] Re: Neighbours list in 3D meshing, Ianic, 04/29/2010
- Re: [cgal-discuss] Neighbours list in 3D meshing, Stephane Tayeb, 04/29/2010
Archive powered by MHonArc 2.6.16.