On Fri, Nov 15, 2013 at 10:12 AM, Roy Stogner <roystgnr@ices.utexas.edu> wrote:

On Fri, 15 Nov 2013, John Peterson wrote:

All I'm proposing at the moment is to try and make sure that various parts of the library are working OK with _nodes and
_elements vectors that have NULLs in them.  

That shouldn't be too much trouble.  We have a lot of things in the
library that are already prepared for the "he just deleted an element
but hasn't renumbered yet" case; the parallel communication stuff
probably just slipped under the radar since it was only getting called
for ParallelMesh or right after generation of a contiguous numbering.

Yeah, it was pretty simple... I just pushed the "insert_node" branch that seems to fix my test code.

I need to test it a bit more before merging with master, and I'll probably ultimately change the name of the function I added given your comments below.

By the way, ParallelMesh currently has an "insert_node()" interface (Oct. 2007) but it seems a little unsafe?  If n->id() ==
invalid_id it will still add the Node... I only bring it up since I was going to add a MeshBase::insert_node() interface and
came across this in the process.

Hmm... that looks like an anachronism from the original ParallelMesh
design.  It's never even used inside library code any more.  I suppose
you could assert(valid_id()) but I'd be okay with just outright
deleting the method.

OK, I'll delete ParallelMesh::insert_node() it in a subsequent patch on this branch.