[Insight-developers] Proposed Mesh changes.

Mark Foskey mark_foskey at unc . edu
Fri, 06 Jun 2003 14:47:47 -0400


I would like to make some changes to the mesh class that should make
it easier to use without sacrificing its flexibility.

1. I would like to eliminate the separate boundaries container.  As I
understand it, the goal was that, say, two adjacent tetrahedra could
be marked as having faces that touch, rather than sharing a face.  The
same geometric triangle appears twice in the data structure, once as
a face of one tetrahedron, and once as a face of the other.

The problem is that each of those faces is also, mathematically
speaking, a cell.  If you also include it in the cells list, you
probably should include it twice, since the two boundaries really are
different cells in the abstract.  So now you have the same data four
times, and there's no way, given one of the face cells, to figure out
which boundary cell corresponds to it.

Instead, I want to eliminate m_BoundariesContainers and
m_BoundaryDataContainers.  m_BoundaryAssignmentsContainers would link
a given cell to the other cells that constitute its boundary, and
GetBoundaryAssignment() would return a cell identifier, not a boundary
identifier (since there would no longer be a separate concept of
boundary identifiers.

You could still include the same geometric triangle as two different
cells, so you don't sacrifice the ability to have neighboring
tetrahedra not share a face.

2. There is no const version of GetCells() and
GetBoundaryAssignments().  The reason is that these create an empty
container if one doesn't exist, thus modifying the class.  It may be
possible to use the "mutable" keyword to get around this, but I doubt
the added complexity is worth it.  I think it would be better to
create the empty containers upon construction; empty containers
generally aren't that big.  Then we could make constant versions of
those two methods, which will help people who want to write const
correct code.

3. I would like to rename GetCellBoundaryFeatureNeighbors() to
GetCellFeatureNeighbors(), so that, for instance, if E is an edge
identifier, I can call

   GetCellFeatureNeighbors(1, E, 0, cellSet);

to get a set of all the faces that have E as an edge.

I think all of these changes will make the mesh easier to work with.
Are there any objections?  I have discussed this with Will, and he
generally agreed that these ideas seemed to make sense.

-- 
Mark Foskey    (919) 843-5436  Computer-Aided Diagnosis and Display Lab
mark_foskey at unc . edu            Department of Radiology, CB 7515, UNC
http://www . cs . unc . edu/~foskey  Chapel Hill, NC  27599-7515