Skip to content

Commit 05e250f

Browse files
authored
Merge pull request #4327 from jwpeterson/drop_deprecated_mesh_insert_node
Drop deprecated MeshBase::insert_node() API
2 parents 001b6e1 + b3e635c commit 05e250f

5 files changed

Lines changed: 0 additions & 123 deletions

File tree

include/mesh/distributed_mesh.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,6 @@ class DistributedMesh : public UnstructuredMesh
312312
virtual Node * add_node (Node * n) override final;
313313
virtual Node * add_node (std::unique_ptr<Node> n) override final;
314314

315-
#ifdef LIBMESH_ENABLE_DEPRECATED
316-
/**
317-
* These methods are deprecated. Please use \p add_node instead
318-
* Calls add_node().
319-
*/
320-
virtual Node * insert_node(Node * n) override final;
321-
virtual Node * insert_node(std::unique_ptr<Node> n) override final;
322-
#endif
323-
324315
/**
325316
* Takes ownership of node \p n on this partition of a distributed
326317
* mesh, by setting n.processor_id() to this->processor_id(), as

include/mesh/mesh_base.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -716,26 +716,6 @@ class MeshBase : public ParallelObject
716716
*/
717717
virtual Node * add_node (std::unique_ptr<Node> n) = 0;
718718

719-
#ifdef LIBMESH_ENABLE_DEPRECATED
720-
/**
721-
* This method is deprecated. Please use \p add_node instead
722-
* Insert \p Node \p n into the Mesh at a location consistent with
723-
* n->id(), allocating extra storage if necessary. Will error
724-
* rather than overwriting an existing Node. Only use if you know what
725-
* you are doing...
726-
*/
727-
virtual Node * insert_node(Node * n) = 0;
728-
729-
/**
730-
* This method is deprecated. Please use \p add_node instead
731-
* Version of insert_node() taking a std::unique_ptr by value. This API is
732-
* intended to indicate that ownership of the Node is transferred to the Mesh
733-
* when this function is called, and it should play more nicely with the
734-
* Node::build() API which has always returned a std::unique_ptr.
735-
*/
736-
virtual Node * insert_node(std::unique_ptr<Node> n) = 0;
737-
#endif
738-
739719
/**
740720
* Removes the Node n from the mesh.
741721
*/

include/mesh/replicated_mesh.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,24 +191,6 @@ class ReplicatedMesh : public UnstructuredMesh
191191
const processor_id_type proc_id = DofObject::invalid_processor_id) override final;
192192
virtual Node * add_node (Node * n) override final;
193193
virtual Node * add_node (std::unique_ptr<Node> n) override final;
194-
195-
#ifdef LIBMESH_ENABLE_DEPRECATED
196-
/**
197-
* These methods are deprecated. Please use \p add_node instead
198-
* Insert \p Node \p n into the Mesh at a location consistent with
199-
* n->id(), allocating extra storage if necessary. Throws an error if:
200-
* .) n==nullptr
201-
* .) n->id() == DofObject::invalid_id
202-
* .) A node already exists in position n->id().
203-
*
204-
* This function differs from the ReplicatedMesh::add_node() function,
205-
* which is only capable of appending nodes at the end of the nodes
206-
* storage.
207-
*/
208-
virtual Node * insert_node(Node * n) override final;
209-
virtual Node * insert_node(std::unique_ptr<Node> n) override final;
210-
#endif
211-
212194
virtual void delete_node (Node * n) override final;
213195
virtual void renumber_node (dof_id_type old_id, dof_id_type new_id) override final;
214196
virtual Elem * add_elem (Elem * e) override final;

src/mesh/distributed_mesh.C

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -912,22 +912,6 @@ Node * DistributedMesh::add_node (std::unique_ptr<Node> n)
912912
return add_node(n.release());
913913
}
914914

915-
#ifdef LIBMESH_ENABLE_DEPRECATED
916-
917-
Node * DistributedMesh::insert_node(Node * n)
918-
{
919-
libmesh_deprecated();
920-
return DistributedMesh::add_node(n);
921-
}
922-
923-
Node * DistributedMesh::insert_node(std::unique_ptr<Node> n)
924-
{
925-
libmesh_deprecated();
926-
return insert_node(n.release());
927-
}
928-
929-
#endif
930-
931915
void DistributedMesh::delete_node(Node * n)
932916
{
933917
libmesh_assert(n);

src/mesh/replicated_mesh.C

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -544,66 +544,6 @@ Node * ReplicatedMesh::add_node (std::unique_ptr<Node> n)
544544
return add_node(n.release());
545545
}
546546

547-
#ifdef LIBMESH_ENABLE_DEPRECATED
548-
549-
Node * ReplicatedMesh::insert_node(Node * n)
550-
{
551-
libmesh_deprecated();
552-
libmesh_error_msg_if(!n, "Error, attempting to insert nullptr node.");
553-
libmesh_error_msg_if(n->id() == DofObject::invalid_id, "Error, cannot insert node with invalid id.");
554-
555-
if (n->id() < _nodes.size())
556-
{
557-
// Trying to add an existing node is a no-op. This lets us use
558-
// a straightforward MeshCommunication::allgather() to fix a
559-
// not-actually-replicated-yet ReplicatedMesh, as occurs when
560-
// reading Nemesis files.
561-
if (n->valid_id() && _nodes[n->id()] == n)
562-
return n;
563-
564-
// Don't allow anything else to replace an existing Node.
565-
libmesh_error_msg_if(_nodes[ n->id() ] != nullptr,
566-
"Error, cannot insert new node on top of existing node.");
567-
}
568-
else
569-
{
570-
// Allocate just enough space to store the new node. This will
571-
// cause highly non-ideal memory allocation behavior if called
572-
// repeatedly...
573-
_nodes.resize(n->id() + 1);
574-
}
575-
576-
#ifdef LIBMESH_ENABLE_UNIQUE_ID
577-
if (!n->valid_unique_id())
578-
n->set_unique_id(_next_unique_id++);
579-
else
580-
_next_unique_id = std::max(_next_unique_id, n->unique_id()+1);
581-
#endif
582-
583-
n->add_extra_integers(_node_integer_names.size(),
584-
_node_integer_default_values);
585-
586-
// We have enough space and this spot isn't already occupied by
587-
// another node, so go ahead and add it.
588-
++_n_nodes;
589-
_nodes[ n->id() ] = n;
590-
591-
// If we made it this far, we just inserted the node the user handed
592-
// us, so we can give it right back.
593-
return n;
594-
}
595-
596-
Node * ReplicatedMesh::insert_node(std::unique_ptr<Node> n)
597-
{
598-
libmesh_deprecated();
599-
// The mesh now takes ownership of the Node. Eventually the guts of
600-
// insert_node(Node*) will get moved to a private helper function, and
601-
// calling insert_node(Node*) directly will be deprecated.
602-
return insert_node(n.release());
603-
}
604-
605-
#endif
606-
607547
void ReplicatedMesh::delete_node(Node * n)
608548
{
609549
libmesh_assert(n);

0 commit comments

Comments
 (0)