← Back to team overview

dolfin team mailing list archive

More comments on PXMLMesh.cpp

 

I'm slowly working my way through PXMLMesh.cpp and I need some
assistance (from Niclas).

It all looks very good and I'm sure it works perfectly, but some work
is needed to make it possible to read/understand:

1. PXMLMesh::closeMesh really needs some commenting. It's a large
chunk of nontrivial and quite complex code so a whole lot of
commenting is needed.

2. Why is the mesh editor closed in PXMLMesh::readCells and then
opened again later in PXMLMesh::closeMesh?

If we can't write to the mesh until everything is read in, then maybe
we should wait with initializing anything until closeMesh() and at
that point start editing the mesh?

3. I don't understand the logic in readTriangle/readTetrahedron.
What does the following code do?

  if (!(is_local(v2) || is_local(v1) || is_local(v0)) || !is_local(v0))
    return;

  used_vertex.insert(v0);
  if (is_local(v1))
    used_vertex.insert(v1);
  if (is_local(v2))
    used_vertex.insert(v2); 

  if (!(is_local(v1) && is_local(v2) && is_local(v0)))
  {
    if (!is_local(v1))
      shared_vertex.insert(v1);
    if (!is_local(v2))
      shared_vertex.insert(v2);
  }

I've added the function is_local to make it more readable but it's
still not clear to me what happens.

4. The above logic seems to be missing in readInterval.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups