libMesh::BoundaryMesh Class Reference
#include <boundary_mesh.h>

Detailed Description
The BoundaryMesh is a Mesh in its own right, but it contains a description of the boundary of some other mesh. This is useful for writing the boundary of a domain for inspecting boundary conditions and other things.
Definition at line 42 of file boundary_mesh.h.
Member Typedef Documentation
typedef Predicates::multi_predicate libMesh::MeshBase::Predicate [inherited] |
We need an empty, generic class to act as a predicate for this and derived mesh classes.
Definition at line 610 of file mesh_base.h.
Constructor & Destructor Documentation
| libMesh::BoundaryMesh::BoundaryMesh | ( | unsigned int | d | ) |
Constructor. Initializes dimenstion and processor id.
Definition at line 32 of file boundary_mesh.C.
00032 : 00033 Mesh(d) 00034 { 00035 }
| libMesh::BoundaryMesh::~BoundaryMesh | ( | ) |
Destructor.
Definition at line 39 of file boundary_mesh.C.
References libMesh::ParallelMesh::clear().
00040 { 00041 this->clear(); 00042 }
Member Function Documentation
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 272 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 47 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 719 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 494 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_local_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 351 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_local_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 127 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::n_active_elem().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_local_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 799 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_local_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 574 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::n_active_elem().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_local_subdomain_elements_begin | ( | const subdomain_id_type | subdomain_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 460 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_local_subdomain_elements_begin | ( | const subdomain_id_type | subdomain_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 236 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_local_subdomain_elements_end | ( | const subdomain_id_type | subdomain_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 907 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_local_subdomain_elements_end | ( | const subdomain_id_type | subdomain_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 683 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::active_nodes_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 981 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::active_nodes_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 941 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::active_nodes_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1061 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::active_nodes_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1021 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_not_local_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 361 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_not_local_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 137 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_not_local_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 809 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_not_local_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 584 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_pid_elements_begin | ( | const processor_id_type | proc_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 441 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_pid_elements_begin | ( | const processor_id_type | proc_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 217 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::n_active_elem().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_pid_elements_end | ( | const processor_id_type | proc_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 888 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_pid_elements_end | ( | const processor_id_type | proc_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 664 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::n_active_elem().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_subdomain_elements_begin | ( | const subdomain_id_type | subdomain_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 470 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_subdomain_elements_begin | ( | const subdomain_id_type | subdomain_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 246 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_subdomain_elements_end | ( | const subdomain_id_type | subdomain_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 917 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_subdomain_elements_end | ( | const subdomain_id_type | subdomain_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 693 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_type_elements_begin | ( | const ElemType | type | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 431 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_type_elements_begin | ( | const ElemType | type | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 207 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::active_type_elements_end | ( | const ElemType | type | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 878 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::active_type_elements_end | ( | const ElemType | type | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 654 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Add elem e to the end of the element array. To add an element locally, set e->processor_id() before adding it. To ensure a specific element id, call e->set_id() before adding it; only do this in parallel if you are manually keeping ids consistent.
Implements libMesh::MeshBase.
Definition at line 332 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::_max_elem_id, libMesh::ParallelMesh::_n_elem, libMesh::ParallelMesh::_next_free_local_elem_id, libMesh::ParallelMesh::_next_free_unpartitioned_elem_id, libMesh::CommWorld, elem_id, libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::ParallelMesh::is_serial(), libMesh::Parallel::Communicator::max(), std::max(), libMesh::MeshBase::n_processors(), libMesh::n_processors(), libMesh::processor_id(), libMesh::DofObject::processor_id(), libMesh::DofObject::set_id(), and libMesh::DofObject::valid_id().
00333 { 00334 // Don't try to add NULLs! 00335 libmesh_assert(e); 00336 00337 // Trying to add an existing element is a no-op 00338 if (e->valid_id() && _elements[e->id()] == e) 00339 return e; 00340 00341 const processor_id_type elem_procid = e->processor_id(); 00342 00343 if (!e->valid_id()) 00344 { 00345 // We should only be creating new ids past the end of the range 00346 // of existing ids 00347 libmesh_assert_greater_equal(_next_free_unpartitioned_elem_id, 00348 _max_elem_id); 00349 libmesh_assert_greater_equal(_next_free_local_elem_id, _max_elem_id); 00350 00351 // Use the unpartitioned ids for unpartitioned elems, 00352 // in serial, and temporarily for ghost elems 00353 dof_id_type *next_id = &_next_free_unpartitioned_elem_id; 00354 if (elem_procid == libMesh::processor_id() && 00355 !this->is_serial()) 00356 next_id = &_next_free_local_elem_id; 00357 e->set_id (*next_id); 00358 } 00359 00360 { 00361 // Advance next_ids up high enough that each is pointing to an 00362 // unused id and any subsequent increments will still point us 00363 // to unused ids 00364 _max_elem_id = std::max(_max_elem_id, 00365 static_cast<dof_id_type>(e->id()+1)); 00366 00367 if (_next_free_unpartitioned_elem_id < _max_elem_id) 00368 _next_free_unpartitioned_elem_id = 00369 ((_max_elem_id-1) / (libMesh::n_processors() + 1) + 1) * 00370 (libMesh::n_processors() + 1) + libMesh::n_processors(); 00371 if (_next_free_local_elem_id < _max_elem_id) 00372 _next_free_local_elem_id = 00373 ((_max_elem_id + libMesh::n_processors() - 1) / (libMesh::n_processors() + 1) + 1) * 00374 (libMesh::n_processors() + 1) + libMesh::processor_id(); 00375 00376 #ifndef NDEBUG 00377 // We need a const mapvector so we don't inadvertently create 00378 // NULL entries when testing for non-NULL ones 00379 const mapvector<Elem*,dof_id_type>& const_elements = _elements; 00380 #endif 00381 libmesh_assert(!const_elements[_next_free_unpartitioned_elem_id]); 00382 libmesh_assert(!const_elements[_next_free_local_elem_id]); 00383 } 00384 00385 // Don't try to overwrite existing elems 00386 libmesh_assert (!_elements[e->id()]); 00387 00388 _elements[e->id()] = e; 00389 00390 // Try to make the cached elem data more accurate 00391 if (elem_procid == libMesh::processor_id() || 00392 elem_procid == DofObject::invalid_processor_id) 00393 _n_elem++; 00394 00395 // Unpartitioned elems should be added on every processor 00396 // And shouldn't be added in the same batch as ghost elems 00397 // But we might be just adding on processor 0 to 00398 // broadcast later 00399 #if 0 00400 #ifdef DEBUG 00401 if (elem_procid == DofObject::invalid_processor_id) 00402 { 00403 dof_id_type elem_id = e->id(); 00404 CommWorld.max(elem_id); 00405 libmesh_assert_equal_to (elem_id, e->id()); 00406 } 00407 #endif 00408 #endif 00409 00410 return e; 00411 }
Add Node n to the end of the vertex array.
Implements libMesh::MeshBase.
Definition at line 488 of file parallel_mesh.C.
References libMesh::ParallelMesh::_max_node_id, libMesh::ParallelMesh::_n_nodes, libMesh::ParallelMesh::_next_free_local_node_id, libMesh::ParallelMesh::_next_free_unpartitioned_node_id, libMesh::ParallelMesh::_nodes, libMesh::CommWorld, libMesh::DofObject::id(), libMesh::DofObject::invalid_processor_id, libMesh::ParallelMesh::is_serial(), libMesh::Parallel::Communicator::max(), std::max(), libMesh::MeshBase::n_processors(), libMesh::n_processors(), libMesh::processor_id(), libMesh::DofObject::processor_id(), libMesh::DofObject::set_id(), and libMesh::DofObject::valid_id().
Referenced by libMesh::ParallelMesh::add_point().
00489 { 00490 // Don't try to add NULLs! 00491 libmesh_assert(n); 00492 00493 // Trying to add an existing node is a no-op 00494 if (n->valid_id() && _nodes[n->id()] == n) 00495 return n; 00496 00497 const processor_id_type node_procid = n->processor_id(); 00498 00499 if (!n->valid_id()) 00500 { 00501 // We should only be creating new ids past the end of the range 00502 // of existing ids 00503 libmesh_assert_greater_equal(_next_free_unpartitioned_node_id, 00504 _max_node_id); 00505 libmesh_assert_greater_equal(_next_free_local_node_id, _max_node_id); 00506 00507 // Use the unpartitioned ids for unpartitioned nodes, 00508 // in serial, and temporarily for ghost nodes 00509 dof_id_type *next_id = &_next_free_unpartitioned_node_id; 00510 if (node_procid == libMesh::processor_id() && 00511 !this->is_serial()) 00512 next_id = &_next_free_local_node_id; 00513 n->set_id (*next_id); 00514 } 00515 00516 { 00517 // Advance next_ids up high enough that each is pointing to an 00518 // unused id and any subsequent increments will still point us 00519 // to unused ids 00520 _max_node_id = std::max(_max_node_id, 00521 static_cast<dof_id_type>(n->id()+1)); 00522 00523 if (_next_free_unpartitioned_node_id < _max_node_id) 00524 _next_free_unpartitioned_node_id = 00525 ((_max_node_id-1) / (libMesh::n_processors() + 1) + 1) * 00526 (libMesh::n_processors() + 1) + libMesh::n_processors(); 00527 if (_next_free_local_node_id < _max_node_id) 00528 _next_free_local_node_id = 00529 ((_max_node_id + libMesh::n_processors() - 1) / (libMesh::n_processors() + 1) + 1) * 00530 (libMesh::n_processors() + 1) + libMesh::processor_id(); 00531 00532 #ifndef NDEBUG 00533 // We need a const mapvector so we don't inadvertently create 00534 // NULL entries when testing for non-NULL ones 00535 const mapvector<Node*,dof_id_type>& const_nodes = _nodes; 00536 #endif 00537 libmesh_assert(!const_nodes[_next_free_unpartitioned_node_id]); 00538 libmesh_assert(!const_nodes[_next_free_local_node_id]); 00539 } 00540 00541 // Don't try to overwrite existing nodes 00542 libmesh_assert (!_nodes[n->id()]); 00543 00544 _nodes[n->id()] = n; 00545 00546 // Try to make the cached node data more accurate 00547 if (node_procid == libMesh::processor_id() || 00548 node_procid == DofObject::invalid_processor_id) 00549 _n_nodes++; 00550 00551 // Unpartitioned nodes should be added on every processor 00552 // And shouldn't be added in the same batch as ghost nodes 00553 // But we might be just adding on processor 0 to 00554 // broadcast later 00555 #if 0 00556 #ifdef DEBUG 00557 if (node_procid == DofObject::invalid_processor_id) 00558 { 00559 dof_id_type node_id = n->id(); 00560 CommWorld.max(node_id); 00561 libmesh_assert_equal_to (node_id, n->id()); 00562 } 00563 #endif 00564 #endif 00565 00566 return n; 00567 }
| Node * libMesh::ParallelMesh::add_point | ( | const Point & | p, | |
| const dof_id_type | id = DofObject::invalid_id, |
|||
| const processor_id_type | proc_id = DofObject::invalid_processor_id | |||
| ) | [virtual, inherited] |
functions for adding /deleting nodes elements.
Implements libMesh::MeshBase.
Definition at line 464 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, libMesh::ParallelMesh::add_node(), libMesh::Node::build(), libMesh::DofObject::id(), and libMesh::DofObject::processor_id().
00467 { 00468 if (_nodes.count(id)) 00469 { 00470 Node *n = _nodes[id]; 00471 libmesh_assert (n); 00472 libmesh_assert_equal_to (n->id(), id); 00473 00474 *n = p; 00475 n->processor_id() = proc_id; 00476 00477 return n; 00478 } 00479 00480 Node* n = Node::build(p, id).release(); 00481 n->processor_id() = proc_id; 00482 00483 return ParallelMesh::add_node(n); 00484 }
| void libMesh::UnstructuredMesh::all_first_order | ( | ) | [virtual, inherited] |
Converts a mesh with higher-order elements into a mesh with linear elements. For example, a mesh consisting of Tet10 will be converted to a mesh with Tet4 etc.
Prepare to identify (and then delete) a bunch of no-longer-used nodes.
Loop over the high-ordered elements. First make sure they _are_ indeed high-order, and then replace them with an equivalent first-order element.
If the second order element had any boundary conditions they should be transfered to the first-order element. The old boundary conditions will be removed from the BoundaryInfo data structure by insert_elem.
Implements libMesh::MeshBase.
Definition at line 254 of file mesh_modification.C.
References libMesh::MeshBase::_is_prepared, libMesh::Elem::add_child(), libMesh::MeshBase::boundary_info, libMesh::Elem::build(), libMesh::Elem::child(), libMesh::MeshBase::delete_node(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), libMesh::Elem::first_order_equivalent_type(), libMesh::Elem::get_node(), libMesh::Elem::has_children(), libMesh::DofObject::id(), libMesh::MeshBase::insert_elem(), libMesh::MeshBase::max_node_id(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), libMesh::Elem::n_vertices(), libMesh::Elem::neighbor(), libMesh::Elem::node(), libMesh::MeshBase::nodes_begin(), libMesh::MeshBase::nodes_end(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::MeshBase::renumber_nodes_and_elements(), libMesh::Elem::replace_child(), libMesh::DofObject::set_id(), libMesh::Elem::set_neighbor(), libMesh::Elem::set_node(), libMesh::Partitioner::set_node_processor_ids(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_parent(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subdomain_id(), libMesh::Elem::type(), and libMesh::Elem::which_child_am_i().
00255 { 00256 /* 00257 * when the mesh is not prepared, 00258 * at least renumber the nodes and 00259 * elements, so that the node ids 00260 * are correct 00261 */ 00262 if (!this->_is_prepared) 00263 this->renumber_nodes_and_elements (); 00264 00265 START_LOG("all_first_order()", "Mesh"); 00266 00270 std::vector<bool> node_touched_by_me(this->max_node_id(), false); 00271 00277 element_iterator endit = elements_end(); 00278 for (element_iterator it = elements_begin(); 00279 it != endit; ++it) 00280 { 00281 Elem* so_elem = *it; 00282 00283 libmesh_assert(so_elem); 00284 00285 /* 00286 * build the first-order equivalent, add to 00287 * the new_elements list. 00288 */ 00289 Elem* lo_elem = Elem::build 00290 (Elem::first_order_equivalent_type 00291 (so_elem->type()), so_elem->parent()).release(); 00292 00293 for (unsigned int s=0; s != so_elem->n_sides(); ++s) 00294 if (so_elem->neighbor(s) == remote_elem) 00295 lo_elem->set_neighbor(s, const_cast<RemoteElem*>(remote_elem)); 00296 00297 #ifdef LIBMESH_ENABLE_AMR 00298 /* 00299 * Reset the parent links of any child elements 00300 */ 00301 if (so_elem->has_children()) 00302 for (unsigned int c=0; c != so_elem->n_children(); ++c) 00303 { 00304 so_elem->child(c)->set_parent(lo_elem); 00305 lo_elem->add_child(so_elem->child(c), c); 00306 } 00307 00308 /* 00309 * Reset the child link of any parent element 00310 */ 00311 if (so_elem->parent()) 00312 { 00313 unsigned int c = 00314 so_elem->parent()->which_child_am_i(so_elem); 00315 lo_elem->parent()->replace_child(lo_elem, c); 00316 } 00317 00318 /* 00319 * Copy as much data to the new element as makes sense 00320 */ 00321 lo_elem->set_p_level(so_elem->p_level()); 00322 lo_elem->set_refinement_flag(so_elem->refinement_flag()); 00323 lo_elem->set_p_refinement_flag(so_elem->p_refinement_flag()); 00324 #endif 00325 00326 libmesh_assert_equal_to (lo_elem->n_vertices(), so_elem->n_vertices()); 00327 00328 /* 00329 * By definition the vertices of the linear and 00330 * second order element are identically numbered. 00331 * transfer these. 00332 */ 00333 for (unsigned int v=0; v < so_elem->n_vertices(); v++) 00334 { 00335 lo_elem->set_node(v) = so_elem->get_node(v); 00336 node_touched_by_me[lo_elem->node(v)] = true; 00337 } 00338 00345 libmesh_assert_equal_to (lo_elem->n_sides(), so_elem->n_sides()); 00346 00347 for (unsigned int s=0; s<so_elem->n_sides(); s++) 00348 { 00349 const std::vector<boundary_id_type> boundary_ids = 00350 this->boundary_info->raw_boundary_ids (so_elem, s); 00351 00352 this->boundary_info->add_side (lo_elem, s, boundary_ids); 00353 } 00354 00355 /* 00356 * The new first-order element is ready. 00357 * Inserting it into the mesh will replace and delete 00358 * the second-order element. 00359 */ 00360 lo_elem->set_id(so_elem->id()); 00361 lo_elem->processor_id() = so_elem->processor_id(); 00362 lo_elem->subdomain_id() = so_elem->subdomain_id(); 00363 this->insert_elem(lo_elem); 00364 } 00365 00366 const MeshBase::node_iterator nd_end = this->nodes_end(); 00367 MeshBase::node_iterator nd = this->nodes_begin(); 00368 while (nd != nd_end) 00369 { 00370 Node *the_node = *nd; 00371 ++nd; 00372 if (!node_touched_by_me[the_node->id()]) 00373 this->delete_node(the_node); 00374 } 00375 00376 STOP_LOG("all_first_order()", "Mesh"); 00377 00378 // On hanging nodes that used to also be second order nodes, we 00379 // might now have an invalid nodal processor_id() 00380 Partitioner::set_node_processor_ids(*this); 00381 00382 // delete or renumber nodes, etc 00383 this->prepare_for_use(/*skip_renumber =*/ false); 00384 }
| void libMesh::UnstructuredMesh::all_second_order | ( | const bool | full_ordered = true |
) | [virtual, inherited] |
Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements. For example, a mesh consisting of Tet4 will be converted to a mesh with Tet10 etc. Note that for some elements like Hex8 there exist two higher order equivalents, Hex20 and Hex27. When full_ordered is true (default), then Hex27 is built. Otherwise, Hex20 is built. The same holds obviously for Quad4, Prism6 ...
Loop over the low-ordered elements in the _elements vector. First make sure they _are_ indeed low-order, and then replace them with an equivalent second-order element. Don't forget to delete the low-order element, or else it will leak!
If the linear element had any boundary conditions they should be transfered to the second-order element. The old boundary conditions will be removed from the BoundaryInfo data structure by insert_elem.
Also, prepare_for_use() will reconstruct most of our neighbor links, but if we have any remote_elem links in a distributed mesh, they need to be preserved. We do that in the same loop here.
Implements libMesh::MeshBase.
Definition at line 388 of file mesh_modification.C.
References libMesh::MeshBase::_is_prepared, libMesh::MeshBase::add_point(), libMesh::MeshBase::boundary_info, libMesh::Elem::build(), libMesh::CommWorld, libMesh::Elem::default_order(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), libMesh::err, libMeshEnums::FIRST, libMesh::Elem::get_node(), libMesh::DofObject::id(), libMesh::MeshBase::insert_elem(), libMesh::DofObject::invalid_id, libMesh::MeshBase::is_serial(), libMesh::Elem::level(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::Elem::n_sides(), libMesh::Elem::n_vertices(), libMesh::Elem::neighbor(), libMesh::MeshBase::node(), libMesh::MeshBase::point(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::MeshBase::processor_id(), libMesh::Real, libMesh::AutoPtr< Tp >::release(), libMesh::remote_elem, libMesh::MeshBase::renumber_nodes_and_elements(), libMesh::MeshBase::reserve_nodes(), libMesh::Elem::second_order_equivalent_type(), libMesh::Elem::subdomain_id(), and libMesh::Elem::type().
Referenced by libMesh::MeshTools::Generation::build_cube().
00389 { 00390 // This function must be run on all processors at once 00391 parallel_only(); 00392 00393 /* 00394 * when the mesh is not prepared, 00395 * at least renumber the nodes and 00396 * elements, so that the node ids 00397 * are correct 00398 */ 00399 if (!this->_is_prepared) 00400 this->renumber_nodes_and_elements (); 00401 00402 /* 00403 * If the mesh is empty 00404 * then we have nothing to do 00405 */ 00406 if (!this->n_elem()) 00407 return; 00408 00409 /* 00410 * If the mesh is already second order 00411 * then we have nothing to do. 00412 * We have to test for this in a round-about way to avoid 00413 * a bug on distributed parallel meshes with more processors 00414 * than elements. 00415 */ 00416 bool already_second_order = false; 00417 if (this->elements_begin() != this->elements_end() && 00418 (*(this->elements_begin()))->default_order() != FIRST) 00419 already_second_order = true; 00420 CommWorld.max(already_second_order); 00421 if (already_second_order) 00422 return; 00423 00424 START_LOG("all_second_order()", "Mesh"); 00425 00426 /* 00427 * this map helps in identifying second order 00428 * nodes. Namely, a second-order node: 00429 * - edge node 00430 * - face node 00431 * - bubble node 00432 * is uniquely defined through a set of adjacent 00433 * vertices. This set of adjacent vertices is 00434 * used to identify already added higher-order 00435 * nodes. We are safe to use node id's since we 00436 * make sure that these are correctly numbered. 00437 */ 00438 std::map<std::vector<dof_id_type>, Node*> adj_vertices_to_so_nodes; 00439 00440 /* 00441 * for speed-up of the \p add_point() method, we 00442 * can reserve memory. Guess the number of additional 00443 * nodes for different dimensions 00444 */ 00445 switch (this->mesh_dimension()) 00446 { 00447 case 1: 00448 /* 00449 * in 1D, there can only be order-increase from Edge2 00450 * to Edge3. Something like 1/2 of n_nodes() have 00451 * to be added 00452 */ 00453 this->reserve_nodes(static_cast<unsigned int> 00454 (1.5*static_cast<double>(this->n_nodes()))); 00455 break; 00456 00457 case 2: 00458 /* 00459 * in 2D, either refine from Tri3 to Tri6 (double the nodes) 00460 * or from Quad4 to Quad8 (again, double) or Quad9 (2.25 that much) 00461 */ 00462 this->reserve_nodes(static_cast<unsigned int> 00463 (2*static_cast<double>(this->n_nodes()))); 00464 break; 00465 00466 00467 case 3: 00468 /* 00469 * in 3D, either refine from Tet4 to Tet10 (factor = 2.5) up to 00470 * Hex8 to Hex27 (something > 3). Since in 3D there _are_ already 00471 * quite some nodes, and since we do not want to overburden the memory by 00472 * a too conservative guess, use the lower bound 00473 */ 00474 this->reserve_nodes(static_cast<unsigned int> 00475 (2.5*static_cast<double>(this->n_nodes()))); 00476 break; 00477 00478 default: 00479 // Hm? 00480 libmesh_error(); 00481 } 00482 00483 00484 00485 /* 00486 * form a vector that will hold the node id's of 00487 * the vertices that are adjacent to the son-th 00488 * second-order node. Pull this outside of the 00489 * loop so that silly compilers don't repeatedly 00490 * create and destroy the vector. 00491 */ 00492 std::vector<dof_id_type> adjacent_vertices_ids; 00493 00500 const_element_iterator endit = elements_end(); 00501 for (const_element_iterator it = elements_begin(); 00502 it != endit; ++it) 00503 { 00504 // the linear-order element 00505 const Elem* lo_elem = *it; 00506 00507 libmesh_assert(lo_elem); 00508 00509 // make sure it is linear order 00510 if (lo_elem->default_order() != FIRST) 00511 { 00512 libMesh::err << "ERROR: This is not a linear element: type=" 00513 << lo_elem->type() << std::endl; 00514 libmesh_error(); 00515 } 00516 00517 // this does _not_ work for refined elements 00518 libmesh_assert_equal_to (lo_elem->level (), 0); 00519 00520 /* 00521 * build the second-order equivalent, add to 00522 * the new_elements list. Note that this here 00523 * is the only point where \p full_ordered 00524 * is necessary. The remaining code works well 00525 * for either type of seconrd-order equivalent, e.g. 00526 * Hex20 or Hex27, as equivalents for Hex8 00527 */ 00528 Elem* so_elem = 00529 Elem::build (Elem::second_order_equivalent_type(lo_elem->type(), 00530 full_ordered) ).release(); 00531 00532 libmesh_assert_equal_to (lo_elem->n_vertices(), so_elem->n_vertices()); 00533 00534 00535 /* 00536 * By definition the vertices of the linear and 00537 * second order element are identically numbered. 00538 * transfer these. 00539 */ 00540 for (unsigned int v=0; v < lo_elem->n_vertices(); v++) 00541 so_elem->set_node(v) = lo_elem->get_node(v); 00542 00543 /* 00544 * Now handle the additional mid-side nodes. This 00545 * is simply handled through a map that remembers 00546 * the already-added nodes. This map maps the global 00547 * ids of the vertices (that uniquely define this 00548 * higher-order node) to the new node. 00549 * Notation: son = second-order node 00550 */ 00551 const unsigned int son_begin = so_elem->n_vertices(); 00552 const unsigned int son_end = so_elem->n_nodes(); 00553 00554 00555 for (unsigned int son=son_begin; son<son_end; son++) 00556 { 00557 const unsigned int n_adjacent_vertices = 00558 so_elem->n_second_order_adjacent_vertices(son); 00559 00560 adjacent_vertices_ids.resize(n_adjacent_vertices); 00561 00562 for (unsigned int v=0; v<n_adjacent_vertices; v++) 00563 adjacent_vertices_ids[v] = 00564 so_elem->node( so_elem->second_order_adjacent_vertex(son,v) ); 00565 00566 /* 00567 * \p adjacent_vertices_ids is now in order of the current 00568 * side. sort it, so that comparisons with the 00569 * \p adjacent_vertices_ids created through other elements' 00570 * sides can match 00571 */ 00572 std::sort(adjacent_vertices_ids.begin(), 00573 adjacent_vertices_ids.end()); 00574 00575 00576 // does this set of vertices already has a mid-node added? 00577 std::pair<std::map<std::vector<dof_id_type>, Node*>::iterator, 00578 std::map<std::vector<dof_id_type>, Node*>::iterator> 00579 pos = adj_vertices_to_so_nodes.equal_range (adjacent_vertices_ids); 00580 00581 // no, not added yet 00582 if (pos.first == pos.second) 00583 { 00584 /* 00585 * for this set of vertices, there is no 00586 * second_order node yet. Add it. 00587 * 00588 * compute the location of the new node as 00589 * the average over the adjacent vertices. 00590 */ 00591 Point new_location = this->point(adjacent_vertices_ids[0]); 00592 for (unsigned int v=1; v<n_adjacent_vertices; v++) 00593 new_location += this->point(adjacent_vertices_ids[v]); 00594 00595 new_location /= static_cast<Real>(n_adjacent_vertices); 00596 00597 /* Add the new point to the mesh, giving it a globally 00598 * well-defined processor id. 00599 */ 00600 Node* so_node = this->add_point 00601 (new_location, DofObject::invalid_id, 00602 this->node(adjacent_vertices_ids[0]).processor_id()); 00603 00604 /* 00605 * insert the new node with its defining vertex 00606 * set into the map, and relocate pos to this 00607 * new entry, so that the so_elem can use 00608 * \p pos for inserting the node 00609 */ 00610 adj_vertices_to_so_nodes.insert(pos.first, 00611 std::make_pair(adjacent_vertices_ids, 00612 so_node)); 00613 00614 so_elem->set_node(son) = so_node; 00615 } 00616 // yes, already added. 00617 else 00618 { 00619 libmesh_assert(pos.first->second); 00620 00621 so_elem->set_node(son) = pos.first->second; 00622 } 00623 } 00624 00625 00637 libmesh_assert_equal_to (lo_elem->n_sides(), so_elem->n_sides()); 00638 00639 for (unsigned int s=0; s<lo_elem->n_sides(); s++) 00640 { 00641 const std::vector<boundary_id_type> boundary_ids = 00642 this->boundary_info->raw_boundary_ids (lo_elem, s); 00643 00644 this->boundary_info->add_side (so_elem, s, boundary_ids); 00645 00646 if (lo_elem->neighbor(s) == remote_elem) 00647 so_elem->set_neighbor(s, const_cast<RemoteElem*>(remote_elem)); 00648 } 00649 00650 /* 00651 * The new second-order element is ready. 00652 * Inserting it into the mesh will replace and delete 00653 * the first-order element. 00654 */ 00655 so_elem->set_id(lo_elem->id()); 00656 so_elem->processor_id() = lo_elem->processor_id(); 00657 so_elem->subdomain_id() = lo_elem->subdomain_id(); 00658 this->insert_elem(so_elem); 00659 } 00660 00661 // we can clear the map 00662 adj_vertices_to_so_nodes.clear(); 00663 00664 00665 STOP_LOG("all_second_order()", "Mesh"); 00666 00667 // In a ParallelMesh our ghost node processor ids may be bad and 00668 // the ids of nodes touching remote elements may be inconsistent. 00669 // Fix them. 00670 if (!this->is_serial()) 00671 { 00672 LocationMap<Node> loc_map; 00673 MeshCommunication().make_nodes_parallel_consistent 00674 (*this, loc_map); 00675 } 00676 00677 // renumber nodes, elements etc 00678 this->prepare_for_use(/*skip_renumber =*/ false); 00679 }
| void libMesh::ParallelMesh::allgather | ( | ) | [virtual, inherited] |
Gathers all elements and nodes of the mesh onto every processor
Reimplemented from libMesh::MeshBase.
Definition at line 1229 of file parallel_mesh.C.
References libMesh::ParallelMesh::_is_serial, libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids(), libMesh::ParallelMesh::max_elem_id(), libMesh::ParallelMesh::max_node_id(), libMesh::ParallelMesh::n_elem(), libMesh::ParallelMesh::n_nodes(), libMesh::ParallelMesh::parallel_max_elem_id(), libMesh::ParallelMesh::parallel_max_node_id(), libMesh::ParallelMesh::parallel_n_elem(), and libMesh::ParallelMesh::parallel_n_nodes().
01230 { 01231 if (_is_serial) 01232 return; 01233 _is_serial = true; 01234 MeshCommunication().allgather(*this); 01235 01236 // Make sure our caches are up to date and our 01237 // DofObjects are well packed 01238 #ifdef DEBUG 01239 libmesh_assert_equal_to (this->n_nodes(), this->parallel_n_nodes()); 01240 libmesh_assert_equal_to (this->n_elem(), this->parallel_n_elem()); 01241 const dof_id_type pmax_node_id = this->parallel_max_node_id(); 01242 const dof_id_type pmax_elem_id = this->parallel_max_elem_id(); 01243 libmesh_assert_equal_to (this->max_node_id(), pmax_node_id); 01244 libmesh_assert_equal_to (this->max_elem_id(), pmax_elem_id); 01245 01246 // If we've disabled renumbering we can't be sure we're contiguous 01247 // libmesh_assert_equal_to (this->n_nodes(), this->max_node_id()); 01248 // libmesh_assert_equal_to (this->n_elem(), this->max_elem_id()); 01249 01250 // Make sure our neighbor links are all fine 01251 MeshTools::libmesh_assert_valid_neighbors(*this); 01252 01253 // Make sure our ids and flags are consistent 01254 this->libmesh_assert_valid_parallel_ids(); 01255 this->libmesh_assert_valid_parallel_flags(); 01256 #endif 01257 }
| bool libMesh::MeshBase::allow_renumbering | ( | ) | const [inline, inherited] |
Definition at line 502 of file mesh_base.h.
References libMesh::MeshBase::_skip_renumber_nodes_and_elements.
Referenced by libMesh::MeshBase::prepare_for_use(), and libMesh::UnstructuredMesh::read().
00502 { return !_skip_renumber_nodes_and_elements; }
| void libMesh::MeshBase::allow_renumbering | ( | bool | allow | ) | [inline, inherited] |
If false is passed in then this mesh will no longer be renumbered when being prepared for use. This may slightly adversely affect performance during subsequent element access, particulary when using a distributed mesh.
Definition at line 501 of file mesh_base.h.
References libMesh::MeshBase::_skip_renumber_nodes_and_elements.
Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::AdjointRefinementEstimator::estimate_error(), and libMesh::ErrorVector::plot_error().
00501 { _skip_renumber_nodes_and_elements = !allow; }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::ancestor_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 291 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::ancestor_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 67 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::ancestor_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 739 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::ancestor_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 514 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| void libMesh::ParallelMesh::clear | ( | ) | [virtual, inherited] |
Clear all internal data.
Reimplemented from libMesh::MeshBase.
Definition at line 635 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::_is_serial, libMesh::ParallelMesh::_max_elem_id, libMesh::ParallelMesh::_max_node_id, libMesh::ParallelMesh::_n_elem, libMesh::ParallelMesh::_n_nodes, libMesh::ParallelMesh::_next_free_local_elem_id, libMesh::ParallelMesh::_next_free_local_node_id, libMesh::ParallelMesh::_next_free_unpartitioned_elem_id, libMesh::ParallelMesh::_next_free_unpartitioned_node_id, libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), libMesh::mapvector< Val, index_t >::end(), end, libMesh::MeshBase::n_processors(), and libMesh::MeshBase::processor_id().
Referenced by ~BoundaryMesh(), and libMesh::ParallelMesh::~ParallelMesh().
00636 { 00637 // Call parent clear function 00638 MeshBase::clear(); 00639 00640 00641 // Clear our elements and nodes 00642 { 00643 elem_iterator_imp it = _elements.begin(); 00644 const elem_iterator_imp end = _elements.end(); 00645 00646 // There is no need to remove the elements from 00647 // the BoundaryInfo data structure since we 00648 // already cleared it. 00649 for (; it != end; ++it) 00650 delete *it; 00651 00652 _elements.clear(); 00653 } 00654 00655 // clear the nodes data structure 00656 { 00657 node_iterator_imp it = _nodes.begin(); 00658 node_iterator_imp end = _nodes.end(); 00659 00660 // There is no need to remove the nodes from 00661 // the BoundaryInfo data structure since we 00662 // already cleared it. 00663 for (; it != end; ++it) 00664 delete *it; 00665 00666 _nodes.clear(); 00667 } 00668 00669 // We're no longer distributed if we were before 00670 _is_serial = true; 00671 00672 // Correct our caches 00673 _n_nodes = 0; 00674 _n_elem = 0; 00675 _max_node_id = 0; 00676 _max_elem_id = 0; 00677 _next_free_local_node_id = libMesh::processor_id(); 00678 _next_free_local_elem_id = libMesh::processor_id(); 00679 _next_free_unpartitioned_node_id = libMesh::n_processors(); 00680 _next_free_unpartitioned_elem_id = libMesh::n_processors(); 00681 }
| void libMesh::MeshBase::clear_point_locator | ( | ) | [inherited] |
Releases the current PointLocator object.
Definition at line 379 of file mesh_base.C.
References libMesh::MeshBase::_point_locator, and libMesh::AutoPtr< Tp >::reset().
Referenced by libMesh::MeshBase::clear(), libMesh::UnstructuredMesh::contract(), and libMesh::MeshBase::prepare_for_use().
00380 { 00381 _point_locator.reset(NULL); 00382 }
Virtual copy-constructor, creates a copy of this mesh
Implements libMesh::MeshBase.
Definition at line 76 of file parallel_mesh.h.
References libMesh::ParallelMesh::ParallelMesh().
00077 { return AutoPtr<MeshBase>(new ParallelMesh(*this)); }
| bool libMesh::UnstructuredMesh::contract | ( | ) | [virtual, inherited] |
Delete subactive (i.e. children of coarsened) elements. This removes all elements descended from currently active elements in the mesh.
Implements libMesh::MeshBase.
Definition at line 1064 of file unstructured_mesh.C.
References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::MeshBase::clear_point_locator(), libMesh::Elem::contract(), libMesh::MeshBase::delete_elem(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), end, libMesh::Elem::parent(), libMesh::MeshBase::renumber_nodes_and_elements(), and libMesh::Elem::subactive().
01065 { 01066 START_LOG ("contract()", "Mesh"); 01067 01068 // Flag indicating if this call actually changes the mesh 01069 bool mesh_changed = false; 01070 01071 element_iterator in = elements_begin(); 01072 const element_iterator end = elements_end(); 01073 01074 #ifdef DEBUG 01075 for ( ; in != end; ++in) 01076 if (*in != NULL) 01077 { 01078 Elem* el = *in; 01079 libmesh_assert(el->active() || el->subactive() || el->ancestor()); 01080 } 01081 in = elements_begin(); 01082 #endif 01083 01084 // Loop over the elements. 01085 for ( ; in != end; ++in) 01086 if (*in != NULL) 01087 { 01088 Elem* el = *in; 01089 01090 // Delete all the subactive ones 01091 if (el->subactive()) 01092 { 01093 // No level-0 element should be subactive. 01094 // Note that we CAN'T test elem->level(), as that 01095 // touches elem->parent()->dim(), and elem->parent() 01096 // might have already been deleted! 01097 libmesh_assert(el->parent()); 01098 01099 // Delete the element 01100 // This just sets a pointer to NULL, and doesn't 01101 // invalidate any iterators 01102 this->delete_elem(el); 01103 01104 // the mesh has certainly changed 01105 mesh_changed = true; 01106 } 01107 else 01108 { 01109 // Compress all the active ones 01110 if (el->active()) 01111 el->contract(); 01112 else 01113 libmesh_assert (el->ancestor()); 01114 } 01115 } 01116 01117 // Strip any newly-created NULL voids out of the element array 01118 this->renumber_nodes_and_elements(); 01119 01120 // FIXME: Need to understand why deleting subactive children 01121 // invalidates the point locator. For now we will clear it explicitly 01122 this->clear_point_locator(); 01123 01124 STOP_LOG ("contract()", "Mesh"); 01125 01126 return mesh_changed; 01127 }
| void libMesh::UnstructuredMesh::copy_nodes_and_elements | ( | const UnstructuredMesh & | other_mesh | ) | [virtual, inherited] |
Deep copy of another unstructured mesh class (used by subclass copy constructors)
Definition at line 90 of file unstructured_mesh.C.
References libMesh::MeshBase::_dim, libMesh::MeshBase::_is_prepared, libMesh::MeshBase::_n_parts, libMesh::Elem::add_child(), libMesh::MeshBase::allow_renumbering(), libMesh::Elem::build(), libMesh::Elem::child(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), end, libMesh::Elem::has_children(), libMesh::DofObject::id(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::Elem::n_children(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), libMesh::Elem::node(), libMesh::MeshBase::nodes_begin(), libMesh::MeshBase::nodes_end(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::DofObject::processor_id(), libMesh::Elem::refinement_flag(), libMesh::AutoPtr< Tp >::release(), libMesh::remote_elem, libMesh::MeshBase::skip_partitioning(), libMesh::Elem::subdomain_id(), libMesh::Elem::type(), and libMesh::Elem::which_child_am_i().
Referenced by libMesh::ParallelMesh::ParallelMesh(), libMesh::SerialMesh::SerialMesh(), and libMesh::SerialMesh::stitch_meshes().
00091 { 00092 // We're assuming our subclass data needs no copy 00093 libmesh_assert_equal_to (_n_parts, other_mesh._n_parts); 00094 libmesh_assert_equal_to (_dim, other_mesh._dim); 00095 libmesh_assert_equal_to (_is_prepared, other_mesh._is_prepared); 00096 00097 // We're assuming the other mesh has proper element number ordering, 00098 // so that we add parents before their children. 00099 #ifdef DEBUG 00100 MeshTools::libmesh_assert_valid_amr_elem_ids(other_mesh); 00101 #endif 00102 00103 //Copy in Nodes 00104 { 00105 //Preallocate Memory if necessary 00106 this->reserve_nodes(other_mesh.n_nodes()); 00107 00108 const_node_iterator it = other_mesh.nodes_begin(); 00109 const_node_iterator end = other_mesh.nodes_end(); 00110 00111 for (; it != end; ++it) 00112 { 00113 const Node *oldn = *it; 00114 00115 // Add new nodes in old node Point locations 00116 /*Node *newn =*/ this->add_point(*oldn, oldn->id(), oldn->processor_id()); 00117 00118 // And start them off in the same subdomain 00119 // newn->processor_id() = oldn->processor_id(); 00120 } 00121 } 00122 00123 //Copy in Elements 00124 { 00125 //Preallocate Memory if necessary 00126 this->reserve_elem(other_mesh.n_elem()); 00127 00128 // Loop over the elements 00129 MeshBase::const_element_iterator it = other_mesh.elements_begin(); 00130 const MeshBase::const_element_iterator end = other_mesh.elements_end(); 00131 00132 // FIXME: Where do we set element IDs?? 00133 for (; it != end; ++it) 00134 { 00135 //Look at the old element 00136 const Elem *old = *it; 00137 //Build a new element 00138 Elem *newparent = old->parent() ? 00139 this->elem(old->parent()->id()) : NULL; 00140 AutoPtr<Elem> ap = Elem::build(old->type(), newparent); 00141 Elem * el = ap.release(); 00142 00143 el->subdomain_id() = old->subdomain_id(); 00144 00145 for (unsigned int s=0; s != old->n_sides(); ++s) 00146 if (old->neighbor(s) == remote_elem) 00147 el->set_neighbor(s, const_cast<RemoteElem*>(remote_elem)); 00148 00149 #ifdef LIBMESH_ENABLE_AMR 00150 if (old->has_children()) 00151 for (unsigned int c=0; c != old->n_children(); ++c) 00152 if (old->child(c) == remote_elem) 00153 el->add_child(const_cast<RemoteElem*>(remote_elem), c); 00154 00155 //Create the parent's child pointers if necessary 00156 if (newparent) 00157 { 00158 unsigned int oldc = old->parent()->which_child_am_i(old); 00159 newparent->add_child(el, oldc); 00160 } 00161 00162 // Copy the refinement flags 00163 el->set_refinement_flag(old->refinement_flag()); 00164 el->set_p_refinement_flag(old->p_refinement_flag()); 00165 #endif // #ifdef LIBMESH_ENABLE_AMR 00166 00167 //Assign all the nodes 00168 for(unsigned int i=0;i<el->n_nodes();i++) 00169 el->set_node(i) = &this->node(old->node(i)); 00170 00171 // And start it off in the same subdomain 00172 el->processor_id() = old->processor_id(); 00173 00174 // Give it the same id 00175 el->set_id(old->id()); 00176 00177 //Hold onto it 00178 this->add_elem(el); 00179 } 00180 } 00181 00182 //Finally prepare the new Mesh for use. Keep the same numbering and 00183 //partitioning but also the same renumbering and partitioning 00184 //policies as our source mesh. 00185 this->allow_renumbering(false); 00186 this->skip_partitioning(true); 00187 this->prepare_for_use(); 00188 this->allow_renumbering(other_mesh.allow_renumbering()); 00189 this->skip_partitioning(other_mesh.skip_partitioning()); 00190 }
| void libMesh::UnstructuredMesh::create_pid_mesh | ( | UnstructuredMesh & | pid_mesh, | |
| const processor_id_type | pid | |||
| ) | const [inherited] |
Generates a new mesh containing all the elements which are assigned to processor pid. This mesh is written to the pid_mesh reference which you must create and pass to the function.
Definition at line 930 of file unstructured_mesh.C.
References libMesh::MeshBase::active_pid_elements_begin(), libMesh::MeshBase::active_pid_elements_end(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshBase::n_processors(), and libMesh::out.
00932 { 00933 00934 // Issue a warning if the number the number of processors 00935 // currently available is less that that requested for 00936 // partitioning. This is not necessarily an error since 00937 // you may run on one processor and still partition the 00938 // mesh into several partitions. 00939 #ifdef DEBUG 00940 if (this->n_processors() < pid) 00941 { 00942 libMesh::out << "WARNING: You are creating a " 00943 << "mesh for a processor id (=" 00944 << pid 00945 << ") greater than " 00946 << "the number of processors available for " 00947 << "the calculation. (=" 00948 << libMesh::n_processors() 00949 << ")." 00950 << std::endl; 00951 } 00952 #endif 00953 00954 // Create iterators to loop over the list of elements 00955 // const_active_pid_elem_iterator it(this->elements_begin(), pid); 00956 // const const_active_pid_elem_iterator it_end(this->elements_end(), pid); 00957 00958 const_element_iterator it = this->active_pid_elements_begin(pid); 00959 const const_element_iterator it_end = this->active_pid_elements_end(pid); 00960 00961 this->create_submesh (pid_mesh, it, it_end); 00962 }
| void libMesh::UnstructuredMesh::create_submesh | ( | UnstructuredMesh & | new_mesh, | |
| const_element_iterator & | it, | |||
| const const_element_iterator & | it_end | |||
| ) | const [inherited] |
Constructs a mesh called "new_mesh" from the current mesh by iterating over the elements between it and it_end and adding them to the new mesh.
Definition at line 970 of file unstructured_mesh.C.
References libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_point(), bc_id, libMesh::MeshBase::boundary_info, libMesh::Elem::build(), libMesh::MeshBase::clear(), libMesh::invalid_uint, libMesh::MeshBase::n_elem(), libMesh::Elem::n_nodes(), libMesh::MeshBase::n_nodes(), libMesh::Elem::n_sides(), libMesh::Elem::node(), libMesh::MeshBase::node_ptr(), libMesh::Elem::point(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::Elem::set_node(), libMesh::Elem::subdomain_id(), and libMesh::Elem::type().
Referenced by libMesh::UnstructuredMesh::create_pid_mesh().
00973 { 00974 // Just in case the subdomain_mesh already has some information 00975 // in it, get rid of it. 00976 new_mesh.clear(); 00977 00978 // Fail if (*this == new_mesh), we cannot create a submesh inside ourself! 00979 // This may happen if the user accidently passes the original mesh into 00980 // this function! We will check this by making sure we did not just 00981 // clear ourself. 00982 libmesh_assert_not_equal_to (this->n_nodes(), 0); 00983 libmesh_assert_not_equal_to (this->n_elem(), 0); 00984 00985 // How the nodes on this mesh will be renumbered to nodes 00986 // on the new_mesh. 00987 std::vector<dof_id_type> new_node_numbers (this->n_nodes()); 00988 00989 std::fill (new_node_numbers.begin(), 00990 new_node_numbers.end(), 00991 libMesh::invalid_uint); 00992 00993 00994 00995 // the number of nodes on the new mesh, will be incremented 00996 dof_id_type n_new_nodes = 0; 00997 dof_id_type n_new_elem = 0; 00998 00999 for (; it != it_end; ++it) 01000 { 01001 // increment the new element counter 01002 n_new_elem++; 01003 01004 const Elem* old_elem = *it; 01005 01006 // Add an equivalent element type to the new_mesh 01007 Elem* new_elem = 01008 new_mesh.add_elem (Elem::build(old_elem->type()).release()); 01009 01010 libmesh_assert(new_elem); 01011 01012 // Loop over the nodes on this element. 01013 for (unsigned int n=0; n<old_elem->n_nodes(); n++) 01014 { 01015 libmesh_assert_less (old_elem->node(n), new_node_numbers.size()); 01016 01017 if (new_node_numbers[old_elem->node(n)] == libMesh::invalid_uint) 01018 { 01019 new_node_numbers[old_elem->node(n)] = n_new_nodes; 01020 01021 // Add this node to the new mesh 01022 new_mesh.add_point (old_elem->point(n)); 01023 01024 // Increment the new node counter 01025 n_new_nodes++; 01026 } 01027 01028 // Define this element's connectivity on the new mesh 01029 libmesh_assert_less (new_node_numbers[old_elem->node(n)], new_mesh.n_nodes()); 01030 01031 new_elem->set_node(n) = new_mesh.node_ptr (new_node_numbers[old_elem->node(n)]); 01032 } 01033 01034 // Copy ids for this element 01035 new_elem->subdomain_id() = old_elem->subdomain_id(); 01036 new_elem->processor_id() = old_elem->processor_id(); 01037 01038 // Maybe add boundary conditions for this element 01039 for (unsigned int s=0; s<old_elem->n_sides(); s++) 01040 // We're supporting boundary ids on internal sides now 01041 // if (old_elem->neighbor(s) == NULL) 01042 { 01043 const std::vector<boundary_id_type>& bc_ids = this->boundary_info->boundary_ids(old_elem, s); 01044 for (std::vector<boundary_id_type>::const_iterator id_it=bc_ids.begin(); id_it!=bc_ids.end(); ++id_it) 01045 { 01046 const boundary_id_type bc_id = *id_it; 01047 if (bc_id != this->boundary_info->invalid_id) 01048 new_mesh.boundary_info->add_side (new_elem, 01049 s, 01050 bc_id); 01051 } 01052 } 01053 } // end loop over elements 01054 01055 01056 // Prepare the new_mesh for use 01057 new_mesh.prepare_for_use(/*skip_renumber =*/false); 01058 01059 }
| void libMesh::ParallelMesh::delete_elem | ( | Elem * | e | ) | [virtual, inherited] |
Removes element e from the mesh. Note that calling this method may produce isolated nodes, i.e. nodes not connected to any element. This method must be implemented in derived classes in such a way that it does not invalidate element iterators.
Implements libMesh::MeshBase.
Definition at line 427 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::MeshBase::boundary_info, and libMesh::DofObject::id().
Referenced by libMesh::MeshCommunication::delete_remote_elements(), and libMesh::ParallelMesh::insert_elem().
00428 { 00429 libmesh_assert (e); 00430 00431 // Delete the element from the BoundaryInfo object 00432 this->boundary_info->remove(e); 00433 00434 // But not yet from the container; we might invalidate 00435 // an iterator that way! 00436 00437 //_elements.erase(e->id()); 00438 00439 // Instead, we set it to NULL for now 00440 00441 _elements[e->id()] = NULL; 00442 00443 // delete the element 00444 delete e; 00445 }
| void libMesh::ParallelMesh::delete_node | ( | Node * | n | ) | [virtual, inherited] |
Removes the Node n from the mesh.
Implements libMesh::MeshBase.
Definition at line 597 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, libMesh::MeshBase::boundary_info, and libMesh::DofObject::id().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
00598 { 00599 libmesh_assert(n); 00600 libmesh_assert(_nodes[n->id()]); 00601 00602 // Delete the node from the BoundaryInfo object 00603 this->boundary_info->remove(n); 00604 00605 // But not yet from the container; we might invalidate 00606 // an iterator that way! 00607 00608 //_nodes.erase(n->id()); 00609 00610 // Instead, we set it to NULL for now 00611 00612 _nodes[n->id()] = NULL; 00613 00614 // delete the node 00615 delete n; 00616 }
| void libMesh::ParallelMesh::delete_remote_elements | ( | ) | [virtual, inherited] |
Deletes all nonlocal elements of the mesh except for "ghosts" which touch a local element, and deletes all nodes which are not part of a local or ghost element
Reimplemented from libMesh::MeshBase.
Definition at line 1151 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::_extra_ghost_elems, libMesh::ParallelMesh::_is_serial, libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), libMesh::mapvector< Val, index_t >::end(), libMesh::mapvector< Val, index_t >::erase(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::ParallelMesh::max_elem_id(), libMesh::ParallelMesh::max_node_id(), libMesh::ParallelMesh::n_elem(), libMesh::ParallelMesh::n_nodes(), libMesh::ParallelMesh::parallel_max_elem_id(), libMesh::ParallelMesh::parallel_max_node_id(), libMesh::ParallelMesh::parallel_n_elem(), libMesh::ParallelMesh::parallel_n_nodes(), and libMesh::ParallelMesh::update_parallel_id_counts().
01152 { 01153 #ifdef DEBUG 01154 // Make sure our neighbor links are all fine 01155 MeshTools::libmesh_assert_valid_neighbors(*this); 01156 01157 // And our child/parent links, and our flags 01158 MeshTools::libmesh_assert_valid_refinement_tree(*this); 01159 01160 // Make sure our ids and flags are consistent 01161 this->libmesh_assert_valid_parallel_ids(); 01162 this->libmesh_assert_valid_parallel_flags(); 01163 01164 libmesh_assert_equal_to (this->n_nodes(), this->parallel_n_nodes()); 01165 libmesh_assert_equal_to (this->n_elem(), this->parallel_n_elem()); 01166 const dof_id_type pmax_node_id = this->parallel_max_node_id(); 01167 const dof_id_type pmax_elem_id = this->parallel_max_elem_id(); 01168 libmesh_assert_equal_to (this->max_node_id(), pmax_node_id); 01169 libmesh_assert_equal_to (this->max_elem_id(), pmax_elem_id); 01170 #endif 01171 01172 _is_serial = false; 01173 MeshCommunication().delete_remote_elements(*this, _extra_ghost_elems); 01174 01175 libmesh_assert_equal_to (this->max_elem_id(), this->parallel_max_elem_id()); 01176 01177 // Now make sure the containers actually shrink - strip 01178 // any newly-created NULL voids out of the element array 01179 mapvector<Elem*,dof_id_type>::veclike_iterator e_it = _elements.begin(); 01180 const mapvector<Elem*,dof_id_type>::veclike_iterator e_end = _elements.end(); 01181 for (; e_it != e_end;) 01182 if (!*e_it) 01183 _elements.erase(e_it++); 01184 else 01185 ++e_it; 01186 01187 mapvector<Node*,dof_id_type>::veclike_iterator n_it = _nodes.begin(); 01188 const mapvector<Node*,dof_id_type>::veclike_iterator n_end = _nodes.end(); 01189 for (; n_it != n_end;) 01190 if (!*n_it) 01191 _nodes.erase(n_it++); 01192 else 01193 ++n_it; 01194 01195 // We may have deleted no-longer-connected nodes or coarsened-away 01196 // elements; let's update our caches. 01197 this->update_parallel_id_counts(); 01198 01199 #ifdef DEBUG 01200 // We might not have well-packed objects if the user didn't allow us 01201 // to renumber 01202 // libmesh_assert_equal_to (this->n_nodes(), this->max_node_id()); 01203 // libmesh_assert_equal_to (this->n_elem(), this->max_elem_id()); 01204 01205 // Make sure our neighbor links are all fine 01206 MeshTools::libmesh_assert_valid_neighbors(*this); 01207 01208 // And our child/parent links, and our flags 01209 MeshTools::libmesh_assert_valid_refinement_tree(*this); 01210 01211 // Make sure our ids and flags are consistent 01212 this->libmesh_assert_valid_parallel_ids(); 01213 this->libmesh_assert_valid_parallel_flags(); 01214 #endif 01215 }
| Elem * libMesh::ParallelMesh::elem | ( | const dof_id_type | i | ) | [virtual, inherited] |
Return a writeable pointer to the
element, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 289 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements.
| const Elem * libMesh::ParallelMesh::elem | ( | const dof_id_type | i | ) | const [virtual, inherited] |
Return a pointer to the
element, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 278 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements.
Referenced by libMesh::ParallelMesh::ParallelMesh().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::elements_begin | ( | ) | const [virtual, inherited] |
const Elem iterator accessor functions.
Implements libMesh::MeshBase.
Definition at line 262 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::elements_begin | ( | ) | [virtual, inherited] |
Elem iterator accessor functions.
Implements libMesh::MeshBase.
Definition at line 37 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::renumber_nodes_and_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 709 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 484 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::renumber_nodes_and_elements().
| void libMesh::UnstructuredMesh::find_neighbors | ( | const bool | reset_remote_elements = false, |
|
| const bool | reset_current_list = true | |||
| ) | [virtual, inherited] |
Other functions from MeshBase requiring re-definition.
Here we look at all of the child elements which don't already have valid neighbors.
If a child element has a NULL neighbor it is either because it is on the boundary or because its neighbor is at a different level. In the latter case we must get the neighbor from the parent.
If a child element has a remote_elem neighbor on a boundary it shares with its parent, that info may have become out-dated through coarsening of the neighbor's parent. In this case, if the parent's neighbor is active then the child should share it.
Furthermore, that neighbor better be active, otherwise we missed a child somewhere.
Implements libMesh::MeshBase.
Definition at line 205 of file unstructured_mesh.C.
References libMesh::MeshBase::_dim, libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::centroid(), libMesh::Elem::child(), libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), end, libMesh::err, libMesh::Elem::has_children(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::Elem::is_child_on_side(), libMesh::Elem::key(), libMesh::Elem::level(), libMesh::MeshBase::level_elements_begin(), libMesh::MeshBase::level_elements_end(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::n_children(), libMesh::MeshTools::n_levels(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor(), libMesh::Elem::parent(), libMesh::MeshBase::processor_id(), libMesh::DofObject::processor_id(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), libMesh::Elem::side(), libMesh::Elem::subactive(), and libMesh::Elem::which_child_am_i().
Referenced by libMesh::TriangleWrapper::copy_tri_to_mesh().
00207 { 00208 // We might actually want to run this on an empty mesh 00209 // (e.g. the boundary mesh for a nonexistant bcid!) 00210 // libmesh_assert_not_equal_to (this->n_nodes(), 0); 00211 // libmesh_assert_not_equal_to (this->n_elem(), 0); 00212 00213 // This function must be run on all processors at once 00214 parallel_only(); 00215 00216 START_LOG("find_neighbors()", "Mesh"); 00217 00218 const element_iterator el_end = this->elements_end(); 00219 00220 //TODO:[BSK] This should be removed later?! 00221 if (reset_current_list) 00222 for (element_iterator el = this->elements_begin(); el != el_end; ++el) 00223 { 00224 Elem* e = *el; 00225 for (unsigned int s=0; s<e->n_neighbors(); s++) 00226 if (e->neighbor(s) != remote_elem || 00227 reset_remote_elements) 00228 e->set_neighbor(s,NULL); 00229 } 00230 00231 // Find neighboring elements by first finding elements 00232 // with identical side keys and then check to see if they 00233 // are neighbors 00234 { 00235 // data structures -- Use the hash_multimap if available 00236 typedef unsigned int key_type; 00237 typedef std::pair<Elem*, unsigned char> val_type; 00238 typedef std::pair<key_type, val_type> key_val_pair; 00239 00240 typedef LIBMESH_BEST_UNORDERED_MULTIMAP<key_type, val_type> map_type; 00241 00242 // A map from side keys to corresponding elements & side numbers 00243 map_type side_to_elem_map; 00244 00245 00246 00247 for (element_iterator el = this->elements_begin(); el != el_end; ++el) 00248 { 00249 Elem* element = *el; 00250 00251 for (unsigned int ms=0; ms<element->n_neighbors(); ms++) 00252 { 00253 next_side: 00254 // If we haven't yet found a neighbor on this side, try. 00255 // Even if we think our neighbor is remote, that 00256 // information may be out of date. 00257 if (element->neighbor(ms) == NULL || 00258 element->neighbor(ms) == remote_elem) 00259 { 00260 // Get the key for the side of this element 00261 const unsigned int key = element->key(ms); 00262 00263 // Look for elements that have an identical side key 00264 std::pair <map_type::iterator, map_type::iterator> 00265 bounds = side_to_elem_map.equal_range(key); 00266 00267 // May be multiple keys, check all the possible 00268 // elements which _might_ be neighbors. 00269 if (bounds.first != bounds.second) 00270 { 00271 // Get the side for this element 00272 const AutoPtr<Elem> my_side(element->side(ms)); 00273 00274 // Look at all the entries with an equivalent key 00275 while (bounds.first != bounds.second) 00276 { 00277 // Get the potential element 00278 Elem* neighbor = bounds.first->second.first; 00279 00280 // Get the side for the neighboring element 00281 const unsigned int ns = bounds.first->second.second; 00282 const AutoPtr<Elem> their_side(neighbor->side(ns)); 00283 //libmesh_assert(my_side.get()); 00284 //libmesh_assert(their_side.get()); 00285 00286 // If found a match with my side 00287 // 00288 // We need special tests here for 1D: 00289 // since parents and children have an equal 00290 // side (i.e. a node), we need to check 00291 // ns != ms, and we also check level() to 00292 // avoid setting our neighbor pointer to 00293 // any of our neighbor's descendants 00294 if( (*my_side == *their_side) && 00295 (element->level() == neighbor->level()) && 00296 ((_dim != 1) || (ns != ms)) ) 00297 { 00298 // So share a side. Is this a mixed pair 00299 // of subactive and active/ancestor 00300 // elements? 00301 // If not, then we're neighbors. 00302 // If so, then the subactive's neighbor is 00303 00304 if (element->subactive() == 00305 neighbor->subactive()) 00306 { 00307 // an element is only subactive if it has 00308 // been coarsened but not deleted 00309 element->set_neighbor (ms,neighbor); 00310 neighbor->set_neighbor(ns,element); 00311 } 00312 else if (element->subactive()) 00313 { 00314 element->set_neighbor(ms,neighbor); 00315 } 00316 else if (neighbor->subactive()) 00317 { 00318 neighbor->set_neighbor(ns,element); 00319 } 00320 side_to_elem_map.erase (bounds.first); 00321 00322 // get out of this nested crap 00323 goto next_side; 00324 } 00325 00326 ++bounds.first; 00327 } 00328 } 00329 00330 // didn't find a match... 00331 // Build the map entry for this element 00332 key_val_pair kvp; 00333 00334 kvp.first = key; 00335 kvp.second.first = element; 00336 kvp.second.second = ms; 00337 00338 // use the lower bound as a hint for 00339 // where to put it. 00340 #if defined(LIBMESH_HAVE_UNORDERED_MAP) || defined(LIBMESH_HAVE_TR1_UNORDERED_MAP) || defined(LIBMESH_HAVE_HASH_MAP) || defined(LIBMESH_HAVE_EXT_HASH_MAP) 00341 side_to_elem_map.insert (kvp); 00342 #else 00343 side_to_elem_map.insert (bounds.first,kvp); 00344 #endif 00345 } 00346 } 00347 } 00348 } 00349 00350 #ifdef LIBMESH_ENABLE_AMR 00351 00372 const unsigned int n_levels = MeshTools::n_levels(*this); 00373 for (unsigned int level = 1; level < n_levels; ++level) 00374 { 00375 element_iterator end = this->level_elements_end(level); 00376 for (element_iterator el = this->level_elements_begin(level); 00377 el != end; ++el) 00378 { 00379 Elem* current_elem = *el; 00380 libmesh_assert(current_elem); 00381 Elem* parent = current_elem->parent(); 00382 libmesh_assert(parent); 00383 const unsigned int my_child_num = parent->which_child_am_i(current_elem); 00384 00385 for (unsigned int s=0; s < current_elem->n_neighbors(); s++) 00386 { 00387 if (current_elem->neighbor(s) == NULL || 00388 (current_elem->neighbor(s) == remote_elem && 00389 parent->is_child_on_side(my_child_num, s))) 00390 { 00391 Elem *neigh = parent->neighbor(s); 00392 00393 // If neigh was refined and had non-subactive children 00394 // made remote earlier, then a non-subactive elem should 00395 // actually have one of those remote children as a 00396 // neighbor 00397 if (neigh && (neigh->ancestor()) && (!current_elem->subactive())) 00398 { 00399 #ifdef DEBUG 00400 // Let's make sure that "had children made remote" 00401 // situation is actually the case 00402 libmesh_assert(neigh->has_children()); 00403 bool neigh_has_remote_children = false; 00404 for (unsigned int c = 0; c != neigh->n_children(); ++c) 00405 { 00406 if (neigh->child(c) == remote_elem) 00407 neigh_has_remote_children = true; 00408 } 00409 libmesh_assert(neigh_has_remote_children); 00410 00411 // And let's double-check that we don't have 00412 // a remote_elem neighboring a local element 00413 libmesh_assert_not_equal_to (current_elem->processor_id(), 00414 libMesh::processor_id()); 00415 #endif // DEBUG 00416 neigh = const_cast<RemoteElem*>(remote_elem); 00417 } 00418 00419 current_elem->set_neighbor(s, neigh); 00420 #ifdef DEBUG 00421 if (neigh != NULL && neigh != remote_elem) 00422 // We ignore subactive elements here because 00423 // we don't care about neighbors of subactive element. 00424 if ((!neigh->active()) && (!current_elem->subactive())) 00425 { 00426 libMesh::err << "On processor " << libMesh::processor_id() 00427 << std::endl; 00428 libMesh::err << "Bad element ID = " << current_elem->id() 00429 << ", Side " << s << ", Bad neighbor ID = " << neigh->id() << std::endl; 00430 libMesh::err << "Bad element proc_ID = " << current_elem->processor_id() 00431 << ", Bad neighbor proc_ID = " << neigh->processor_id() << std::endl; 00432 libMesh::err << "Bad element size = " << current_elem->hmin() 00433 << ", Bad neighbor size = " << neigh->hmin() << std::endl; 00434 libMesh::err << "Bad element center = " << current_elem->centroid() 00435 << ", Bad neighbor center = " << neigh->centroid() << std::endl; 00436 libMesh::err << "ERROR: " 00437 << (current_elem->active()?"Active":"Ancestor") 00438 << " Element at level " 00439 << current_elem->level() << std::endl; 00440 libMesh::err << "with " 00441 << (parent->active()?"active": 00442 (parent->subactive()?"subactive":"ancestor")) 00443 << " parent share " 00444 << (neigh->subactive()?"subactive":"ancestor") 00445 << " neighbor at level " << neigh->level() 00446 << std::endl; 00447 GMVIO(*this).write ("bad_mesh.gmv"); 00448 libmesh_error(); 00449 } 00450 #endif // DEBUG 00451 } 00452 } 00453 } 00454 } 00455 00456 #endif // AMR 00457 00458 00459 #ifdef DEBUG 00460 MeshTools::libmesh_assert_valid_neighbors(*this); 00461 #endif 00462 00463 STOP_LOG("find_neighbors()", "Mesh"); 00464 }
| void libMesh::ParallelMesh::fix_broken_node_and_element_numbering | ( | ) | [virtual, inherited] |
There is no reason for a user to ever call this function.
This function restores a previously broken element/node numbering such that mesh.node(n)->id() == n.
Implements libMesh::MeshBase.
Definition at line 1098 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), libMesh::mapvector< Val, index_t >::end(), and end.
01099 { 01100 // We need access to iterators for the underlying containers, 01101 // not the mapvector<> reimplementations. 01102 mapvector<Node*,dof_id_type>::maptype &nodes = this->_nodes; 01103 mapvector<Elem*,dof_id_type>::maptype &elems = this->_elements; 01104 01105 // Nodes first 01106 { 01107 mapvector<Node*,dof_id_type>::maptype::iterator 01108 it = nodes.begin(), 01109 end = nodes.end(); 01110 01111 for (; it != end; ++it) 01112 if (it->second != NULL) 01113 it->second->set_id() = it->first; 01114 } 01115 01116 // Elements next 01117 { 01118 mapvector<Elem*,dof_id_type>::maptype::iterator 01119 it = elems.begin(), 01120 end = elems.end(); 01121 01122 for (; it != end; ++it) 01123 if (it->second != NULL) 01124 it->second->set_id() = it->first; 01125 } 01126 }
| subdomain_id_type libMesh::MeshBase::get_id_by_name | ( | const std::string & | name | ) | const [inherited] |
Returns a the id of the requested block by name. Throws an error if a block by name is not found
Definition at line 406 of file mesh_base.C.
References libMesh::MeshBase::_block_id_to_name, and libMesh::err.
00407 { 00408 // This function is searching the *values* of the map (linear search) 00409 // We might want to make this more efficient... 00410 std::map<subdomain_id_type, std::string>::const_iterator 00411 iter = _block_id_to_name.begin(), 00412 end_iter = _block_id_to_name.end(); 00413 00414 for ( ; iter != end_iter; ++iter) 00415 { 00416 if (iter->second == name) 00417 return iter->first; 00418 } 00419 00420 libMesh::err << "Block '" << name << "' does not exist in mesh" << std::endl; 00421 libmesh_error(); 00422 }
| std::string libMesh::MeshBase::get_info | ( | ) | const [inherited] |
- Returns:
- a string containing relevant information about the mesh.
Definition at line 270 of file mesh_base.C.
References libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_active_elem(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::MeshBase::n_nodes(), libMesh::MeshBase::n_partitions(), libMesh::MeshBase::n_processors(), libMesh::MeshBase::n_subdomains(), libMesh::n_threads(), libMesh::MeshBase::processor_id(), and libMesh::MeshBase::spatial_dimension().
Referenced by libMesh::MeshBase::print_info().
00271 { 00272 std::ostringstream oss; 00273 00274 oss << " Mesh Information:" << '\n' 00275 << " mesh_dimension()=" << this->mesh_dimension() << '\n' 00276 << " spatial_dimension()=" << this->spatial_dimension() << '\n' 00277 << " n_nodes()=" << this->n_nodes() << '\n' 00278 << " n_local_nodes()=" << this->n_local_nodes() << '\n' 00279 << " n_elem()=" << this->n_elem() << '\n' 00280 << " n_local_elem()=" << this->n_local_elem() << '\n' 00281 #ifdef LIBMESH_ENABLE_AMR 00282 << " n_active_elem()=" << this->n_active_elem() << '\n' 00283 #endif 00284 << " n_subdomains()=" << this->n_subdomains() << '\n' 00285 << " n_partitions()=" << this->n_partitions() << '\n' 00286 << " n_processors()=" << libMesh::n_processors() << '\n' 00287 << " n_threads()=" << libMesh::n_threads() << '\n' 00288 << " processor_id()=" << this->processor_id() << '\n'; 00289 00290 return oss.str(); 00291 }
Insert elem e to the element array, preserving its id and replacing/deleting any existing element with the same id.
Implements libMesh::MeshBase.
Definition at line 415 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::delete_elem(), and libMesh::DofObject::id().
Referenced by libMesh::ParallelMesh::insert_extra_ghost_elem().
00416 { 00417 if (_elements[e->id()]) 00418 this->delete_elem(_elements[e->id()]); 00419 00420 _elements[e->id()] = e; 00421 00422 return e; 00423 }
| void libMesh::ParallelMesh::insert_extra_ghost_elem | ( | Elem * | e | ) | [virtual, inherited] |
Inserts the element _and_ adds it to a list of elements not to get deleted by delete_remote_elements. This is handy for inserting off-processor elements that you want to keep track of on this processor.
Definition at line 1218 of file parallel_mesh.C.
References libMesh::ParallelMesh::_extra_ghost_elems, and libMesh::ParallelMesh::insert_elem().
01219 { 01220 // First insert the elem like normal 01221 insert_elem(e); 01222 01223 // Now add it to the set that won't be deleted when we call 01224 // delete_remote_elements() 01225 _extra_ghost_elems.insert(e); 01226 }
Definition at line 571 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, and libMesh::DofObject::id().
00572 { 00573 // If we already have this node we cannot 00574 // simply delete it, because we may have elements 00575 // which are attached to its address. 00576 // 00577 // Instead, call the Node = Point assignment operator 00578 // to overwrite the spatial coordinates (but keep its 00579 // address), delete the provided node, and return the 00580 // address of the one we already had. 00581 if (_nodes.count(n->id())) 00582 { 00583 Node *my_n = _nodes[n->id()]; 00584 00585 *my_n = static_cast<Point>(*n); 00586 delete n; 00587 n = my_n; 00588 } 00589 else 00590 _nodes[n->id()] = n; 00591 00592 return n; 00593 }
| bool libMesh::MeshBase::is_prepared | ( | ) | const [inline, inherited] |
- Returns:
trueif the mesh has been prepared via a call toprepare_for_use,falseotherwise.
Definition at line 115 of file mesh_base.h.
References libMesh::MeshBase::_is_prepared.
Referenced by libMesh::DofMap::build_sparsity(), libMesh::DofMap::create_dof_constraints(), libMesh::DofMap::distribute_dofs(), and libMesh::DofMap::reinit().
00116 { return _is_prepared; }
| virtual bool libMesh::ParallelMesh::is_serial | ( | ) | const [inline, virtual, inherited] |
- Returns:
trueif all elements and nodes of the mesh exist on the current processor,falseotherwise
Reimplemented from libMesh::MeshBase.
Definition at line 106 of file parallel_mesh.h.
References libMesh::ParallelMesh::_is_serial.
Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::add_node(), libMesh::MeshCommunication::delete_remote_elements(), and libMesh::ParallelMesh::redistribute().
00107 { return _is_serial; }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::level_elements_begin | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 371 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::level_elements_begin | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 147 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::level_elements_end | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 819 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::level_elements_end | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 594 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| void libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags | ( | ) | const [inherited] |
Verify refinement_flag and p_refinement_flag consistency of our elements containers. Calls libmesh_assert() on each possible failure.
Definition at line 781 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::CommWorld, libMesh::invalid_uint, libMesh::Parallel::Communicator::min(), libMesh::Elem::p_refinement_flag(), libMesh::ParallelMesh::parallel_max_elem_id(), and libMesh::Elem::refinement_flag().
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
00782 { 00783 #ifdef LIBMESH_ENABLE_AMR 00784 // This function must be run on all processors at once 00785 parallel_only(); 00786 00787 dof_id_type pmax_elem_id = this->parallel_max_elem_id(); 00788 00789 for (dof_id_type i=0; i != pmax_elem_id; ++i) 00790 { 00791 Elem* el = _elements[i]; // Returns NULL if there's no map entry 00792 00793 unsigned int refinement_flag = el ? 00794 static_cast<unsigned int> (el->refinement_flag()) : libMesh::invalid_uint; 00795 #ifndef NDEBUG 00796 unsigned int p_refinement_flag = el ? 00797 static_cast<unsigned int> (el->p_refinement_flag()) : libMesh::invalid_uint; 00798 #endif 00799 00800 unsigned int min_rflag = refinement_flag; 00801 CommWorld.min(min_rflag); 00802 // All processors with this element should agree on flag 00803 libmesh_assert (!el || min_rflag == refinement_flag); 00804 00805 #ifndef NDEBUG 00806 unsigned int min_pflag = p_refinement_flag; 00807 #endif 00808 // All processors with this element should agree on flag 00809 libmesh_assert (!el || min_pflag == p_refinement_flag); 00810 } 00811 #endif // LIBMESH_ENABLE_AMR 00812 }
| void libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids | ( | ) | const [virtual, inherited] |
Verify id and processor_id consistency of our elements and nodes containers. Calls libmesh_assert() on each possible failure.
Reimplemented from libMesh::MeshBase.
Definition at line 773 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::_nodes, and libMesh::ParallelMesh::libmesh_assert_valid_parallel_object_ids().
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
00774 { 00775 this->libmesh_assert_valid_parallel_object_ids (this->_elements); 00776 this->libmesh_assert_valid_parallel_object_ids (this->_nodes); 00777 }
| void libMesh::ParallelMesh::libmesh_assert_valid_parallel_object_ids | ( | const mapvector< T *, dof_id_type > & | objects | ) | const [inline, inherited] |
Verify id and processor_id consistency of a parallel objects container. Calls libmesh_assert() on each possible failure in that container.
Definition at line 722 of file parallel_mesh.C.
References libMesh::CommWorld, libMesh::DofObject::invalid_id, libMesh::DofObject::invalid_processor_id, std::max(), libMesh::Parallel::Communicator::min(), and libMesh::processor_id().
Referenced by libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids().
00723 { 00724 // This function must be run on all processors at once 00725 parallel_only(); 00726 00727 const dof_id_type pmax_node_id = this->parallel_max_node_id(); 00728 const dof_id_type pmax_elem_id = this->parallel_max_elem_id(); 00729 const dof_id_type pmax_id = std::max(pmax_node_id, pmax_elem_id); 00730 00731 for (dof_id_type i=0; i != pmax_id; ++i) 00732 { 00733 T* obj = objects[i]; // Returns NULL if there's no map entry 00734 00735 dof_id_type dofid = obj && obj->valid_id() ? 00736 obj->id() : DofObject::invalid_id; 00737 // Local lookups by id should return the requested object 00738 libmesh_assert(!obj || obj->id() == i); 00739 00740 dof_id_type min_dofid = dofid; 00741 CommWorld.min(min_dofid); 00742 // All processors with an object should agree on id 00743 libmesh_assert (!obj || dofid == min_dofid); 00744 00745 dof_id_type procid = obj && obj->valid_processor_id() ? 00746 obj->processor_id() : DofObject::invalid_processor_id; 00747 00748 dof_id_type min_procid = procid; 00749 CommWorld.min(min_procid); 00750 00751 // All processors with an object should agree on processor id 00752 libmesh_assert (!obj || procid == min_procid); 00753 00754 // Either: 00755 // 1.) I own this elem (min_procid == libMesh::processor_id()) *and* I have a valid pointer to it (obj != NULL) 00756 // or 00757 // 2.) I don't own this elem (min_procid != libMesh::processor_id()). (In this case I may or may not have a valid pointer to it.) 00758 00759 // Original assert logic 00760 // libmesh_assert (min_procid != libMesh::processor_id() || obj); 00761 00762 // More human-understandable logic... 00763 libmesh_assert ( 00764 ((min_procid == libMesh::processor_id()) && obj) 00765 || 00766 (min_procid != libMesh::processor_id()) 00767 ); 00768 } 00769 }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::local_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 331 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::local_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 107 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::local_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 779 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::local_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 554 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::local_level_elements_begin | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 391 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::local_level_elements_begin | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 167 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::local_level_elements_end | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 839 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::local_level_elements_end | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 614 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::local_nodes_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 991 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::local_nodes_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 951 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::local_nodes_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1071 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::local_nodes_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1031 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::local_not_level_elements_begin | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 401 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::local_not_level_elements_begin | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 177 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::local_not_level_elements_end | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 849 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::local_not_level_elements_end | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 624 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| virtual dof_id_type libMesh::ParallelMesh::max_elem_id | ( | ) | const [inline, virtual, inherited] |
Returns a number greater than or equal to the maximum element id in the mesh.
Implements libMesh::MeshBase.
Definition at line 170 of file parallel_mesh.h.
References libMesh::ParallelMesh::_max_elem_id.
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
00170 { return _max_elem_id; }
| virtual dof_id_type libMesh::ParallelMesh::max_node_id | ( | ) | const [inline, virtual, inherited] |
Returns a number greater than or equal to the maximum node id in the mesh.
Implements libMesh::MeshBase.
Definition at line 166 of file parallel_mesh.h.
References libMesh::ParallelMesh::_max_node_id.
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
00166 { return _max_node_id; }
| unsigned int libMesh::MeshBase::mesh_dimension | ( | ) | const [inline, inherited] |
- Returns:
- the logical dimension of the mesh; i.e. the manifold dimension of the elements in the mesh. If we ever support multi-dimensional meshes (e.g. hexes and quads in the same mesh) then this will return the largest such dimension.
Definition at line 144 of file mesh_base.h.
References libMesh::MeshBase::_dim.
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::HPCoarsenTest::add_projection(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Generation::build_cube(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::EquationSystems::build_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::System::calculate_norm(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::Modification::distort(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::MeshBase::get_info(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::PointLocatorTree::init(), libMesh::LaplaceMeshSmoother::init(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), libMesh::FEInterface::n_vec_dim(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::ProjectSolution::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::MeshFunction::operator()(), libMesh::MeshBase::prepare_for_use(), libMesh::VTKIO::read(), libMesh::Nemesis_IO::read(), libMesh::GMVIO::read(), libMesh::ExodusII_IO::read(), libMesh::System::read_header(), libMesh::UNVIO::read_implementation(), libMesh::LegacyXdrIO::read_mesh(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::MeshTools::Modification::rotate(), libMesh::HPCoarsenTest::select_refinement(), libMesh::MeshTools::Modification::smooth(), libMesh::BoundaryInfo::sync(), libMesh::DofMap::use_coupled_neighbor_dofs(), libMesh::PostscriptIO::write(), libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::TecplotIO::write_binary(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::EnsightIO::write_scalar_ascii(), libMesh::GnuPlotIO::write_solution(), libMesh::DivaIO::write_stream(), and libMesh::EnsightIO::write_vector_ascii().
00145 { return static_cast<unsigned int>(_dim); }
| dof_id_type libMesh::ParallelMesh::n_active_elem | ( | ) | const [virtual, inherited] |
Returns the number of active elements in the mesh. Implemented in terms of active_element_iterators.
Implements libMesh::MeshBase.
Definition at line 1130 of file parallel_mesh.C.
References libMesh::ParallelMesh::active_local_elements_begin(), libMesh::ParallelMesh::active_local_elements_end(), libMesh::ParallelMesh::active_pid_elements_begin(), libMesh::ParallelMesh::active_pid_elements_end(), libMesh::CommWorld, libMesh::DofObject::invalid_processor_id, and libMesh::Parallel::Communicator::sum().
01131 { 01132 parallel_only(); 01133 01134 // Get local active elements first 01135 dof_id_type active_elements = 01136 static_cast<dof_id_type>(std::distance (this->active_local_elements_begin(), 01137 this->active_local_elements_end())); 01138 CommWorld.sum(active_elements); 01139 01140 // Then add unpartitioned active elements, which should exist on 01141 // every processor 01142 active_elements += 01143 static_cast<dof_id_type>(std::distance 01144 (this->active_pid_elements_begin(DofObject::invalid_processor_id), 01145 this->active_pid_elements_end(DofObject::invalid_processor_id))); 01146 return active_elements; 01147 }
| dof_id_type libMesh::MeshBase::n_active_elem_on_proc | ( | const processor_id_type | proc | ) | const [inherited] |
Returns the number of active elements on processor proc.
Definition at line 231 of file mesh_base.C.
References libMesh::MeshBase::active_pid_elements_begin(), libMesh::MeshBase::active_pid_elements_end(), and libMesh::n_processors().
Referenced by libMesh::MeshBase::n_active_local_elem().
00232 { 00233 libmesh_assert_less (proc_id, libMesh::n_processors()); 00234 return static_cast<dof_id_type>(std::distance (this->active_pid_elements_begin(proc_id), 00235 this->active_pid_elements_end (proc_id))); 00236 }
| dof_id_type libMesh::MeshBase::n_active_local_elem | ( | ) | const [inline, inherited] |
Returns the number of active elements on the local processor.
Definition at line 277 of file mesh_base.h.
References libMesh::MeshBase::n_active_elem_on_proc(), and libMesh::processor_id().
Referenced by libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::ParmetisPartitioner::build_graph(), libMesh::VTKIO::cells_to_vtk(), and libMesh::ParmetisPartitioner::initialize().
00278 { return this->n_active_elem_on_proc (libMesh::processor_id()); }
| dof_id_type libMesh::MeshBase::n_active_sub_elem | ( | ) | const [inherited] |
Same, but only counts active elements.
Definition at line 255 of file mesh_base.C.
References libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), and end.
Referenced by libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_old_impl(), and libMesh::TecplotIO::write_binary().
00256 { 00257 dof_id_type ne=0; 00258 00259 const_element_iterator el = this->active_elements_begin(); 00260 const const_element_iterator end = this->active_elements_end(); 00261 00262 for (; el!=end; ++el) 00263 ne += (*el)->n_sub_elem(); 00264 00265 return ne; 00266 }
| virtual dof_id_type libMesh::ParallelMesh::n_elem | ( | ) | const [inline, virtual, inherited] |
Returns the number of elements in the mesh. The standard n_elem() function may return a cached value on distributed meshes, and so can be called by any processor at any time.
Implements libMesh::MeshBase.
Definition at line 168 of file parallel_mesh.h.
References libMesh::ParallelMesh::_n_elem.
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
00168 { return _n_elem; }
| dof_id_type libMesh::MeshBase::n_elem_on_proc | ( | const processor_id_type | proc | ) | const [inherited] |
Returns the number of elements on processor proc.
Definition at line 218 of file mesh_base.C.
References libMesh::DofObject::invalid_processor_id, libMesh::n_processors(), libMesh::MeshBase::pid_elements_begin(), and libMesh::MeshBase::pid_elements_end().
Referenced by libMesh::MeshBase::n_local_elem(), and libMesh::MeshBase::n_unpartitioned_elem().
00219 { 00220 // We're either counting a processor's elements or unpartitioned 00221 // elements 00222 libmesh_assert (proc_id < libMesh::n_processors() || 00223 proc_id == DofObject::invalid_processor_id); 00224 00225 return static_cast<dof_id_type>(std::distance (this->pid_elements_begin(proc_id), 00226 this->pid_elements_end (proc_id))); 00227 }
| dof_id_type libMesh::MeshBase::n_local_elem | ( | ) | const [inline, inherited] |
Returns the number of elements on the local processor.
Definition at line 260 of file mesh_base.h.
References libMesh::MeshBase::n_elem_on_proc(), and libMesh::processor_id().
Referenced by libMesh::MeshBase::get_info(), and libMesh::ParallelMesh::parallel_n_elem().
00261 { return this->n_elem_on_proc (libMesh::processor_id()); }
| dof_id_type libMesh::MeshBase::n_local_nodes | ( | ) | const [inline, inherited] |
Returns the number of nodes on the local processor.
Definition at line 186 of file mesh_base.h.
References libMesh::MeshBase::n_nodes_on_proc(), and libMesh::processor_id().
Referenced by libMesh::MeshBase::get_info(), libMesh::VTKIO::nodes_to_vtk(), and libMesh::ParallelMesh::parallel_n_nodes().
00187 { return this->n_nodes_on_proc (libMesh::processor_id()); }
| virtual dof_id_type libMesh::ParallelMesh::n_nodes | ( | ) | const [inline, virtual, inherited] |
Returns the number of nodes in the mesh. This function and others must be defined in derived classes since the MeshBase class has no specific storage for nodes or elements. The standard n_nodes() function may return a cached value on distributed meshes, and so can be called by any processor at any time.
Implements libMesh::MeshBase.
Definition at line 165 of file parallel_mesh.h.
References libMesh::ParallelMesh::_n_nodes.
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
00165 { return _n_nodes; }
| dof_id_type libMesh::MeshBase::n_nodes_on_proc | ( | const processor_id_type | proc | ) | const [inherited] |
Returns the number of nodes on processor proc.
Definition at line 205 of file mesh_base.C.
References libMesh::DofObject::invalid_processor_id, libMesh::n_processors(), libMesh::MeshBase::pid_nodes_begin(), and libMesh::MeshBase::pid_nodes_end().
Referenced by libMesh::MeshBase::n_local_nodes(), and libMesh::MeshBase::n_unpartitioned_nodes().
00206 { 00207 // We're either counting a processor's nodes or unpartitioned 00208 // nodes 00209 libmesh_assert (proc_id < libMesh::n_processors() || 00210 proc_id == DofObject::invalid_processor_id); 00211 00212 return static_cast<dof_id_type>(std::distance (this->pid_nodes_begin(proc_id), 00213 this->pid_nodes_end (proc_id))); 00214 }
| unsigned int libMesh::MeshBase::n_partitions | ( | ) | const [inline, inherited] |
Returns the number of partitions which have been defined via a call to either mesh.partition() or by building a Partitioner object and calling partition. Note that the partitioner objects are responsible for setting this value.
Definition at line 543 of file mesh_base.h.
References libMesh::MeshBase::_n_parts.
Referenced by libMesh::MeshBase::get_info(), libMesh::Partitioner::set_node_processor_ids(), libMesh::BoundaryInfo::sync(), libMesh::UnstructuredMesh::write(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().
00544 { return _n_parts; }
| processor_id_type libMesh::MeshBase::n_processors | ( | ) | const [inline, inherited] |
- Returns:
- the number of processors used in the current simulation.
Definition at line 550 of file mesh_base.h.
Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::clear(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshBase::get_info(), libMesh::UnstructuredMesh::read(), libMesh::ParallelMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), and libMesh::GMVIO::write_discontinuous_gmv().
00551 { return libmesh_cast_int<processor_id_type>(libMesh::n_processors()); }
| dof_id_type libMesh::MeshBase::n_sub_elem | ( | ) | const [inherited] |
This function returns the number of elements that will be written out in the Tecplot format. For example, a 9-noded quadrilateral will be broken into 4 linear sub-elements for plotting purposes. Thus, for a mesh of 2 QUAD9 elements n_tecplot_elem() will return 8. Implemented in terms of element_iterators.
Definition at line 240 of file mesh_base.C.
References libMesh::MeshBase::elements_begin(), libMesh::MeshBase::elements_end(), and end.
00241 { 00242 dof_id_type ne=0; 00243 00244 const_element_iterator el = this->elements_begin(); 00245 const const_element_iterator end = this->elements_end(); 00246 00247 for (; el!=end; ++el) 00248 ne += (*el)->n_sub_elem(); 00249 00250 return ne; 00251 }
| subdomain_id_type libMesh::MeshBase::n_subdomains | ( | ) | const [inherited] |
Returns the number of subdomains in the global mesh. Subdomains correspond to separate subsets of the mesh which could correspond e.g. to different materials in a solid mechanics application, or regions where different physical processes are important. The subdomain mapping is independent from the parallel decomposition.
Definition at line 190 of file mesh_base.C.
References libMesh::MeshBase::subdomain_ids().
Referenced by libMesh::MeshBase::get_info(), libMesh::XdrIO::write(), and libMesh::UnstructuredMesh::write().
00191 { 00192 // This requires an inspection on every processor 00193 parallel_only(); 00194 00195 std::set<subdomain_id_type> ids; 00196 00197 this->subdomain_ids (ids); 00198 00199 return ids.size(); 00200 }
| dof_id_type libMesh::MeshBase::n_unpartitioned_elem | ( | ) | const [inline, inherited] |
Returns the number of elements owned by no processor.
Definition at line 266 of file mesh_base.h.
References libMesh::DofObject::invalid_processor_id, and libMesh::MeshBase::n_elem_on_proc().
Referenced by libMesh::ParallelMesh::parallel_n_elem().
00267 { return this->n_elem_on_proc (DofObject::invalid_processor_id); }
| dof_id_type libMesh::MeshBase::n_unpartitioned_nodes | ( | ) | const [inline, inherited] |
Returns the number of nodes owned by no processor.
Definition at line 192 of file mesh_base.h.
References libMesh::DofObject::invalid_processor_id, and libMesh::MeshBase::n_nodes_on_proc().
Referenced by libMesh::ParallelMesh::parallel_n_nodes().
00193 { return this->n_nodes_on_proc (DofObject::invalid_processor_id); }
| Node & libMesh::ParallelMesh::node | ( | const dof_id_type | i | ) | [virtual, inherited] |
Return a reference to the
node, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 214 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes.
| const Node & libMesh::ParallelMesh::node | ( | const dof_id_type | i | ) | const [virtual, inherited] |
Return a constant reference (for reading only) to the
node, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 202 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes.
| Node * libMesh::ParallelMesh::node_ptr | ( | const dof_id_type | i | ) | [virtual, inherited] |
Return a writeable pointer to the
node, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 235 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes.
| const Node * libMesh::ParallelMesh::node_ptr | ( | const dof_id_type | i | ) | const [virtual, inherited] |
Return a pointer to the
node, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 224 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes.
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::nodes_begin | ( | ) | const [virtual, inherited] |
const Node iterator accessor functions.
Implements libMesh::MeshBase.
Definition at line 971 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::nodes_begin | ( | ) | [virtual, inherited] |
non-const Node iterator accessor functions.
Implements libMesh::MeshBase.
Definition at line 931 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::nodes_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1051 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::nodes_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1011 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_active_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 281 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_active_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 57 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_active_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 729 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_active_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 504 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_ancestor_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 301 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_ancestor_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 77 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_ancestor_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 749 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_ancestor_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 524 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_level_elements_begin | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 381 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_level_elements_begin | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 157 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_level_elements_end | ( | const unsigned int | level | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 829 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_level_elements_end | ( | const unsigned int | level | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 604 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_local_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 341 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_local_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 117 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_local_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 789 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_local_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 564 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_subactive_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 321 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_subactive_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 97 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::not_subactive_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 769 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::not_subactive_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 544 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| dof_id_type libMesh::ParallelMesh::parallel_max_elem_id | ( | ) | const [inherited] |
Definition at line 151 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::CommWorld, and libMesh::Parallel::Communicator::max().
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_parallel_id_counts().
00152 { 00153 // This function must be run on all processors at once 00154 parallel_only(); 00155 00156 dof_id_type max_local = _elements.empty() ? 00157 0 : _elements.rbegin()->first + 1; 00158 CommWorld.max(max_local); 00159 return max_local; 00160 }
| dof_id_type libMesh::ParallelMesh::parallel_max_node_id | ( | ) | const [inherited] |
Definition at line 177 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, libMesh::CommWorld, and libMesh::Parallel::Communicator::max().
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_parallel_id_counts().
00178 { 00179 // This function must be run on all processors at once 00180 parallel_only(); 00181 00182 dof_id_type max_local = _nodes.empty() ? 00183 0 : _nodes.rbegin()->first + 1; 00184 CommWorld.max(max_local); 00185 return max_local; 00186 }
| dof_id_type libMesh::ParallelMesh::parallel_n_elem | ( | ) | const [virtual, inherited] |
Returns the number of elements in the mesh. The parallel_n_elem() function returns a newly calculated parallel-synchronized value on distributed meshes, and so must be called in parallel only.
Implements libMesh::MeshBase.
Definition at line 138 of file parallel_mesh.C.
References libMesh::CommWorld, libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_unpartitioned_elem(), and libMesh::Parallel::Communicator::sum().
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_parallel_id_counts().
00139 { 00140 // This function must be run on all processors at once 00141 parallel_only(); 00142 00143 dof_id_type n_local = this->n_local_elem(); 00144 CommWorld.sum(n_local); 00145 n_local += this->n_unpartitioned_elem(); 00146 return n_local; 00147 }
| dof_id_type libMesh::ParallelMesh::parallel_n_nodes | ( | ) | const [virtual, inherited] |
Returns the number of nodes in the mesh. This function and others must be defined in derived classes since the MeshBase class has no specific storage for nodes or elements. The parallel_n_nodes() function returns a newly calculated parallel-synchronized value on distributed meshes, and so must be called in parallel only.
Implements libMesh::MeshBase.
Definition at line 164 of file parallel_mesh.C.
References libMesh::CommWorld, libMesh::MeshBase::n_local_nodes(), libMesh::MeshBase::n_unpartitioned_nodes(), and libMesh::Parallel::Communicator::sum().
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_parallel_id_counts().
00165 { 00166 // This function must be run on all processors at once 00167 parallel_only(); 00168 00169 dof_id_type n_local = this->n_local_nodes(); 00170 CommWorld.sum(n_local); 00171 n_local += this->n_unpartitioned_nodes(); 00172 return n_local; 00173 }
| void libMesh::MeshBase::partition | ( | const unsigned int | n_parts = libMesh::n_processors() |
) | [virtual, inherited] |
Call the default partitioner (currently metis_partition()).
Definition at line 308 of file mesh_base.C.
References libMesh::MeshBase::is_serial(), libMesh::MeshBase::partitioner(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshBase::skip_partitioning(), and libMesh::MeshBase::update_post_partitioning().
Referenced by libMesh::MeshBase::prepare_for_use().
00309 { 00310 // NULL partitioner means don't partition 00311 // Non-serial meshes aren't ready for partitioning yet. 00312 if(!skip_partitioning() && 00313 partitioner().get() && 00314 this->is_serial()) 00315 { 00316 partitioner()->partition (*this, n_parts); 00317 } 00318 else 00319 { 00320 // Make sure locally cached partition count 00321 this->recalculate_n_partitions(); 00322 00323 // Make sure any other locally cached data is correct 00324 this->update_post_partitioning(); 00325 } 00326 }
| virtual AutoPtr<Partitioner>& libMesh::MeshBase::partitioner | ( | ) | [inline, virtual, inherited] |
A partitioner to use at each prepare_for_use()
Definition at line 104 of file mesh_base.h.
References libMesh::MeshBase::_partitioner.
Referenced by libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::MeshBase::partition(), and libMesh::BoundaryInfo::sync().
00104 { return _partitioner; }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::pid_elements_begin | ( | const processor_id_type | proc_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 411 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::pid_elements_begin | ( | const processor_id_type | proc_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 187 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::unpartitioned_elements_begin().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::pid_elements_end | ( | const processor_id_type | proc_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 858 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::pid_elements_end | ( | const processor_id_type | proc_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 634 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
Referenced by libMesh::ParallelMesh::unpartitioned_elements_end().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::pid_nodes_begin | ( | const processor_id_type | proc_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1001 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::pid_nodes_begin | ( | const processor_id_type | proc_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 961 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_node_iterator libMesh::ParallelMesh::pid_nodes_end | ( | const processor_id_type | proc_id | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1081 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::node_iterator libMesh::ParallelMesh::pid_nodes_end | ( | const processor_id_type | proc_id | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 1041 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_nodes, and libMesh::mapvector< Val, index_t >::end().
| const Point & libMesh::ParallelMesh::point | ( | const dof_id_type | i | ) | const [virtual, inherited] |
Return a constant reference (for reading only) to the
point, which should be present in this processor's subset of the mesh data structure.
Implements libMesh::MeshBase.
Definition at line 190 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes.
| const PointLocatorBase & libMesh::MeshBase::point_locator | ( | ) | const [inherited] |
returns a pointer to a PointLocatorBase object for this mesh, constructing a master PointLocator first if necessary. This should never be used in threaded or non-parallel_only code, and so is deprecated.
Definition at line 348 of file mesh_base.C.
References libMesh::MeshBase::_point_locator, libMesh::PointLocatorBase::build(), libMesh::AutoPtr< Tp >::get(), libMesh::Threads::in_threads, libMesh::AutoPtr< Tp >::reset(), and libMeshEnums::TREE.
00349 { 00350 libmesh_deprecated(); 00351 00352 if (_point_locator.get() == NULL) 00353 { 00354 // PointLocator construction may not be safe within threads 00355 libmesh_assert(!Threads::in_threads); 00356 00357 _point_locator.reset (PointLocatorBase::build(TREE, *this).release()); 00358 } 00359 00360 return *_point_locator; 00361 }
| void libMesh::MeshBase::prepare_for_use | ( | const bool | skip_renumber_nodes_and_elements = false |
) | [inherited] |
Prepare a newly created (or read) mesh for use. This involves 3 steps: 1.) call find_neighbors() 2.) call partition() 3.) call renumber_nodes_and_elements()
The argument to skip renumbering is now deprecated - to prevent a mesh from being renumbered, set allow_renumbering(false).
Definition at line 90 of file mesh_base.C.
References libMesh::MeshBase::_is_prepared, libMesh::MeshBase::_skip_renumber_nodes_and_elements, libMesh::MeshBase::allow_renumbering(), libMesh::MeshBase::clear_point_locator(), libMesh::CommWorld, libMesh::MeshBase::delete_remote_elements(), libMesh::MeshBase::find_neighbors(), libMesh::MeshBase::is_serial(), libMesh::Parallel::Communicator::max(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::partition(), libMesh::MeshBase::renumber_nodes_and_elements(), libMesh::MeshBase::set_mesh_dimension(), libMesh::MeshBase::update_parallel_id_counts(), and libMesh::Parallel::Communicator::verify().
Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::MeshRefinement::coarsen_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::UnstructuredMesh::read(), libMesh::GMVIO::read(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::SerialMesh::stitch_meshes(), libMesh::BoundaryInfo::sync(), libMesh::MeshRefinement::uniformly_coarsen(), and libMesh::MeshRefinement::uniformly_refine().
00091 { 00092 parallel_only(); 00093 00094 // A distributed mesh may have processors with no elements (or 00095 // processors with no elements of higher dimension, if we ever 00096 // support mixed-dimension meshes), but we want consistent 00097 // mesh_dimension anyways. 00098 libmesh_assert(CommWorld.verify(this->is_serial())); 00099 00100 if (!this->is_serial()) 00101 { 00102 unsigned int dim = this->mesh_dimension(); 00103 CommWorld.max(dim); 00104 this->set_mesh_dimension(dim); 00105 } 00106 00107 // Renumber the nodes and elements so that they in contiguous 00108 // blocks. By default, _skip_renumber_nodes_and_elements is false. 00109 // 00110 // We may currently change that by passing 00111 // skip_renumber_nodes_and_elements==true to this function, but we 00112 // should use the allow_renumbering() accessor instead. 00113 // 00114 // Instances where you if prepare_for_use() should not renumber the nodes 00115 // and elements include reading in e.g. an xda/r or gmv file. In 00116 // this case, the ordering of the nodes may depend on an accompanying 00117 // solution, and the node ordering cannot be changed. 00118 00119 if (skip_renumber_nodes_and_elements) 00120 { 00121 libmesh_deprecated(); 00122 this->allow_renumbering(false); 00123 } 00124 00125 // Mesh modification operations might not leave us with consistent 00126 // id counts, but our partitioner might need that consistency. 00127 if(!_skip_renumber_nodes_and_elements) 00128 this->renumber_nodes_and_elements(); 00129 else 00130 this->update_parallel_id_counts(); 00131 00132 // Let all the elements find their neighbors 00133 this->find_neighbors(); 00134 00135 // Partition the mesh. 00136 this->partition(); 00137 00138 // If we're using ParallelMesh, we'll want it parallelized. 00139 this->delete_remote_elements(); 00140 00141 if(!_skip_renumber_nodes_and_elements) 00142 this->renumber_nodes_and_elements(); 00143 00144 // Reset our PointLocator. This needs to happen any time the elements 00145 // in the underlying elements in the mesh have changed, so we do it here. 00146 this->clear_point_locator(); 00147 00148 // The mesh is now prepared for use. 00149 _is_prepared = true; 00150 }
| void libMesh::MeshBase::print_info | ( | std::ostream & | os = libMesh::out |
) | const [inherited] |
Prints relevant information about the mesh.
Definition at line 294 of file mesh_base.C.
References libMesh::MeshBase::get_info().
Referenced by libMesh::InfElemBuilder::build_inf_elem(), and libMesh::operator<<().
00295 { 00296 os << this->get_info() 00297 << std::endl; 00298 }
| processor_id_type libMesh::MeshBase::processor_id | ( | ) | const [inline, inherited] |
- Returns:
- the subdomain id for this processor.
Definition at line 556 of file mesh_base.h.
Referenced by libMesh::UnstructuredMesh::all_second_order(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::DofMap::build_sparsity(), libMesh::ParallelMesh::clear(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshBase::get_info(), libMesh::SparsityPattern::Build::join(), libMesh::SparsityPattern::Build::operator()(), libMesh::UnstructuredMesh::read(), libMesh::MeshData::read_xdr(), libMesh::GMVIO::write_discontinuous_gmv(), and libMesh::System::write_header().
00557 { return libmesh_cast_int<processor_id_type>(libMesh::processor_id()); }
| Elem * libMesh::ParallelMesh::query_elem | ( | const dof_id_type | i | ) | [virtual, inherited] |
Return a writeable pointer to the
element, or NULL if no such element exists in this processor's mesh data structure.
Implements libMesh::MeshBase.
Definition at line 316 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::end(), and libMesh::DofObject::id().
| const Elem * libMesh::ParallelMesh::query_elem | ( | const dof_id_type | i | ) | const [virtual, inherited] |
Return a pointer to the
element, or NULL if no such element exists in this processor's mesh data structure.
Implements libMesh::MeshBase.
Definition at line 300 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::end(), and libMesh::DofObject::id().
| Node * libMesh::ParallelMesh::query_node_ptr | ( | const dof_id_type | i | ) | [virtual, inherited] |
Return a writeable pointer to the
node, or NULL if no such node exists in this processor's mesh data structure.
Implements libMesh::MeshBase.
Definition at line 262 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::end(), and libMesh::DofObject::id().
| const Node * libMesh::ParallelMesh::query_node_ptr | ( | const dof_id_type | i | ) | const [virtual, inherited] |
Return a pointer to the
node, or NULL if no such node exists in this processor's mesh data structure.
Implements libMesh::MeshBase.
Definition at line 246 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::end(), and libMesh::DofObject::id().
| void libMesh::UnstructuredMesh::read | ( | const std::string & | name, | |
| MeshData * | mesh_data = NULL, |
|||
| bool | skip_renumber_nodes_and_elements = false | |||
| ) | [virtual, inherited] |
Reads the file specified by name. Attempts to figure out the proper method by the file extension. This is now the only way to read a mesh. The UnstructuredMesh then initializes its data structures and is ready for use.
In order to read the UNV and TetGen file types, you must also pass a separate pointer to the MeshData object you will use with this mesh, since these read methods expect it.
The skip_renumber_nodes_and_elements argument is now deprecated - to disallow renumbering, set MeshBase::allow_renumbering(false)
Implements libMesh::MeshBase.
Definition at line 468 of file unstructured_mesh.C.
References libMesh::MeshBase::allow_renumbering(), libMesh::XdrIO::binary(), libMesh::err, libMesh::XdrIO::legacy(), libMesh::MeshBase::n_processors(), libMesh::MeshBase::prepare_for_use(), libMesh::processor_id(), libMesh::MeshBase::processor_id(), and libMesh::XdrIO::read().
00471 { 00472 // See if the file exists. Perform this check on all processors 00473 // so that the code is terminated properly in the case that the 00474 // file does not exist. 00475 00476 // For Nemesis files, the name we try to read will have suffixes 00477 // identifying processor rank 00478 if (name.rfind(".nem") + 4 == name.size() || 00479 name.rfind(".n") + 2 == name.size()) 00480 { 00481 std::ostringstream full_name; 00482 full_name << name << '.' << libMesh::n_processors() << '.' << libMesh::processor_id(); 00483 00484 std::ifstream in (full_name.str().c_str()); 00485 00486 if (!in.good()) 00487 { 00488 libMesh::err << "ERROR: cannot locate specified file:\n\t" 00489 << full_name.str() 00490 << std::endl; 00491 libmesh_error(); 00492 } 00493 } 00494 else 00495 { 00496 std::ifstream in (name.c_str()); 00497 00498 if (!in.good()) 00499 { 00500 libMesh::err << "ERROR: cannot locate specified file:\n\t" 00501 << name 00502 << std::endl; 00503 libmesh_error(); 00504 } 00505 } 00506 00507 // Set the skip_renumber_nodes_and_elements flag on all processors. 00508 // This ensures that renumber_nodes_and_elements is *not* called 00509 // during prepare_for_use() for certain types of mesh files. 00510 // This is required in cases where there is an associated solution 00511 // file which expects a certain ordering of the nodes. 00512 if(name.rfind(".gmv")+4==name.size()) 00513 { 00514 skip_renumber_nodes_and_elements = true; 00515 } 00516 00517 // Look for parallel formats first 00518 if (is_parallel_file_format(name)) 00519 { 00520 // no need to handle bz2 files here -- the Xdr class does that. 00521 if ((name.rfind(".xda") < name.size()) || 00522 (name.rfind(".xdr") < name.size())) 00523 { 00524 XdrIO xdr_io(*this); 00525 00526 // .xda* ==> bzip2/gzip/ASCII flavors 00527 if (name.rfind(".xda") < name.size()) 00528 { 00529 xdr_io.binary() = false; 00530 xdr_io.read (name); 00531 } 00532 else // .xdr* ==> true binary XDR file 00533 { 00534 xdr_io.binary() = true; 00535 xdr_io.read (name); 00536 } 00537 00538 // The xdr_io object gets constructed with legacy() == false. 00539 // if legacy() == true then it means that a legacy file was detected and 00540 // thus processor 0 performed the read. We therefore need to broadcast the 00541 // mesh. Further, for this flavor of mesh solution data ordering is tied 00542 // to the node ordering, so we better not reorder the nodes! 00543 if (xdr_io.legacy()) 00544 { 00545 this->allow_renumbering(false); 00546 MeshCommunication().broadcast(*this); 00547 } 00548 00549 // libHilbert-enabled libMesh builds should construct files 00550 // with a canonical node ordering, which libHilbert-enabled 00551 // builds will be able to read in again regardless of any 00552 // renumbering. So in that case we're free to renumber. 00553 // However, if either the writer or the reader of this file 00554 // don't have libHilbert, then we'll have to skip 00555 // renumbering because we need the numbering to remain 00556 // consistent with any solution file we read in next. 00557 #ifdef LIBMESH_HAVE_LIBHILBERT 00558 // if (!xdr_io.libhilbert_ordering()) 00559 // skip_renumber_nodes_and_elements = true; 00560 #else 00561 this->allow_renumbering(false); 00562 #endif 00563 } 00564 else if (name.rfind(".nem") < name.size() || 00565 name.rfind(".n") < name.size()) 00566 Nemesis_IO(*this).read (name); 00567 00568 } 00569 00570 // Serial mesh formats 00571 else 00572 { 00573 START_LOG("read()", "Mesh"); 00574 00575 // Read the file based on extension. Only processor 0 00576 // needs to read the mesh. It will then broadcast it and 00577 // the other processors will pick it up 00578 if (libMesh::processor_id() == 0) 00579 { 00580 std::ostringstream pid_suffix; 00581 pid_suffix << '_' << getpid(); 00582 // Nasty hack for reading/writing zipped files 00583 std::string new_name = name; 00584 if (name.size() - name.rfind(".bz2") == 4) 00585 { 00586 #ifdef LIBMESH_HAVE_BZIP 00587 new_name.erase(new_name.end() - 4, new_name.end()); 00588 new_name += pid_suffix.str(); 00589 std::string system_string = "bunzip2 -f -k -c "; 00590 system_string += name + " > " + new_name; 00591 START_LOG("system(bunzip2)", "Mesh"); 00592 if (std::system(system_string.c_str())) 00593 libmesh_file_error(system_string); 00594 STOP_LOG("system(bunzip2)", "Mesh"); 00595 #else 00596 libMesh::err << "ERROR: need bzip2/bunzip2 to open .bz2 file " 00597 << name << std::endl; 00598 libmesh_error(); 00599 #endif 00600 } 00601 else if (name.size() - name.rfind(".xz") == 3) 00602 { 00603 #ifdef LIBMESH_HAVE_XZ 00604 new_name.erase(new_name.end() - 3, new_name.end()); 00605 new_name += pid_suffix.str(); 00606 std::string system_string = "xz -f -d -k -c "; 00607 system_string += name + " > " + new_name; 00608 START_LOG("system(xz -d)", "XdrIO"); 00609 if (std::system(system_string.c_str())) 00610 libmesh_file_error(system_string); 00611 STOP_LOG("system(xz -d)", "XdrIO"); 00612 #else 00613 libMesh::err << "ERROR: need xz to open .xz file " 00614 << name << std::endl; 00615 libmesh_error(); 00616 #endif 00617 } 00618 00619 if (new_name.rfind(".mat") < new_name.size()) 00620 MatlabIO(*this).read(new_name); 00621 00622 else if (new_name.rfind(".ucd") < new_name.size()) 00623 UCDIO(*this).read (new_name); 00624 00625 else if ((new_name.rfind(".off") < new_name.size()) || 00626 (new_name.rfind(".ogl") < new_name.size()) || 00627 (new_name.rfind(".oogl") < new_name.size())) 00628 OFFIO(*this).read (new_name); 00629 00630 else if (new_name.rfind(".mgf") < new_name.size()) 00631 LegacyXdrIO(*this,true).read_mgf (new_name); 00632 00633 else if (new_name.rfind(".unv") < new_name.size()) 00634 { 00635 if (mesh_data == NULL) 00636 { 00637 libMesh::err << "Error! You must pass a " 00638 << "valid MeshData pointer to " 00639 << "read UNV files!" << std::endl; 00640 libmesh_error(); 00641 } 00642 UNVIO(*this, *mesh_data).read (new_name); 00643 } 00644 00645 else if ((new_name.rfind(".node") < new_name.size()) || 00646 (new_name.rfind(".ele") < new_name.size())) 00647 TetGenIO(*this,mesh_data).read (new_name); 00648 00649 else if (new_name.rfind(".exd") < new_name.size() || 00650 new_name.rfind(".e") < new_name.size()) 00651 ExodusII_IO(*this).read (new_name); 00652 00653 else if (new_name.rfind(".msh") < new_name.size()) 00654 GmshIO(*this).read (new_name); 00655 00656 else if (new_name.rfind(".gmv") < new_name.size()) 00657 GMVIO(*this).read (new_name); 00658 00659 else if (new_name.rfind(".vtu") < new_name.size()) 00660 VTKIO(*this).read(new_name); 00661 00662 else if (new_name.rfind(".inp") < new_name.size()) 00663 AbaqusIO(*this).read(new_name); 00664 00665 else 00666 { 00667 libMesh::err << " ERROR: Unrecognized file extension: " << name 00668 << "\n I understand the following:\n\n" 00669 << " *.e -- Sandia's ExodusII format\n" 00670 << " *.exd -- Sandia's ExodusII format\n" 00671 << " *.gmv -- LANL's General Mesh Viewer format\n" 00672 << " *.mat -- Matlab triangular ASCII file\n" 00673 << " *.n -- Sandia's Nemesis format\n" 00674 << " *.nem -- Sandia's Nemesis format\n" 00675 << " *.off -- OOGL OFF surface format\n" 00676 << " *.ucd -- AVS's ASCII UCD format\n" 00677 << " *.unv -- I-deas Universal format\n" 00678 << " *.vtu -- Paraview VTK format\n" 00679 << " *.inp -- Abaqus .inp format\n" 00680 << " *.xda -- libMesh ASCII format\n" 00681 << " *.xdr -- libMesh binary format\n" 00682 << " *.gz -- any above format gzipped\n" 00683 << " *.bz2 -- any above format bzip2'ed\n" 00684 << " *.xz -- any above format xzipped\n" 00685 00686 << std::endl; 00687 libmesh_error(); 00688 } 00689 00690 // If we temporarily decompressed a file, remove the 00691 // uncompressed version 00692 if (name.size() - name.rfind(".bz2") == 4) 00693 std::remove(new_name.c_str()); 00694 if (name.size() - name.rfind(".xz") == 3) 00695 std::remove(new_name.c_str()); 00696 } 00697 00698 00699 STOP_LOG("read()", "Mesh"); 00700 00701 // Send the mesh & bcs (which are now only on processor 0) to the other 00702 // processors 00703 MeshCommunication().broadcast (*this); 00704 } 00705 00706 if (skip_renumber_nodes_and_elements) 00707 { 00708 // Use MeshBase::allow_renumbering() yourself instead. 00709 libmesh_deprecated(); 00710 this->allow_renumbering(false); 00711 } 00712 00713 // Done reading the mesh. Now prepare it for use. 00714 this->prepare_for_use(); 00715 }
| unsigned int libMesh::MeshBase::recalculate_n_partitions | ( | ) | [inherited] |
In a few (very rare) cases, the user may have manually tagged the elements with specific processor IDs by hand, without using a partitioner. In this case, the Mesh will not know that the total number of partitions, _n_parts, has changed, unless you call this function. This is an O(N active elements) calculation. The return value is the number of partitions, and _n_parts is also set by this function.
Definition at line 328 of file mesh_base.C.
References libMesh::MeshBase::_n_parts, libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), libMesh::CommWorld, end, libMesh::Parallel::Communicator::max(), and std::max().
Referenced by libMesh::MeshBase::partition().
00329 { 00330 const_element_iterator el = this->active_elements_begin(); 00331 const const_element_iterator end = this->active_elements_end(); 00332 00333 unsigned int max_proc_id=0; 00334 00335 for (; el!=end; ++el) 00336 max_proc_id = std::max(max_proc_id, static_cast<unsigned int>((*el)->processor_id())); 00337 00338 // The number of partitions is one more than the max processor ID. 00339 _n_parts = max_proc_id+1; 00340 00341 CommWorld.max(_n_parts); 00342 00343 return _n_parts; 00344 }
| void libMesh::ParallelMesh::redistribute | ( | ) | [virtual, inherited] |
Redistribute elements between processors. This gets called automatically by the Partitioner, and is a no-op in the case of a serialized mesh.
Reimplemented from libMesh::MeshBase.
Definition at line 685 of file parallel_mesh.C.
References libMesh::ParallelMesh::is_serial(), libMesh::MeshCommunication::redistribute(), and libMesh::ParallelMesh::update_parallel_id_counts().
00686 { 00687 // If this is a truly parallel mesh, go through the redistribution/gather/delete remote steps 00688 if (!this->is_serial()) 00689 { 00690 // Construct a MeshCommunication object to actually redistribute the nodes 00691 // and elements according to the partitioner, and then to re-gather the neighbors. 00692 MeshCommunication mc; 00693 mc.redistribute(*this); 00694 00695 this->update_parallel_id_counts(); 00696 00697 // Is this necessary? If we are called from prepare_for_use(), this will be called 00698 // anyway... but users can always call partition directly, in which case we do need 00699 // to call delete_remote_elements()... 00700 // 00701 // Regardless of whether it's necessary, it isn't safe. We 00702 // haven't communicated new node processor_ids yet, and we can't 00703 // delete nodes until we do. 00704 // this->delete_remote_elements(); 00705 } 00706 }
| dof_id_type libMesh::ParallelMesh::renumber_dof_objects | ( | mapvector< T *, dof_id_type > & | objects | ) | [inline, inherited] |
Renumber a parallel objects container Returns the smallest globally unused id for that container.
Definition at line 818 of file parallel_mesh.C.
References libMesh::Parallel::Communicator::allgather(), libMesh::mapvector< Val, index_t >::begin(), libMesh::CommWorld, libMesh::mapvector< Val, index_t >::end(), end, libMesh::mapvector< Val, index_t >::erase(), libMesh::DofObject::invalid_processor_id, libMesh::n_processors(), libMesh::processor_id(), libMesh::Parallel::Communicator::send_receive(), and libMesh::Parallel::Communicator::verify().
Referenced by libMesh::ParallelMesh::renumber_nodes_and_elements().
00819 { 00820 // This function must be run on all processors at once 00821 parallel_only(); 00822 00823 typedef typename mapvector<T*,dof_id_type>::veclike_iterator object_iterator; 00824 00825 // In parallel we may not know what objects other processors have. 00826 // Start by figuring out how many 00827 dof_id_type unpartitioned_objects = 0; 00828 00829 std::vector<dof_id_type> 00830 ghost_objects_from_proc(libMesh::n_processors(), 0); 00831 00832 object_iterator it = objects.begin(); 00833 object_iterator end = objects.end(); 00834 00835 for (; it != end;) 00836 { 00837 T *obj = *it; 00838 00839 // Remove any NULL container entries while we're here, 00840 // being careful not to invalidate our iterator 00841 if (!*it) 00842 objects.erase(it++); 00843 else 00844 { 00845 processor_id_type obj_procid = obj->processor_id(); 00846 if (obj_procid == DofObject::invalid_processor_id) 00847 unpartitioned_objects++; 00848 else 00849 ghost_objects_from_proc[obj_procid]++; 00850 ++it; 00851 } 00852 } 00853 00854 std::vector<dof_id_type> objects_on_proc(libMesh::n_processors(), 0); 00855 CommWorld.allgather(ghost_objects_from_proc[libMesh::processor_id()], 00856 objects_on_proc); 00857 00858 #ifndef NDEBUG 00859 libmesh_assert(CommWorld.verify(unpartitioned_objects)); 00860 for (processor_id_type p=0; p != libMesh::n_processors(); ++p) 00861 libmesh_assert_less_equal (ghost_objects_from_proc[p], objects_on_proc[p]); 00862 #endif 00863 00864 // We'll renumber objects in blocks by processor id 00865 std::vector<dof_id_type> first_object_on_proc(libMesh::n_processors()); 00866 for (processor_id_type i=1; i != libMesh::n_processors(); ++i) 00867 first_object_on_proc[i] = first_object_on_proc[i-1] + 00868 objects_on_proc[i-1]; 00869 dof_id_type next_id = first_object_on_proc[libMesh::processor_id()]; 00870 dof_id_type first_free_id = 00871 first_object_on_proc[libMesh::n_processors()-1] + 00872 objects_on_proc[libMesh::n_processors()-1] + 00873 unpartitioned_objects; 00874 00875 // First set new local object ids and build request sets 00876 // for non-local object ids 00877 00878 // Request sets to send to each processor 00879 std::vector<std::vector<dof_id_type> > 00880 requested_ids(libMesh::n_processors()); 00881 00882 // We know how many objects live on each processor, so reseve() space for 00883 // each. 00884 for (processor_id_type p=0; p != libMesh::n_processors(); ++p) 00885 if (p != libMesh::processor_id()) 00886 requested_ids[p].reserve(ghost_objects_from_proc[p]); 00887 00888 end = objects.end(); 00889 for (it = objects.begin(); it != end; ++it) 00890 { 00891 T *obj = *it; 00892 if (obj->processor_id() == libMesh::processor_id()) 00893 obj->set_id(next_id++); 00894 else if (obj->processor_id() != DofObject::invalid_processor_id) 00895 requested_ids[obj->processor_id()].push_back(obj->id()); 00896 } 00897 00898 // Next set ghost object ids from other processors 00899 if (libMesh::n_processors() > 1) 00900 { 00901 for (processor_id_type p=1; p != libMesh::n_processors(); ++p) 00902 { 00903 // Trade my requests with processor procup and procdown 00904 processor_id_type procup = (libMesh::processor_id() + p) % 00905 libMesh::n_processors(); 00906 processor_id_type procdown = (libMesh::n_processors() + 00907 libMesh::processor_id() - p) % 00908 libMesh::n_processors(); 00909 std::vector<dof_id_type> request_to_fill; 00910 CommWorld.send_receive(procup, requested_ids[procup], 00911 procdown, request_to_fill); 00912 00913 // Fill those requests 00914 std::vector<dof_id_type> new_ids(request_to_fill.size()); 00915 for (std::size_t i=0; i != request_to_fill.size(); ++i) 00916 { 00917 T *obj = objects[request_to_fill[i]]; 00918 libmesh_assert(obj); 00919 libmesh_assert_equal_to (obj->processor_id(), libMesh::processor_id()); 00920 new_ids[i] = obj->id(); 00921 libmesh_assert_greater_equal (new_ids[i], 00922 first_object_on_proc[libMesh::processor_id()]); 00923 libmesh_assert_less (new_ids[i], 00924 first_object_on_proc[libMesh::processor_id()] + 00925 objects_on_proc[libMesh::processor_id()]); 00926 } 00927 00928 // Trade back the results 00929 std::vector<dof_id_type> filled_request; 00930 CommWorld.send_receive(procdown, new_ids, 00931 procup, filled_request); 00932 00933 // And copy the id changes we've now been informed of 00934 for (std::size_t i=0; i != filled_request.size(); ++i) 00935 { 00936 T *obj = objects[requested_ids[procup][i]]; 00937 libmesh_assert (obj); 00938 libmesh_assert_equal_to (obj->processor_id(), procup); 00939 libmesh_assert_greater_equal (filled_request[i], 00940 first_object_on_proc[procup]); 00941 libmesh_assert_less (filled_request[i], 00942 first_object_on_proc[procup] + 00943 objects_on_proc[procup]); 00944 obj->set_id(filled_request[i]); 00945 } 00946 } 00947 } 00948 00949 // Next set unpartitioned object ids 00950 next_id = 0; 00951 for (processor_id_type i=0; i != libMesh::n_processors(); ++i) 00952 next_id += objects_on_proc[i]; 00953 for (it = objects.begin(); it != end; ++it) 00954 { 00955 T *obj = *it; 00956 if (obj->processor_id() == DofObject::invalid_processor_id) 00957 obj->set_id(next_id++); 00958 } 00959 00960 // Finally shuffle around objects so that container indices 00961 // match ids 00962 end = objects.end(); 00963 for (it = objects.begin(); it != end;) 00964 { 00965 T *obj = *it; 00966 if (obj) // don't try shuffling already-NULL entries 00967 { 00968 T *next = objects[obj->id()]; 00969 // If we have to move this object 00970 if (next != obj) 00971 { 00972 // NULL out its original position for now 00973 // (our shuffling may put another object there shortly) 00974 *it = NULL; 00975 00976 // There may already be another object with this id that 00977 // needs to be moved itself 00978 while (next) 00979 { 00980 // We shouldn't be trying to give two objects the 00981 // same id 00982 libmesh_assert_not_equal_to (next->id(), obj->id()); 00983 objects[obj->id()] = obj; 00984 obj = next; 00985 next = objects[obj->id()]; 00986 } 00987 objects[obj->id()] = obj; 00988 } 00989 } 00990 // Remove any container entries that were left as NULL, 00991 // being careful not to invalidate our iterator 00992 if (!*it) 00993 objects.erase(it++); 00994 else 00995 ++it; 00996 } 00997 00998 return first_free_id; 00999 }
| void libMesh::ParallelMesh::renumber_elem | ( | dof_id_type | old_id, | |
| dof_id_type | new_id | |||
| ) | [virtual, inherited] |
Changes the id of element old_id, both by changing elem(old_id)->id() and by moving elem(old_id) in the mesh's internal container. No element with the id new_id should already exist.
Implements libMesh::MeshBase.
Definition at line 449 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::erase(), libMesh::DofObject::id(), and libMesh::DofObject::set_id().
| void libMesh::ParallelMesh::renumber_node | ( | dof_id_type | old_id, | |
| dof_id_type | new_id | |||
| ) | [virtual, inherited] |
Changes the id of node old_id, both by changing node(old_id)->id() and by moving node(old_id) in the mesh's internal container. No element with the id new_id should already exist.
Implements libMesh::MeshBase.
Definition at line 620 of file parallel_mesh.C.
References libMesh::ParallelMesh::_nodes, libMesh::mapvector< Val, index_t >::erase(), libMesh::DofObject::id(), and libMesh::DofObject::set_id().
| void libMesh::ParallelMesh::renumber_nodes_and_elements | ( | ) | [virtual, inherited] |
Remove NULL elements from arrays
Implements libMesh::MeshBase.
Definition at line 1002 of file parallel_mesh.C.
References libMesh::ParallelMesh::_elements, libMesh::ParallelMesh::_n_elem, libMesh::ParallelMesh::_n_nodes, libMesh::ParallelMesh::_nodes, libMesh::MeshBase::_skip_renumber_nodes_and_elements, libMesh::mapvector< Val, index_t >::begin(), libMesh::MeshBase::boundary_info, libMesh::ParallelMesh::elements_begin(), libMesh::ParallelMesh::elements_end(), libMesh::mapvector< Val, index_t >::end(), end, libMesh::mapvector< Val, index_t >::erase(), libMesh::DofObject::id(), libMesh::MeshTools::libmesh_assert_valid_elem_ids(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids(), libMesh::ParallelMesh::max_elem_id(), libMesh::ParallelMesh::max_node_id(), libMesh::ParallelMesh::n_elem(), libMesh::ParallelMesh::n_nodes(), libMesh::Elem::n_nodes(), libMesh::Elem::node(), libMesh::ParallelMesh::parallel_max_elem_id(), libMesh::ParallelMesh::parallel_max_node_id(), libMesh::ParallelMesh::parallel_n_elem(), libMesh::ParallelMesh::parallel_n_nodes(), libMesh::ParallelMesh::renumber_dof_objects(), and libMesh::ParallelMesh::update_parallel_id_counts().
01003 { 01004 parallel_only(); 01005 01006 if (_skip_renumber_nodes_and_elements) 01007 { 01008 this->update_parallel_id_counts(); 01009 return; 01010 } 01011 01012 START_LOG("renumber_nodes_and_elements()", "ParallelMesh"); 01013 01014 #ifdef DEBUG 01015 // Make sure our ids and flags are consistent 01016 this->libmesh_assert_valid_parallel_ids(); 01017 this->libmesh_assert_valid_parallel_flags(); 01018 #endif 01019 01020 std::set<dof_id_type> used_nodes; 01021 01022 // flag the nodes we need 01023 { 01024 element_iterator it = elements_begin(); 01025 element_iterator end = elements_end(); 01026 01027 for (; it != end; ++it) 01028 { 01029 Elem *el = *it; 01030 01031 for (unsigned int n=0; n != el->n_nodes(); ++n) 01032 used_nodes.insert(el->node(n)); 01033 } 01034 } 01035 01036 // Nodes not connected to any local elements, and NULL node entries 01037 // in our container, are deleted 01038 { 01039 node_iterator_imp it = _nodes.begin(); 01040 node_iterator_imp end = _nodes.end(); 01041 01042 for (; it != end;) 01043 { 01044 Node *nd = *it; 01045 if (!nd) 01046 _nodes.erase(it++); 01047 else if (!used_nodes.count(nd->id())) 01048 { 01049 // remove any boundary information associated with 01050 // this node 01051 this->boundary_info->remove (nd); 01052 01053 // delete the node 01054 delete nd; 01055 01056 _nodes.erase(it++); 01057 } 01058 else 01059 ++it; 01060 } 01061 } 01062 01063 // Finally renumber all the elements 01064 _n_elem = this->renumber_dof_objects (this->_elements); 01065 01066 // and all the remaining nodes 01067 _n_nodes = this->renumber_dof_objects (this->_nodes); 01068 01069 // And figure out what IDs we should use when adding new nodes and 01070 // new elements 01071 this->update_parallel_id_counts(); 01072 01073 // Make sure our caches are up to date and our 01074 // DofObjects are well packed 01075 #ifdef DEBUG 01076 libmesh_assert_equal_to (this->n_nodes(), this->parallel_n_nodes()); 01077 libmesh_assert_equal_to (this->n_elem(), this->parallel_n_elem()); 01078 const dof_id_type pmax_node_id = this->parallel_max_node_id(); 01079 const dof_id_type pmax_elem_id = this->parallel_max_elem_id(); 01080 libmesh_assert_equal_to (this->max_node_id(), pmax_node_id); 01081 libmesh_assert_equal_to (this->max_elem_id(), pmax_elem_id); 01082 libmesh_assert_equal_to (this->n_nodes(), this->max_node_id()); 01083 libmesh_assert_equal_to (this->n_elem(), this->max_elem_id()); 01084 01085 // Make sure our ids and flags are consistent 01086 this->libmesh_assert_valid_parallel_ids(); 01087 this->libmesh_assert_valid_parallel_flags(); 01088 01089 // And make sure we've made our numbering monotonic 01090 MeshTools::libmesh_assert_valid_elem_ids(*this); 01091 #endif 01092 01093 STOP_LOG("renumber_nodes_and_elements()", "ParallelMesh"); 01094 }
| virtual void libMesh::ParallelMesh::reserve_elem | ( | const | ne | ) | [inline, virtual, inherited] |
Reserves space for a known number of elements. Note that this method may or may not do anything, depending on the actual Mesh implementation. If you know the number of elements you will add and call this method before repeatedly calling add_point() the implementation will be more efficient.
Implements libMesh::MeshBase.
Definition at line 171 of file parallel_mesh.h.
| virtual void libMesh::ParallelMesh::reserve_nodes | ( | const | nn | ) | [inline, virtual, inherited] |
Reserves space for a known number of nodes. Note that this method may or may not do anything, depending on the actual Mesh implementation. If you know the number of nodes you will add and call this method before repeatedly calling add_point() the implementation will be more efficient.
Implements libMesh::MeshBase.
Definition at line 167 of file parallel_mesh.h.
| void libMesh::MeshBase::set_mesh_dimension | ( | unsigned int | d | ) | [inline, inherited] |
Resets the logical dimension of the mesh.
Definition at line 150 of file mesh_base.h.
References libMesh::MeshBase::_dim.
Referenced by libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::MeshBase::prepare_for_use(), libMesh::VTKIO::read(), libMesh::TetGenIO::read(), libMesh::Nemesis_IO::read(), libMesh::GMVIO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::UNVIO::read_implementation(), libMesh::LegacyXdrIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::BoundaryInfo::sync(), and libMesh::TriangleInterface::triangulate().
00151 { _dim = d; }
| unsigned int& libMesh::MeshBase::set_n_partitions | ( | ) | [inline, protected, inherited] |
Returns a writeable reference to the number of partitions.
Definition at line 825 of file mesh_base.h.
References libMesh::MeshBase::_n_parts.
Referenced by libMesh::Partitioner::partition(), libMesh::Partitioner::repartition(), and libMesh::BoundaryInfo::sync().
00826 { return _n_parts; }
| bool libMesh::MeshBase::skip_partitioning | ( | ) | const [inline, inherited] |
Definition at line 517 of file mesh_base.h.
References libMesh::MeshBase::_skip_partitioning.
Referenced by libMesh::MeshBase::partition().
00517 { return _skip_partitioning; }
| void libMesh::MeshBase::skip_partitioning | ( | bool | skip | ) | [inline, inherited] |
If true is passed in then this mesh will no longer be (re)partitioned. It would probably be a bad idea to call this on a Serial Mesh _before_ the first partitioning has happened... because no elements would get assigned to your processor pool.
Note that turning on skip_partitioning() can have adverse effects on your performance when using AMR... ie you could get large load imbalances.
However you might still want to use this if the communication and computation of the rebalance and repartition is too high for your application.
Definition at line 516 of file mesh_base.h.
References libMesh::MeshBase::_skip_partitioning.
Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements().
00516 { _skip_partitioning = skip; }
| unsigned int libMesh::MeshBase::spatial_dimension | ( | ) | const [inline, inherited] |
Returns the spatial dimension of the mesh. Note that this is defined at compile time in the header libmesh_common.h.
Definition at line 157 of file mesh_base.h.
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::MeshBase::get_info(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), libMesh::UNVIO::node_out(), libMesh::MeshTools::Modification::scale(), libMesh::MeshTools::subdomain_bounding_box(), and libMesh::Nemesis_IO_Helper::write_exodus_initialization_info().
| AutoPtr< PointLocatorBase > libMesh::MeshBase::sub_point_locator | ( | ) | const [inherited] |
returns a pointer to a subordinate PointLocatorBase object for this mesh, constructing a master PointLocator first if necessary. This should not be used in threaded or non-parallel_only code unless the master has already been constructed.
Definition at line 364 of file mesh_base.C.
References libMesh::MeshBase::_point_locator, libMesh::PointLocatorBase::build(), libMesh::AutoPtr< Tp >::get(), libMesh::Threads::in_threads, libMesh::AutoPtr< Tp >::reset(), and libMeshEnums::TREE.
Referenced by libMesh::DofMap::create_dof_constraints(), libMesh::MeshFunction::init(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), and libMesh::System::point_value().
00365 { 00366 if (_point_locator.get() == NULL) 00367 { 00368 // PointLocator construction may not be safe within threads 00369 libmesh_assert(!Threads::in_threads); 00370 00371 _point_locator.reset (PointLocatorBase::build(TREE, *this).release()); 00372 } 00373 00374 return PointLocatorBase::build(TREE, *this, _point_locator.get()); 00375 }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::subactive_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 311 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::subactive_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 87 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::subactive_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 759 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::subactive_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 534 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| void libMesh::MeshBase::subdomain_ids | ( | std::set< subdomain_id_type > & | ids | ) | const [inherited] |
Constructs a list of all subdomain identifiers in the global mesh. Subdomains correspond to separate subsets of the mesh which could correspond e.g. to different materials in a solid mechanics application, or regions where different physical processes are important. The subdomain mapping is independent from the parallel decomposition.
Definition at line 171 of file mesh_base.C.
References libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), libMesh::CommWorld, end, and libMesh::Parallel::Communicator::set_union().
Referenced by libMesh::MeshBase::n_subdomains(), and libMesh::TecplotIO::TecplotIO().
00172 { 00173 // This requires an inspection on every processor 00174 parallel_only(); 00175 00176 ids.clear(); 00177 00178 const_element_iterator el = this->active_elements_begin(); 00179 const const_element_iterator end = this->active_elements_end(); 00180 00181 for (; el!=end; ++el) 00182 ids.insert((*el)->subdomain_id()); 00183 00184 // Some subdomains may only live on other processors 00185 CommWorld.set_union(ids); 00186 }
| const std::string & libMesh::MeshBase::subdomain_name | ( | subdomain_id_type | id | ) | const [inherited] |
Definition at line 391 of file mesh_base.C.
References libMesh::MeshBase::_block_id_to_name.
00392 { 00393 // An empty string to return when no matching subdomain name is found 00394 static const std::string empty; 00395 00396 std::map<subdomain_id_type, std::string>::const_iterator iter = _block_id_to_name.find(id); 00397 if (iter == _block_id_to_name.end()) 00398 return empty; 00399 else 00400 return iter->second; 00401 }
| std::string & libMesh::MeshBase::subdomain_name | ( | subdomain_id_type | id | ) | [inherited] |
Returns a writable reference for getting/setting an optional name for a subdomain.
Definition at line 386 of file mesh_base.C.
References libMesh::MeshBase::_block_id_to_name.
Referenced by DMLibMeshSetSystem(), libMesh::ExodusII_IO::read(), libMesh::TecplotIO::write_binary(), and libMesh::ExodusII_IO_Helper::write_elements().
00387 { 00388 return _block_id_to_name[id]; 00389 }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::type_elements_begin | ( | const ElemType | type | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 421 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::type_elements_begin | ( | const ElemType | type | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 197 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, libMesh::mapvector< Val, index_t >::begin(), and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::type_elements_end | ( | const ElemType | type | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 868 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::element_iterator libMesh::ParallelMesh::type_elements_end | ( | const ElemType | type | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 644 of file parallel_mesh_iterators.C.
References libMesh::ParallelMesh::_elements, and libMesh::mapvector< Val, index_t >::end().
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::unpartitioned_elements_begin | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 451 of file parallel_mesh_iterators.C.
References libMesh::DofObject::invalid_processor_id, and libMesh::ParallelMesh::pid_elements_begin().
00452 { 00453 return this->pid_elements_begin(DofObject::invalid_processor_id); 00454 }
| ParallelMesh::element_iterator libMesh::ParallelMesh::unpartitioned_elements_begin | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 227 of file parallel_mesh_iterators.C.
References libMesh::DofObject::invalid_processor_id, and libMesh::ParallelMesh::pid_elements_begin().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
00228 { 00229 return this->pid_elements_begin(DofObject::invalid_processor_id); 00230 }
| ParallelMesh::const_element_iterator libMesh::ParallelMesh::unpartitioned_elements_end | ( | ) | const [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 898 of file parallel_mesh_iterators.C.
References libMesh::DofObject::invalid_processor_id, and libMesh::ParallelMesh::pid_elements_end().
00899 { 00900 return this->pid_elements_end(DofObject::invalid_processor_id); 00901 }
| ParallelMesh::element_iterator libMesh::ParallelMesh::unpartitioned_elements_end | ( | ) | [virtual, inherited] |
Implements libMesh::MeshBase.
Definition at line 674 of file parallel_mesh_iterators.C.
References libMesh::DofObject::invalid_processor_id, and libMesh::ParallelMesh::pid_elements_end().
Referenced by libMesh::MeshCommunication::delete_remote_elements().
00675 { 00676 return this->pid_elements_end(DofObject::invalid_processor_id); 00677 }
| void libMesh::ParallelMesh::update_parallel_id_counts | ( | ) | [virtual, inherited] |
Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors
Implements libMesh::MeshBase.
Definition at line 106 of file parallel_mesh.C.
References libMesh::ParallelMesh::_max_elem_id, libMesh::ParallelMesh::_max_node_id, libMesh::ParallelMesh::_n_elem, libMesh::ParallelMesh::_n_nodes, libMesh::ParallelMesh::_next_free_local_elem_id, libMesh::ParallelMesh::_next_free_local_node_id, libMesh::ParallelMesh::_next_free_unpartitioned_elem_id, libMesh::ParallelMesh::_next_free_unpartitioned_node_id, libMesh::MeshBase::n_processors(), libMesh::n_processors(), libMesh::ParallelMesh::parallel_max_elem_id(), libMesh::ParallelMesh::parallel_max_node_id(), libMesh::ParallelMesh::parallel_n_elem(), libMesh::ParallelMesh::parallel_n_nodes(), and libMesh::processor_id().
Referenced by libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::ParallelMesh(), libMesh::ParallelMesh::redistribute(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_post_partitioning().
00107 { 00108 // This function must be run on all processors at once 00109 parallel_only(); 00110 00111 _n_elem = this->parallel_n_elem(); 00112 _n_nodes = this->parallel_n_nodes(); 00113 _max_node_id = this->parallel_max_node_id(); 00114 _max_elem_id = this->parallel_max_elem_id(); 00115 00116 if (_next_free_unpartitioned_elem_id < _max_elem_id) 00117 _next_free_unpartitioned_elem_id = 00118 ((_max_elem_id-1) / (libMesh::n_processors() + 1) + 1) * 00119 (libMesh::n_processors() + 1) + libMesh::n_processors(); 00120 if (_next_free_local_elem_id < _max_elem_id) 00121 _next_free_local_elem_id = 00122 ((_max_elem_id + libMesh::n_processors() - 1) / (libMesh::n_processors() + 1) + 1) * 00123 (libMesh::n_processors() + 1) + libMesh::processor_id(); 00124 00125 if (_next_free_unpartitioned_node_id < _max_node_id) 00126 _next_free_unpartitioned_node_id = 00127 ((_max_node_id-1) / (libMesh::n_processors() + 1) + 1) * 00128 (libMesh::n_processors() + 1) + libMesh::n_processors(); 00129 if (_next_free_local_node_id < _max_node_id) 00130 _next_free_local_node_id = 00131 ((_max_node_id + libMesh::n_processors() - 1) / (libMesh::n_processors() + 1) + 1) * 00132 (libMesh::n_processors() + 1) + libMesh::processor_id(); 00133 }
| void libMesh::ParallelMesh::update_post_partitioning | ( | ) | [virtual, inherited] |
Recalculate cached data after elements and nodes have been repartitioned.
Reimplemented from libMesh::MeshBase.
Definition at line 710 of file parallel_mesh.C.
References libMesh::ParallelMesh::update_parallel_id_counts().
00711 { 00712 // this->recalculate_n_partitions(); 00713 00714 // Partitioning changes our numbers of unpartitioned objects 00715 this->update_parallel_id_counts(); 00716 }
| void libMesh::UnstructuredMesh::write | ( | const std::string & | name, | |
| const std::vector< Number > & | values, | |||
| const std::vector< std::string > & | variable_names | |||
| ) | [inherited] |
Write to the file specified by name. Attempts to figure out the proper method by the file extension. Also writes data.
Definition at line 883 of file unstructured_mesh.C.
References libMesh::err, libMesh::MeshBase::n_subdomains(), libMesh::GMVIO::partitioning(), and libMesh::GMVIO::write_nodal_data().
00886 { 00887 START_LOG("write()", "Mesh"); 00888 00889 // Write the file based on extension 00890 if (name.rfind(".dat") < name.size()) 00891 TecplotIO(*this).write_nodal_data (name, v, vn); 00892 00893 else if (name.rfind(".plt") < name.size()) 00894 TecplotIO(*this,true).write_nodal_data (name, v, vn); 00895 00896 else if (name.rfind(".gmv") < name.size()) 00897 { 00898 if (n_subdomains() > 1) 00899 GMVIO(*this).write_nodal_data (name, v, vn); 00900 else 00901 { 00902 GMVIO io(*this); 00903 io.partitioning() = false; 00904 io.write_nodal_data (name, v, vn); 00905 } 00906 } 00907 else if (name.rfind(".pvtu") < name.size()) 00908 { 00909 VTKIO(*this).write_nodal_data (name, v, vn); 00910 } 00911 else 00912 { 00913 libMesh::err 00914 << " ERROR: Unrecognized file extension: " << name 00915 << "\n I understand the following:\n\n" 00916 << " *.dat -- Tecplot ASCII file\n" 00917 << " *.gmv -- LANL's GMV (General Mesh Viewer) format\n" 00918 << " *.plt -- Tecplot binary file\n" 00919 << " *.pvtu -- Paraview VTK file\n" 00920 << "\n Exiting without writing output\n"; 00921 } 00922 00923 STOP_LOG("write()", "Mesh"); 00924 }
| void libMesh::UnstructuredMesh::write | ( | const std::string & | name, | |
| MeshData * | mesh_data = NULL | |||
| ) | [virtual, inherited] |
Write the file specified by name. Attempts to figure out the proper method by the file extension.
In order to write the UNV and TetGen file types, you must also pass a separate pointer to the MeshData object you have been using with this mesh, since these write methods expect it.
Implements libMesh::MeshBase.
Definition at line 719 of file unstructured_mesh.C.
References libMesh::Parallel::Communicator::barrier(), libMesh::Parallel::Communicator::broadcast(), libMesh::CommWorld, libMesh::err, libMesh::MeshBase::n_partitions(), libMesh::GMVIO::partitioning(), libMesh::processor_id(), and libMesh::GMVIO::write().
00721 { 00722 // parallel formats are special -- they may choose to write 00723 // separate files, let's not try to handle the zipping here. 00724 if (is_parallel_file_format(name)) 00725 { 00726 // no need to handle bz2 files here -- the Xdr class does that. 00727 if (name.rfind(".xda") < name.size()) 00728 XdrIO(*this).write(name); 00729 00730 else if (name.rfind(".xdr") < name.size()) 00731 XdrIO(*this,true).write(name); 00732 00733 else if (name.rfind(".nem") < name.size() || 00734 name.rfind(".n") < name.size()) 00735 Nemesis_IO(*this).write(name); 00736 } 00737 00738 // serial file formats 00739 else 00740 { 00741 START_LOG("write()", "Mesh"); 00742 00743 // Nasty hack for reading/writing zipped files 00744 std::string new_name = name; 00745 processor_id_type pid_0 = 0; 00746 if (libMesh::processor_id() == 0) 00747 pid_0 = getpid(); 00748 CommWorld.broadcast(pid_0); 00749 std::ostringstream pid_suffix; 00750 pid_suffix << '_' << pid_0; 00751 00752 if (name.size() - name.rfind(".bz2") == 4) 00753 { 00754 new_name.erase(new_name.end() - 4, new_name.end()); 00755 new_name += pid_suffix.str(); 00756 } 00757 else if (name.size() - name.rfind(".xz") == 3) 00758 { 00759 new_name.erase(new_name.end() - 3, new_name.end()); 00760 new_name += pid_suffix.str(); 00761 } 00762 00763 // New scope so that io will close before we try to zip the file 00764 { 00765 // Write the file based on extension 00766 if (new_name.rfind(".dat") < new_name.size()) 00767 TecplotIO(*this).write (new_name); 00768 00769 else if (new_name.rfind(".plt") < new_name.size()) 00770 TecplotIO(*this,true).write (new_name); 00771 00772 else if (new_name.rfind(".ucd") < new_name.size()) 00773 UCDIO (*this).write (new_name); 00774 00775 else if (new_name.rfind(".gmv") < new_name.size()) 00776 if (this->n_partitions() > 1) 00777 GMVIO(*this).write (new_name); 00778 else 00779 { 00780 GMVIO io(*this); 00781 io.partitioning() = false; 00782 io.write (new_name); 00783 } 00784 00785 else if (new_name.rfind(".ugrid") < new_name.size()) 00786 DivaIO(*this).write(new_name); 00787 else if (new_name.rfind(".exd") < new_name.size() || 00788 new_name.rfind(".e") < new_name.size()) 00789 ExodusII_IO(*this).write(new_name); 00790 else if (new_name.rfind(".mgf") < new_name.size()) 00791 LegacyXdrIO(*this,true).write_mgf(new_name); 00792 00793 else if (new_name.rfind(".unv") < new_name.size()) 00794 { 00795 if (mesh_data == NULL) 00796 { 00797 libMesh::err << "Error! You must pass a " 00798 << "valid MeshData pointer to " 00799 << "write UNV files!" << std::endl; 00800 libmesh_error(); 00801 } 00802 UNVIO(*this, *mesh_data).write (new_name); 00803 } 00804 00805 else if (new_name.rfind(".mesh") < new_name.size()) 00806 MEDITIO(*this).write (new_name); 00807 00808 else if (new_name.rfind(".poly") < new_name.size()) 00809 TetGenIO(*this).write (new_name); 00810 00811 else if (new_name.rfind(".msh") < new_name.size()) 00812 GmshIO(*this).write (new_name); 00813 00814 else if (new_name.rfind(".fro") < new_name.size()) 00815 FroIO(*this).write (new_name); 00816 00817 else if (new_name.rfind(".vtu") < new_name.size()) 00818 VTKIO(*this).write (new_name); 00819 00820 else 00821 { 00822 libMesh::err 00823 << " ERROR: Unrecognized file extension: " << name 00824 << "\n I understand the following:\n\n" 00825 << " *.dat -- Tecplot ASCII file\n" 00826 << " *.e -- Sandia's ExodusII format\n" 00827 << " *.exd -- Sandia's ExodusII format\n" 00828 << " *.fro -- ACDL's surface triangulation file\n" 00829 << " *.gmv -- LANL's GMV (General Mesh Viewer) format\n" 00830 << " *.mesh -- MEdit mesh format\n" 00831 << " *.mgf -- MGF binary mesh format\n" 00832 << " *.msh -- GMSH ASCII file\n" 00833 << " *.n -- Sandia's Nemesis format\n" 00834 << " *.nem -- Sandia's Nemesis format\n" 00835 << " *.plt -- Tecplot binary file\n" 00836 << " *.poly -- TetGen ASCII file\n" 00837 << " *.ucd -- AVS's ASCII UCD format\n" 00838 << " *.ugrid -- Kelly's DIVA ASCII format\n" 00839 << " *.unv -- I-deas Universal format\n" 00840 << " *.xda -- libMesh ASCII format\n" 00841 << " *.xdr -- libMesh binary format,\n" 00842 << std::endl 00843 << "\n Exiting without writing output\n"; 00844 } 00845 } 00846 00847 // Nasty hack for reading/writing zipped files 00848 if (name.size() - name.rfind(".bz2") == 4) 00849 { 00850 START_LOG("system(bzip2)", "Mesh"); 00851 if (libMesh::processor_id() == 0) 00852 { 00853 std::string system_string = "bzip2 -f -c "; 00854 system_string += new_name + " > " + name; 00855 if (std::system(system_string.c_str())) 00856 libmesh_file_error(system_string); 00857 std::remove(new_name.c_str()); 00858 } 00859 CommWorld.barrier(); 00860 STOP_LOG("system(bzip2)", "Mesh"); 00861 } 00862 if (name.size() - name.rfind(".xz") == 3) 00863 { 00864 START_LOG("system(xz)", "Mesh"); 00865 if (libMesh::processor_id() == 0) 00866 { 00867 std::string system_string = "xz -f -c "; 00868 system_string += new_name + " > " + name; 00869 if (std::system(system_string.c_str())) 00870 libmesh_file_error(system_string); 00871 std::remove(new_name.c_str()); 00872 } 00873 CommWorld.barrier(); 00874 STOP_LOG("system(xz)", "Mesh"); 00875 } 00876 00877 STOP_LOG("write()", "Mesh"); 00878 } 00879 }
Friends And Related Function Documentation
friend class BoundaryInfo [friend, inherited] |
Make the BoundaryInfo class a friend so that it can create and interact with BoundaryMesh.
Definition at line 895 of file mesh_base.h.
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const MeshBase & | m | |||
| ) | [friend, inherited] |
Equivalent to calling print_info() above, but now you can write: Mesh mesh; libMesh::out << mesh << std::endl;
friend class Partitioner [friend, inherited] |
The partitioner class is a friend so that it can set the number of partitions.
Definition at line 889 of file mesh_base.h.
Member Data Documentation
std::map<subdomain_id_type, std::string> libMesh::MeshBase::_block_id_to_name [protected, inherited] |
This structure maintains the mapping of named blocks for file formats that support named blocks. Currently this is only implemented for ExodusII
Definition at line 883 of file mesh_base.h.
Referenced by libMesh::MeshBase::get_id_by_name(), and libMesh::MeshBase::subdomain_name().
unsigned int libMesh::MeshBase::_dim [protected, inherited] |
The logical dimension of the mesh.
Definition at line 842 of file mesh_base.h.
Referenced by libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::MeshBase(), and libMesh::MeshBase::set_mesh_dimension().
mapvector<Elem*,dof_id_type> libMesh::ParallelMesh::_elements [protected, inherited] |
The elements in the mesh.
Definition at line 403 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::active_elements_begin(), libMesh::ParallelMesh::active_elements_end(), libMesh::ParallelMesh::active_local_elements_begin(), libMesh::ParallelMesh::active_local_elements_end(), libMesh::ParallelMesh::active_local_subdomain_elements_begin(), libMesh::ParallelMesh::active_local_subdomain_elements_end(), libMesh::ParallelMesh::active_not_local_elements_begin(), libMesh::ParallelMesh::active_not_local_elements_end(), libMesh::ParallelMesh::active_pid_elements_begin(), libMesh::ParallelMesh::active_pid_elements_end(), libMesh::ParallelMesh::active_subdomain_elements_begin(), libMesh::ParallelMesh::active_subdomain_elements_end(), libMesh::ParallelMesh::active_type_elements_begin(), libMesh::ParallelMesh::active_type_elements_end(), libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::ancestor_elements_begin(), libMesh::ParallelMesh::ancestor_elements_end(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::delete_elem(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::elem(), libMesh::ParallelMesh::elements_begin(), libMesh::ParallelMesh::elements_end(), libMesh::ParallelMesh::fix_broken_node_and_element_numbering(), libMesh::ParallelMesh::insert_elem(), libMesh::ParallelMesh::level_elements_begin(), libMesh::ParallelMesh::level_elements_end(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids(), libMesh::ParallelMesh::local_elements_begin(), libMesh::ParallelMesh::local_elements_end(), libMesh::ParallelMesh::local_level_elements_begin(), libMesh::ParallelMesh::local_level_elements_end(), libMesh::ParallelMesh::local_not_level_elements_begin(), libMesh::ParallelMesh::local_not_level_elements_end(), libMesh::ParallelMesh::not_active_elements_begin(), libMesh::ParallelMesh::not_active_elements_end(), libMesh::ParallelMesh::not_ancestor_elements_begin(), libMesh::ParallelMesh::not_ancestor_elements_end(), libMesh::ParallelMesh::not_level_elements_begin(), libMesh::ParallelMesh::not_level_elements_end(), libMesh::ParallelMesh::not_local_elements_begin(), libMesh::ParallelMesh::not_local_elements_end(), libMesh::ParallelMesh::not_subactive_elements_begin(), libMesh::ParallelMesh::not_subactive_elements_end(), libMesh::ParallelMesh::parallel_max_elem_id(), libMesh::ParallelMesh::pid_elements_begin(), libMesh::ParallelMesh::pid_elements_end(), libMesh::ParallelMesh::query_elem(), libMesh::ParallelMesh::renumber_elem(), libMesh::ParallelMesh::renumber_nodes_and_elements(), libMesh::ParallelMesh::subactive_elements_begin(), libMesh::ParallelMesh::subactive_elements_end(), libMesh::ParallelMesh::type_elements_begin(), and libMesh::ParallelMesh::type_elements_end().
std::set<Elem *> libMesh::ParallelMesh::_extra_ghost_elems [protected, inherited] |
These are extra ghost elements that we want to make sure not to delete when we call delete_remote_elements()
Definition at line 428 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::insert_extra_ghost_elem(), and libMesh::ParallelMesh::ParallelMesh().
bool libMesh::MeshBase::_is_prepared [protected, inherited] |
Flag indicating if the mesh has been prepared for use.
Definition at line 847 of file mesh_base.h.
Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshBase::clear(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshBase::is_prepared(), and libMesh::MeshBase::prepare_for_use().
bool libMesh::ParallelMesh::_is_serial [protected, inherited] |
A boolean remembering whether we're serialized or not
Definition at line 408 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::allgather(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::delete_remote_elements(), and libMesh::ParallelMesh::is_serial().
dof_id_type libMesh::ParallelMesh::_max_elem_id [protected, inherited] |
Definition at line 413 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::max_elem_id(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::update_parallel_id_counts().
dof_id_type libMesh::ParallelMesh::_max_node_id [protected, inherited] |
Definition at line 413 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::max_node_id(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::update_parallel_id_counts().
dof_id_type libMesh::ParallelMesh::_n_elem [protected, inherited] |
Definition at line 413 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::n_elem(), libMesh::ParallelMesh::ParallelMesh(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_parallel_id_counts().
dof_id_type libMesh::ParallelMesh::_n_nodes [protected, inherited] |
Cached data from the last renumber_nodes_and_elements call
Definition at line 413 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::n_nodes(), libMesh::ParallelMesh::ParallelMesh(), libMesh::ParallelMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::update_parallel_id_counts().
unsigned int libMesh::MeshBase::_n_parts [protected, inherited] |
The number of partitions the mesh has. This is set by the partitioners, and may not be changed directly by the user. **NOTE** The number of partitions *need not* equal libMesh::n_processors(), consider for example the case where you simply want to partition a mesh on one processor and view the result in GMV.
Definition at line 837 of file mesh_base.h.
Referenced by libMesh::MeshBase::clear(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshBase::n_partitions(), libMesh::MeshBase::recalculate_n_partitions(), and libMesh::MeshBase::set_n_partitions().
dof_id_type libMesh::ParallelMesh::_next_free_local_elem_id [protected, inherited] |
Definition at line 419 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::update_parallel_id_counts().
dof_id_type libMesh::ParallelMesh::_next_free_local_node_id [protected, inherited] |
Guaranteed globally unused IDs for use when adding new nodes or elements.
Definition at line 419 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::update_parallel_id_counts().
dof_id_type libMesh::ParallelMesh::_next_free_unpartitioned_elem_id [protected, inherited] |
Definition at line 421 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::update_parallel_id_counts().
dof_id_type libMesh::ParallelMesh::_next_free_unpartitioned_node_id [protected, inherited] |
Definition at line 421 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::ParallelMesh(), and libMesh::ParallelMesh::update_parallel_id_counts().
mapvector<Node*,dof_id_type> libMesh::ParallelMesh::_nodes [protected, inherited] |
The verices (spatial coordinates) of the mesh.
Definition at line 398 of file parallel_mesh.h.
Referenced by libMesh::ParallelMesh::active_nodes_begin(), libMesh::ParallelMesh::active_nodes_end(), libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::add_point(), libMesh::ParallelMesh::clear(), libMesh::ParallelMesh::delete_node(), libMesh::ParallelMesh::delete_remote_elements(), libMesh::ParallelMesh::fix_broken_node_and_element_numbering(), libMesh::ParallelMesh::insert_node(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_ids(), libMesh::ParallelMesh::local_nodes_begin(), libMesh::ParallelMesh::local_nodes_end(), libMesh::ParallelMesh::node(), libMesh::ParallelMesh::node_ptr(), libMesh::ParallelMesh::nodes_begin(), libMesh::ParallelMesh::nodes_end(), libMesh::ParallelMesh::parallel_max_node_id(), libMesh::ParallelMesh::pid_nodes_begin(), libMesh::ParallelMesh::pid_nodes_end(), libMesh::ParallelMesh::point(), libMesh::ParallelMesh::query_node_ptr(), libMesh::ParallelMesh::renumber_node(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
AutoPtr<Partitioner> libMesh::MeshBase::_partitioner [protected, inherited] |
A partitioner to use at each prepare_for_use().
This will be built in the constructor of each derived class, but can be replaced by the user through the partitioner() accessor.
Definition at line 864 of file mesh_base.h.
Referenced by libMesh::MeshBase::MeshBase(), libMesh::ParallelMesh::ParallelMesh(), libMesh::MeshBase::partitioner(), and libMesh::SerialMesh::SerialMesh().
AutoPtr<PointLocatorBase> libMesh::MeshBase::_point_locator [mutable, protected, inherited] |
A PointLocator class for this mesh. This will not actually be built unless needed. Further, since we want our point_locator() method to be const (yet do the dynamic allocating) this needs to be mutable. Since the PointLocatorBase::build() member is used, and it operates on a constant reference to the mesh, this is OK.
Definition at line 856 of file mesh_base.h.
Referenced by libMesh::MeshBase::clear_point_locator(), libMesh::MeshBase::point_locator(), and libMesh::MeshBase::sub_point_locator().
bool libMesh::MeshBase::_skip_partitioning [protected, inherited] |
If this is true then no partitioning should be done.
Definition at line 869 of file mesh_base.h.
Referenced by libMesh::MeshBase::skip_partitioning().
bool libMesh::MeshBase::_skip_renumber_nodes_and_elements [protected, inherited] |
If this is true then renumbering will be kept to a miniumum.
This is set when prepare_for_use() is called.
Definition at line 876 of file mesh_base.h.
Referenced by libMesh::MeshBase::allow_renumbering(), libMesh::MeshBase::prepare_for_use(), libMesh::SerialMesh::renumber_nodes_and_elements(), and libMesh::ParallelMesh::renumber_nodes_and_elements().
AutoPtr<BoundaryInfo> libMesh::MeshBase::boundary_info [inherited] |
This class holds the boundary information. It can store nodes, edges, and faces with a corresponding id that facilitates setting boundary conditions.
Definition at line 99 of file mesh_base.h.
Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::AbaqusIO::assign_boundary_node_ids(), libMesh::AbaqusIO::assign_sideset_ids(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::MeshTools::Modification::change_boundary_id(), libMesh::MeshBase::clear(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::UnstructuredMesh::create_submesh(), libMesh::SerialMesh::delete_elem(), libMesh::ParallelMesh::delete_elem(), libMesh::SerialMesh::delete_node(), libMesh::ParallelMesh::delete_node(), libMesh::MeshTools::Modification::flatten(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), libMesh::BoundaryProjectSolution::operator()(), libMesh::Parallel::pack(), libMesh::Parallel::packable_size(), libMesh::ParallelMesh::ParallelMesh(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read(), libMesh::LegacyXdrIO::read_mesh(), libMesh::GmshIO::read_mesh(), libMesh::SerialMesh::renumber_nodes_and_elements(), libMesh::ParallelMesh::renumber_nodes_and_elements(), libMesh::SerialMesh::SerialMesh(), libMesh::SerialMesh::stitch_meshes(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::XdrIO::write(), libMesh::FroIO::write(), libMesh::LegacyXdrIO::write_mesh(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::XdrIO::write_serialized_bcs(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::LegacyXdrIO::write_soln(), and libMesh::DivaIO::write_stream().
The documentation for this class was generated from the following files:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:06 UTC
Hosted By: