Namespaces | |
Generation | |
Modification | |
Private | |
Subdivision | |
Support functions for subdivision surface elements. | |
Classes | |
class | BoundingBox |
Utility functions for operations on a Mesh
object. Here is where useful functions for interfacing with a Mesh
should be defined. In general this namespace should be used to prevent the Mesh
class from becoming too cluttered.
MeshTools::BoundingBox libMesh::MeshTools::bounding_box | ( | const MeshBase & | mesh | ) |
Definition at line 373 of file mesh_tools.C.
References create_bounding_box(), and mesh.
Referenced by libMesh::TreeNode< N >::bounds_point(), libMesh::TreeNode< N >::create_bounding_box(), libMesh::TreeNode< N >::insert(), and libMesh::TreeNode< N >::set_bounding_box().
mesh
instead of a bounding box. Definition at line 438 of file mesh_tools.C.
References create_bounding_box(), mesh, and libMesh::Real.
void libMesh::MeshTools::build_nodes_to_elem_map | ( | const MeshBase & | mesh, |
std::vector< std::vector< dof_id_type >> & | nodes_to_elem_map | ||
) |
After calling this function the input vector nodes_to_elem_map
will contain the node to element connectivity. That is to say nodes_to_elem_map
[i][j] is the global number of element connected to node i
.
Definition at line 245 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), mesh, libMesh::MeshBase::n_elem(), and libMesh::MeshBase::n_nodes().
Referenced by libMesh::MeshTools::Subdivision::prepare_subdivision_mesh(), libMesh::VariationalMeshSmoother::readgr(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), and libMesh::Tree< N >::Tree().
void libMesh::MeshTools::build_nodes_to_elem_map | ( | const MeshBase & | mesh, |
std::vector< std::vector< const Elem *>> & | nodes_to_elem_map | ||
) |
The same, except element pointers are returned instead of indices.
Definition at line 262 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), mesh, and libMesh::MeshBase::n_nodes().
void libMesh::MeshTools::build_nodes_to_elem_map | ( | const MeshBase & | mesh, |
std::unordered_map< dof_id_type, std::vector< dof_id_type >> & | nodes_to_elem_map | ||
) |
After calling this function the input map nodes_to_elem_map
will contain the node to element connectivity. That is to say nodes_to_elem_map
[i][j] is the global number of element connected to node i
.
Definition at line 278 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), and mesh.
void libMesh::MeshTools::build_nodes_to_elem_map | ( | const MeshBase & | mesh, |
std::unordered_map< dof_id_type, std::vector< const Elem *>> & | nodes_to_elem_map | ||
) |
The same, except element pointers are returned instead of indices.
Definition at line 290 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), and mesh.
void libMesh::MeshTools::correct_node_proc_ids | ( | MeshBase & | mesh | ) |
Changes the processor ids on each node so be the same as the id of the lowest element touching that node.
This corrects "orphaned" processor ids that may occur from element coarsening.
On a distributed mesh, this function must be called in parallel to sync everyone's corrected processor ids on ghost nodes.
Definition at line 2259 of file mesh_tools.C.
References libMesh::MeshBase::active_element_ptr_range(), libMesh::Node::choose_processor_id(), libMesh::ParallelObject::comm(), data, libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshBase::local_node_ptr_range(), mesh, n_elem(), new_proc_ids, libMesh::MeshBase::node_ptr_range(), libMesh::MeshBase::node_ref(), libMesh::MeshBase::nodes_begin(), libMesh::MeshBase::nodes_end(), libMesh::ParallelObject::processor_id(), libMesh::Parallel::push_parallel_vector_data(), libMesh::MeshBase::skip_partitioning(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::MeshBase::unpartitioned_elements_begin(), libMesh::MeshBase::unpartitioned_elements_end(), and libMesh::Parallel::wait().
Referenced by libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), and libMesh::MeshBase::partition().
libMesh::BoundingBox libMesh::MeshTools::create_bounding_box | ( | const MeshBase & | mesh | ) |
The same functionality as the deprecated MeshTools::bounding_box().
Definition at line 386 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), create_local_bounding_box(), libMesh::DofObject::invalid_processor_id, libMesh::Parallel::Communicator::max(), mesh, libMesh::Parallel::Communicator::min(), libMesh::Threads::parallel_reduce(), libMesh::MeshBase::pid_elements_begin(), and libMesh::MeshBase::pid_elements_end().
Referenced by libMesh::Partitioner::_find_global_index_by_pid_map(), bounding_box(), bounding_sphere(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::PointLocatorTree::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::MetisPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::TreeNode< N >::refine(), libMesh::Tree< N >::Tree(), and libMesh::PostscriptIO::write().
libMesh::BoundingBox libMesh::MeshTools::create_local_bounding_box | ( | const MeshBase & | mesh | ) |
Unlike the other bounding box creation functions, this does not need to be run in parallel, because this is the only function we can guarantee can be resolved with only local information.
Definition at line 451 of file mesh_tools.C.
References libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), mesh, and libMesh::Threads::parallel_reduce().
Referenced by create_bounding_box().
libMesh::BoundingBox libMesh::MeshTools::create_nodal_bounding_box | ( | const MeshBase & | mesh | ) |
In the case of curved elements, this box might not bound the elements of the mesh.
Definition at line 411 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::DofObject::invalid_processor_id, libMesh::MeshBase::local_nodes_begin(), libMesh::MeshBase::local_nodes_end(), libMesh::Parallel::Communicator::max(), mesh, libMesh::Parallel::Communicator::min(), libMesh::Threads::parallel_reduce(), libMesh::MeshBase::pid_nodes_begin(), and libMesh::MeshBase::pid_nodes_end().
Referenced by libMesh::MeshCommunication::assign_global_indices(), and libMesh::MeshCommunication::check_for_duplicate_global_indices().
libMesh::BoundingBox libMesh::MeshTools::create_processor_bounding_box | ( | const MeshBase & | mesh, |
const processor_id_type | pid | ||
) |
The same functionality as the deprecated MeshTools::processor_bounding_box().
Definition at line 477 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::max(), mesh, libMesh::Parallel::Communicator::min(), libMesh::ParallelObject::n_processors(), libMesh::Threads::parallel_reduce(), libMesh::MeshBase::pid_elements_begin(), libMesh::MeshBase::pid_elements_end(), and libMesh::Parallel::Communicator::verify().
Referenced by processor_bounding_box(), and processor_bounding_sphere().
libMesh::BoundingBox libMesh::MeshTools::create_subdomain_bounding_box | ( | const MeshBase & | mesh, |
const subdomain_id_type | sid | ||
) |
The same functionality as the deprecated MeshTools::subdomain_bounding_box().
Definition at line 529 of file mesh_tools.C.
References libMesh::MeshBase::active_local_subdomain_elements_begin(), libMesh::MeshBase::active_local_subdomain_elements_end(), libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::max(), mesh, libMesh::Parallel::Communicator::min(), libMesh::Threads::parallel_reduce(), and libMesh::Parallel::Communicator::verify().
Referenced by subdomain_bounding_box(), and subdomain_bounding_sphere().
Fills in a vector of all element types in the mesh. Implemented in terms of element_iterators.
Definition at line 567 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), and mesh.
std::unordered_set< dof_id_type > libMesh::MeshTools::find_block_boundary_nodes | ( | const MeshBase & | mesh | ) |
Returns a std::set containing Node IDs for all of the block boundary nodes
A "block boundary node" is a node that is connected to elemenents from 2 or more blockse
Definition at line 351 of file mesh_tools.C.
References libMesh::MeshBase::active_element_ptr_range(), and mesh.
Referenced by libMesh::LaplaceMeshSmoother::smooth().
void libMesh::MeshTools::find_boundary_nodes | ( | const MeshBase & | mesh, |
std::vector< bool > & | on_boundary | ||
) |
Calling this function on a 2D mesh will convert all the elements to triangles. QUAD4s
will be converted to TRI3s
, QUAD8s
and QUAD9s
will be converted to TRI6s
. Fills the vector "on_boundary" with flags that tell whether each node is on the domain boundary (true)) or not (false).
Definition at line 303 of file mesh_tools.C.
References libMesh::MeshBase::active_element_ptr_range(), libMesh::MeshBase::max_node_id(), mesh, and side.
Referenced by libMesh::MeshTools::Modification::distort(), libMesh::VariationalMeshSmoother::readgr(), libMesh::LaplaceMeshSmoother::smooth(), and libMesh::MeshTools::Modification::smooth().
std::unordered_set< dof_id_type > libMesh::MeshTools::find_boundary_nodes | ( | const MeshBase & | mesh | ) |
Returns a std::set containing Node IDs for all of the boundary nodes
Definition at line 331 of file mesh_tools.C.
References libMesh::MeshBase::active_element_ptr_range(), and mesh.
void libMesh::MeshTools::find_hanging_nodes_and_parents | ( | const MeshBase & | mesh, |
std::map< dof_id_type, std::vector< dof_id_type >> & | hanging_nodes | ||
) |
Given a mesh hanging_nodes will be filled with an associative array keyed off the global id of all the hanging nodes in the mesh. It will hold an array of the parents of the node (meaning the two nodes to either side of it that make up the side the hanging node is on.
Definition at line 1083 of file mesh_tools.C.
References libMesh::MeshBase::active_local_element_ptr_range(), libMesh::Elem::is_node_on_side(), libMesh::Elem::level(), mesh, libMesh::Elem::n_neighbors(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_id(), libMesh::Elem::parent(), libMesh::QUAD4, and libMesh::Elem::which_neighbor_am_i().
Referenced by libMesh::VariationalMeshSmoother::smooth().
void libMesh::MeshTools::find_nodal_neighbors | ( | const MeshBase & | mesh, |
const Node & | n, | ||
const std::vector< std::vector< const Elem *>> & | nodes_to_elem_map, | ||
std::vector< const Node *> & | neighbors | ||
) |
Given a mesh and a node in the mesh, the vector will be filled with every node directly attached to the given one.
Definition at line 740 of file mesh_tools.C.
References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::DofObject::id(), libMesh::invalid_uint, and n_nodes.
Referenced by libMesh::MeshTools::Subdivision::prepare_subdivision_mesh(), libMesh::VariationalMeshSmoother::readgr(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), and libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner().
void libMesh::MeshTools::find_nodal_neighbors | ( | const MeshBase & | mesh, |
const Node & | n, | ||
const std::unordered_map< dof_id_type, std::vector< const Elem *>> & | nodes_to_elem_map, | ||
std::vector< const Node *> & | neighbors | ||
) |
Given a mesh and a node in the mesh, the vector will be filled with every node directly attached to the given one.
Definition at line 906 of file mesh_tools.C.
References libMesh::Elem::active(), libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::DofObject::id(), libMesh::invalid_uint, libMesh::Elem::is_node_on_edge(), libMesh::Elem::local_node(), libMesh::Elem::n_edges(), n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::node_id(), libMesh::Elem::node_ptr(), and libMesh::Elem::type().
void libMesh::MeshTools::get_not_subactive_node_ids | ( | const MeshBase & | mesh, |
std::set< dof_id_type > & | not_subactive_node_ids | ||
) |
Builds a set of node IDs for nodes which belong to non-subactive elements. Non-subactive elements are those which are either active or inactive. This is useful for determining which nodes should be written to a data file, and is used by the XDA mesh writing methods.
Definition at line 691 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), and mesh.
void libMesh::MeshTools::libmesh_assert_canonical_node_procids | ( | const MeshBase & | mesh | ) |
A function for verifying that processor assignment of nodes matches the heuristic specified in Node::choose_processor_id()
Definition at line 1968 of file mesh_tools.C.
References libMesh::MeshBase::active_element_ptr_range(), and mesh.
void libMesh::MeshTools::libmesh_assert_connected_nodes | ( | const MeshBase & | mesh | ) |
A function for verifying that all nodes are connected to at least one element.
This will fail in the most general case. When DistributedMesh and NodeConstraints are enabled, we expect the possibility that a processor will be given remote nodes to satisfy node constraints without also being given the remote elements connected to those nodes.
Definition at line 1376 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), mesh, and libMesh::MeshBase::node_ptr_range().
void libMesh::MeshTools::libmesh_assert_consistent_distributed | ( | const MeshBase & | mesh | ) |
A function for verifying that distribution of dof objects is parallel consistent (every processor can see every node or element it owns)
Definition at line 1671 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::DofObject::invalid_processor_id, libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), libMesh::MeshBase::max_node_id(), mesh, libMesh::Parallel::Communicator::min(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::MeshBase::query_elem_ptr(), and libMesh::MeshBase::query_node_ptr().
void libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes | ( | const MeshBase & | mesh | ) |
A function for verifying that distribution of nodes is parallel consistent (every processor can see every node it owns) even before node ids have been made consistent
Definition at line 1701 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::DofObject::invalid_processor_id, libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), mesh, libMesh::Parallel::Communicator::min(), n_nodes(), libMesh::Elem::n_nodes(), libMesh::Elem::node_ptr(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::MeshBase::query_elem_ptr(), libMesh::Parallel::Communicator::semiverify(), and libMesh::MeshBase::sub_point_locator().
void libMesh::MeshTools::libmesh_assert_contiguous_dof_ids | ( | const MeshBase & | mesh, |
unsigned int | sysnum | ||
) |
A function for verifying that degree of freedom indexes are contiguous on each processors, as is required by libMesh numeric classes.
Verify a particular system by specifying that system's number.
Definition at line 1598 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::local_node_ptr_range(), std::max(), mesh, std::min(), libMesh::ParallelObject::n_processors(), libMesh::MeshBase::node_ptr_range(), and libMesh::ParallelObject::processor_id().
void libMesh::MeshTools::libmesh_assert_equal_n_systems | ( | const MeshBase & | mesh | ) |
A function for testing that all DofObjects within a mesh have the same n_systems count
Definition at line 1173 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), libMesh::invalid_uint, mesh, and libMesh::MeshBase::node_ptr_range().
void libMesh::MeshTools::libmesh_assert_no_links_to_elem | ( | const MeshBase & | mesh, |
const Elem * | bad_elem | ||
) |
A function for verifying that an element has been cut off from the rest of the mesh
Definition at line 1277 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), and mesh.
void libMesh::MeshTools::libmesh_assert_old_dof_objects | ( | const MeshBase & | mesh | ) |
A function for testing that all non-recently-created DofObjects within a mesh have old_dof_object data. This is not expected to be true at all points within a simulation code.
Definition at line 1199 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, and mesh.
void libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids | ( | const MeshBase & | mesh | ) |
A function for verifying that processor assignment is parallel consistent (every processor agrees on the processor id of each node it can see) even on nodes which have not yet recieved consistent DofObject::id(), using element topology to identify matching nodes.
Definition at line 1877 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), mesh, n_nodes(), libMesh::Elem::n_nodes(), libMesh::ParallelObject::n_processors(), libMesh::Elem::node_ptr(), libMesh::DofObject::processor_id(), libMesh::MeshBase::query_elem_ptr(), and libMesh::Parallel::Communicator::semiverify().
Referenced by libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent().
void libMesh::MeshTools::libmesh_assert_parallel_consistent_procids | ( | const MeshBase & | mesh | ) |
A function for verifying that processor assignment is parallel consistent (every processor agrees on the processor id of each dof object it can see)
void libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem > | ( | const MeshBase & | mesh | ) |
Definition at line 1777 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::element_ptr_range(), std::max(), libMesh::Parallel::Communicator::max(), mesh, std::min(), libMesh::Parallel::Communicator::min(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), and libMesh::MeshBase::query_elem_ptr().
void libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node > | ( | const MeshBase & | mesh | ) |
Definition at line 1915 of file mesh_tools.C.
References libMesh::as_range(), libMesh::ParallelObject::comm(), libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), std::max(), libMesh::Parallel::Communicator::max(), mesh, libMesh::ParallelObject::n_processors(), libMesh::MeshBase::node_ptr_range(), libMesh::DofObject::processor_id(), libMesh::MeshBase::query_node_ptr(), and libMesh::Parallel::Communicator::semiverify().
Referenced by correct_node_proc_ids(), and libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent().
void libMesh::MeshTools::libmesh_assert_topology_consistent_procids | ( | const MeshBase & | mesh | ) |
A function for verifying that processor assignment is topologically consistent on nodes (each node part of an active element on its processor) or elements (each parent has the processor id of one of its children).
void libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem > | ( | const MeshBase & | mesh | ) |
Definition at line 1733 of file mesh_tools.C.
References libMesh::Elem::child_ref_range(), libMesh::MeshBase::element_ptr_range(), libMesh::Elem::has_children(), libMesh::libmesh_ignore(), mesh, libMesh::Elem::parent(), libMesh::DofObject::processor_id(), and libMesh::remote_elem.
void libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node > | ( | const MeshBase & | mesh | ) |
Definition at line 1826 of file mesh_tools.C.
References libMesh::as_range(), libMesh::ParallelObject::comm(), libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), libMesh::MeshBase::local_node_ptr_range(), std::max(), libMesh::Parallel::Communicator::max(), mesh, libMesh::ParallelObject::n_processors(), and libMesh::MeshBase::node_ptr_range().
Referenced by libMesh::MeshCommunication::make_node_ids_parallel_consistent().
void libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids | ( | const MeshBase & | mesh | ) |
A function for verifying that ids of elements are correctly sorted for AMR (parents have lower ids than children)
Definition at line 1320 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), libMesh::DofObject::id(), mesh, libMesh::Elem::parent(), and libMesh::DofObject::processor_id().
Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements().
void libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents | ( | const MeshBase & | mesh | ) |
A function for verifying that any interior_parent pointers on elements are consistent with AMR (parents' interior_parents are interior_parents' parents)
Definition at line 1340 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), libMesh::Elem::interior_parent(), libMesh::Elem::level(), mesh, libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::top_parent().
Referenced by libMesh::UnstructuredMesh::find_neighbors().
void libMesh::MeshTools::libmesh_assert_valid_boundary_ids | ( | const MeshBase & | mesh | ) |
A function for verifying that boundary condition ids match across processors.
Definition at line 1401 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::invalid_id, libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), mesh, libMesh::Elem::n_edges(), n_nodes(), libMesh::Elem::n_nodes(), libMesh::ParallelObject::n_processors(), libMesh::Elem::n_sides(), libMesh::Elem::node_ptr(), libMesh::MeshBase::query_elem_ptr(), and libMesh::Parallel::Communicator::semiverify().
Referenced by libMesh::DofMap::create_dof_constraints(), and libMesh::MeshBase::prepare_for_use().
void libMesh::MeshTools::libmesh_assert_valid_dof_ids | ( | const MeshBase & | mesh, |
unsigned int | sysnum = libMesh::invalid_uint |
||
) |
A function for verifying that degree of freedom indexing matches across processors.
Verify a particular system by specifying that system's number, or verify all systems at once by leaving sysnum
unspecified.
Definition at line 1571 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), libMesh::MeshBase::max_node_id(), mesh, libMesh::ParallelObject::n_processors(), libMesh::MeshBase::query_elem_ptr(), and libMesh::MeshBase::query_node_ptr().
Referenced by libMesh::DofMap::distribute_dofs().
void libMesh::MeshTools::libmesh_assert_valid_elem_ids | ( | const MeshBase & | mesh | ) |
A function for verifying that ids and processor assignment of elements are correctly sorted (monotone increasing)
Definition at line 1297 of file mesh_tools.C.
References libMesh::MeshBase::active_element_ptr_range(), and mesh.
Referenced by libMesh::DistributedMesh::renumber_nodes_and_elements().
void libMesh::MeshTools::libmesh_assert_valid_neighbors | ( | const MeshBase & | mesh, |
bool | assert_valid_remote_elems = true |
||
) |
A function for verifying that neighbor connectivity is correct (each element is a neighbor of or descendant of a neighbor of its neighbors) and consistent (each neighbor link goes to either the same neighbor or to a RemoteElem on each processor)
If assert_valid_remote_elems is set to false, then no error will be thrown for neighbor links where a remote_elem should exist but a nullptr exists instead.
Definition at line 2068 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::element_ptr_range(), libMesh::DofObject::id(), libMesh::DofObject::invalid_id, libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), mesh, libMesh::Elem::n_neighbors(), libMesh::ParallelObject::n_processors(), libMesh::Elem::neighbor_ptr(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::MeshBase::query_elem_ptr(), libMesh::remote_elem, and libMesh::Parallel::Communicator::semiverify().
Referenced by libMesh::MeshRefinement::_smooth_flags(), libMesh::DistributedMesh::allgather(), libMesh::DistributedMesh::delete_remote_elements(), and libMesh::UnstructuredMesh::find_neighbors().
void libMesh::MeshTools::libmesh_assert_valid_node_pointers | ( | const MeshBase & | mesh | ) |
A function for walking across the mesh to try and ferret out invalidated or misassigned pointers
Definition at line 1223 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), mesh, and libMesh::remote_elem.
void libMesh::MeshTools::libmesh_assert_valid_procids | ( | const MeshBase & | mesh | ) |
A function for verifying that processor assignment is both parallel and topologically consistent.
Definition at line 581 of file mesh_tools.h.
References mesh.
void libMesh::MeshTools::libmesh_assert_valid_refinement_flags | ( | const MeshBase & | mesh | ) |
A function for verifying that refinement flags on elements are consistent between processors
Definition at line 1985 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::element_ptr_range(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), mesh, libMesh::Parallel::Communicator::min(), and libMesh::ParallelObject::n_processors().
void libMesh::MeshTools::libmesh_assert_valid_refinement_tree | ( | const MeshBase & | mesh | ) |
A function for verifying that elements on this processor have valid descendants and consistent active flags.
Definition at line 2033 of file mesh_tools.C.
References libMesh::MeshBase::element_ptr_range(), libMesh::Elem::JUST_REFINED, mesh, and libMesh::remote_elem.
Referenced by libMesh::MeshCommunication::delete_remote_elements(), and libMesh::DistributedMesh::delete_remote_elements().
void libMesh::MeshTools::libmesh_assert_valid_remote_elems | ( | const MeshBase & | mesh | ) |
A function for verifying that active local elements' neighbors are never remote elements
Definition at line 1247 of file mesh_tools.C.
References libMesh::as_range(), libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), mesh, libMesh::Elem::parent(), and libMesh::remote_elem.
Referenced by libMesh::Partitioner::partition().
void libMesh::MeshTools::libmesh_assert_valid_unique_ids | ( | const MeshBase & | mesh | ) |
A function for verifying that unique ids match across processors.
FIXME: we ought to check for uniqueness too.
Definition at line 1641 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::max_elem_id(), libMesh::MeshBase::max_node_id(), mesh, libMesh::MeshBase::query_elem_ptr(), libMesh::MeshBase::query_node_ptr(), libMesh::Parallel::Communicator::semiverify(), and libMesh::DofObject::unique_id().
Referenced by libMesh::MeshBase::prepare_for_use().
unsigned int libMesh::MeshTools::max_level | ( | const MeshBase & | mesh | ) |
Find the maximum h-refinement level in a mesh.
Referenced by libMesh::MeshRefinement::make_coarsening_compatible(), and libMesh::CheckpointIO::n_active_levels_in().
dof_id_type libMesh::MeshTools::n_active_elem_of_type | ( | const MeshBase & | mesh, |
const ElemType | type | ||
) |
type
.Implemented in terms of active_type_element_iterators.
Definition at line 588 of file mesh_tools.C.
References libMesh::MeshBase::active_type_elements_begin(), libMesh::MeshBase::active_type_elements_end(), and mesh.
unsigned int libMesh::MeshTools::n_active_levels | ( | const MeshBase & | mesh | ) |
Implemented by looping over all the active local elements and finding the maximum level, then taking the max in parallel.
Definition at line 623 of file mesh_tools.C.
References libMesh::as_range(), libMesh::ParallelObject::comm(), std::max(), libMesh::Parallel::Communicator::max(), mesh, n_active_local_levels(), libMesh::MeshBase::unpartitioned_elements_begin(), and libMesh::MeshBase::unpartitioned_elements_end().
Referenced by libMesh::XdrIO::write_serialized_connectivity().
unsigned int libMesh::MeshTools::n_active_local_levels | ( | const MeshBase & | mesh | ) |
Implemented by looping over all the active local elements and finding the maximum level.
Definition at line 611 of file mesh_tools.C.
References libMesh::MeshBase::active_local_element_ptr_range(), std::max(), and mesh.
Referenced by n_active_levels().
dof_id_type libMesh::MeshTools::n_elem | ( | const MeshBase::const_element_iterator & | begin, |
const MeshBase::const_element_iterator & | end | ||
) |
Count up the number of elements of a specific type (as defined by an iterator range).
Definition at line 702 of file mesh_tools.C.
References end.
Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), correct_node_proc_ids(), libMesh::SFCPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::XdrIO::read(), libMesh::XdrIO::read_header(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::Partitioner::set_node_processor_ids(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::XdrIO::write(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::UCDIO::write_nodal_data(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_vector(), and libMesh::System::write_serialized_vectors().
dof_id_type libMesh::MeshTools::n_elem_of_type | ( | const MeshBase & | mesh, |
const ElemType | type | ||
) |
type
.Implemented in terms of type_element_iterators.
Definition at line 579 of file mesh_tools.C.
References mesh, libMesh::MeshBase::type_elements_begin(), and libMesh::MeshBase::type_elements_end().
unsigned int libMesh::MeshTools::n_levels | ( | const MeshBase & | mesh | ) |
Implemented by looping over all the local elements and unpartitioned elements and finding the maximum level, then summing in parallel.
Definition at line 653 of file mesh_tools.C.
References libMesh::as_range(), libMesh::ParallelObject::comm(), std::max(), libMesh::Parallel::Communicator::max(), mesh, n_local_levels(), paranoid_n_levels(), libMesh::MeshBase::unpartitioned_elements_begin(), and libMesh::MeshBase::unpartitioned_elements_end().
Referenced by libMesh::MeshCommunication::delete_remote_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::PetscDMWrapper::init_dm_data(), and libMesh::MeshTools::Modification::smooth().
unsigned int libMesh::MeshTools::n_local_levels | ( | const MeshBase & | mesh | ) |
Implemented by looping over all the local elements and finding the maximum level.
Definition at line 640 of file mesh_tools.C.
References libMesh::as_range(), libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), std::max(), and mesh.
Referenced by n_levels().
dof_id_type libMesh::MeshTools::n_nodes | ( | const MeshBase::const_node_iterator & | begin, |
const MeshBase::const_node_iterator & | end | ||
) |
Count up the number of nodes of a specific type (as defined by an iterator range).
Definition at line 710 of file mesh_tools.C.
References end.
Referenced by libmesh_assert_consistent_distributed_nodes(), libmesh_assert_parallel_consistent_new_node_procids(), and libmesh_assert_valid_boundary_ids().
dof_id_type libMesh::MeshTools::n_non_subactive_elem_of_type_at_level | ( | const MeshBase & | mesh, |
const ElemType | type, | ||
const unsigned int | level | ||
) |
type
at the specified refinement level.Definition at line 595 of file mesh_tools.C.
References libMesh::as_range(), mesh, libMesh::MeshBase::type_elements_begin(), and libMesh::MeshBase::type_elements_end().
unsigned int libMesh::MeshTools::n_p_levels | ( | const MeshBase & | mesh | ) |
Implemented by looping over all the local elements and finding the maximum p-level, then summing in parallel.
Definition at line 718 of file mesh_tools.C.
References libMesh::as_range(), libMesh::ParallelObject::comm(), libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), std::max(), libMesh::Parallel::Communicator::max(), mesh, libMesh::MeshBase::unpartitioned_elements_begin(), and libMesh::MeshBase::unpartitioned_elements_end().
Referenced by libMesh::XdrIO::write().
unsigned int libMesh::MeshTools::paranoid_n_levels | ( | const MeshBase & | mesh | ) |
Implemented by looping over all elements and finding the maximum level, then summing in parallel. This is much slower than n_levels() but will return correct values even when the mesh is in an inconsistent parallel state.
Definition at line 677 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::element_ptr_range(), std::max(), libMesh::Parallel::Communicator::max(), and mesh.
Referenced by n_levels().
MeshTools::BoundingBox libMesh::MeshTools::processor_bounding_box | ( | const MeshBase & | mesh, |
const processor_id_type | pid | ||
) |
Definition at line 466 of file mesh_tools.C.
References create_processor_bounding_box(), and mesh.
Sphere libMesh::MeshTools::processor_bounding_sphere | ( | const MeshBase & | mesh, |
const processor_id_type | pid | ||
) |
Definition at line 502 of file mesh_tools.C.
References create_processor_bounding_box(), mesh, and libMesh::Real.
MeshTools::BoundingBox libMesh::MeshTools::subdomain_bounding_box | ( | const MeshBase & | mesh, |
const subdomain_id_type | sid | ||
) |
Definition at line 518 of file mesh_tools.C.
References create_subdomain_bounding_box(), and mesh.
Sphere libMesh::MeshTools::subdomain_bounding_sphere | ( | const MeshBase & | mesh, |
const subdomain_id_type | sid | ||
) |
Definition at line 553 of file mesh_tools.C.
References create_subdomain_bounding_box(), mesh, and libMesh::Real.
dof_id_type libMesh::MeshTools::total_weight | ( | const MeshBase & | mesh | ) |
This can be useful for partitioning hybrid meshes. A feasible load balancing scheme is to keep the weight per processor as uniform as possible.
Definition at line 210 of file mesh_tools.C.
References libMesh::ParallelObject::comm(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), libMesh::DofObject::invalid_processor_id, libMesh::MeshBase::is_serial(), mesh, libMesh::Threads::parallel_reduce(), libMesh::ParallelObject::processor_id(), libMesh::Parallel::Communicator::sum(), and weight().
dof_id_type libMesh::MeshTools::weight | ( | const MeshBase & | mesh, |
const processor_id_type | pid | ||
) |
pid
of nodes per element.This can be useful for partitioning hybrid meshes. A feasible load balancing scheme is to keep the weight per processor as uniform as possible.
Definition at line 233 of file mesh_tools.C.
References mesh, libMesh::Threads::parallel_reduce(), libMesh::MeshBase::pid_elements_begin(), and libMesh::MeshBase::pid_elements_end().
Referenced by libMesh::QGrundmann_Moller::gm_rule(), libMesh::QGrid::init_2D(), libMesh::QGrid::init_3D(), libMesh::FE< Dim, LAGRANGE_VEC >::init_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::init_shape_functions(), libMesh::FEXYZ< Dim >::init_shape_functions(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::MeshTools::Modification::smooth(), total_weight(), and weight().
|
inline |