void globally_renumber_nodes_and_elements (MeshBase &)
void fix_broken_node_and_element_numbering (SerialMesh &)
void fix_broken_node_and_element_numbering (ParallelMesh &)
This function restores a previously broken element/node numbering such that mesh.node(n)->id() == n.
Definition at line 1008 of file mesh_tools.C.
References SerialMesh::_elements, and SerialMesh::_nodes.
Referenced by EquationSystems::_read_impl(), and EquationSystems::write().
{
// Nodes first
for (unsigned int n=0; n<mesh._nodes.size(); n++)
if (mesh._nodes[n] != NULL)
mesh._nodes[n]->set_id() = n;
// Elements next
for (unsigned int e=0; e<mesh._elements.size(); e++)
if (mesh._elements[e] != NULL)
mesh._elements[e]->set_id() = e;
}
This function restores a previously broken element/node numbering such that mesh.node(n)->id() == n.
Definition at line 1023 of file mesh_tools.C.
References ParallelMesh::_elements, ParallelMesh::_nodes, mapvector< Val >::begin(), and mapvector< Val >::end().
{
// We need access to iterators for the underlying containers,
// not the mapvector<> reimplementations.
mapvector<Node*>::maptype &nodes = mesh._nodes;
mapvector<Elem*>::maptype &elem = mesh._elements;
// Nodes first
{
mapvector<Node*>::maptype::iterator
it = nodes.begin(),
end = nodes.end();
for (; it != end; ++it)
if (it->second != NULL)
it->second->set_id() = it->first;
}
// Elements next
{
mapvector<Elem*>::maptype::iterator
it = elem.begin(),
end = elem.end();
for (; it != end; ++it)
if (it->second != NULL)
it->second->set_id() = it->first;
}
}
This function determines partition-agnostic global indices for all nodes and elements in the mesh. Note that after this function is called the mesh will likely be in an inconsistent state, i.e. mesh.nodes(i)->id() != i in the nodes container. Direct node/element access via the mesh.node(n) or mesh.elem(e) functions will likely fail. The original numbering can (and should) be restored with a subsequent call to fix_node_and_element_numbering().
Definition at line 1001 of file mesh_tools.C.
References MeshCommunication::assign_global_indices().
Referenced by EquationSystems::_read_impl(), and EquationSystems::write().
{
MeshCommunication().assign_global_indices(mesh);
}
Generated automatically by Doxygen for libMesh from the source code.