MeshBase Class Reference

#include <mesh_base.h>

Inheritance diagram for MeshBase:

List of all members.

Classes

struct  const_element_iterator
struct  const_node_iterator
struct  element_iterator
struct  node_iterator

Public Types

typedef Predicates::multi_predicate Predicate

Public Member Functions

 MeshBase (unsigned int d)
 MeshBase (const MeshBase &other_mesh)
virtual AutoPtr< MeshBaseclone () const =0
virtual ~MeshBase ()
virtual AutoPtr< Partitioner > & partitioner ()
virtual void clear ()
bool is_prepared () const
virtual bool is_serial () const
virtual void allgather ()
virtual void delete_remote_elements ()
unsigned int mesh_dimension () const
void set_mesh_dimension (unsigned int d)
unsigned int spatial_dimension () const
virtual unsigned int n_nodes () const =0
unsigned int n_nodes_on_proc (const unsigned int proc) const
unsigned int n_local_nodes () const
unsigned int n_unpartitioned_nodes () const
virtual unsigned int max_node_id () const =0
virtual void reserve_nodes (const unsigned int nn)=0
virtual unsigned int n_elem () const =0
virtual unsigned int max_elem_id () const =0
virtual void reserve_elem (const unsigned int ne)=0
virtual void update_parallel_id_counts ()=0
virtual unsigned int n_active_elem () const =0
unsigned int n_elem_on_proc (const unsigned int proc) const
unsigned int n_local_elem () const
unsigned int n_unpartitioned_elem () const
unsigned int n_active_elem_on_proc (const unsigned int proc) const
unsigned int n_active_local_elem () const
unsigned int n_sub_elem () const
unsigned int n_active_sub_elem () const
virtual const Pointpoint (const unsigned int i) const =0
virtual const Nodenode (const unsigned int i) const =0
virtual Nodenode (const unsigned int i)=0
virtual const Nodenode_ptr (const unsigned int i) const =0
virtual Node *& node_ptr (const unsigned int i)=0
virtual Elemelem (const unsigned int i) const =0
virtual Nodeadd_point (const Point &p, const unsigned int id=DofObject::invalid_id, const unsigned int proc_id=DofObject::invalid_processor_id)=0
virtual Nodeadd_node (Node *n)=0
virtual void delete_node (Node *n)=0
virtual void renumber_node (unsigned int old_id, unsigned int new_id)=0
virtual Elemadd_elem (Elem *e)=0
virtual Eleminsert_elem (Elem *e)=0
virtual void delete_elem (Elem *e)=0
virtual void renumber_elem (unsigned int old_id, unsigned int new_id)=0
virtual void find_neighbors (const bool reset_remote_elements=false, const bool reset_current_list=true)=0
virtual void renumber_nodes_and_elements ()=0
virtual bool contract ()=0
void prepare_for_use (const bool skip_renumber_nodes_and_elements=false)
void partition (const unsigned int n_parts=libMesh::n_processors())
unsigned int n_subdomains () const
unsigned int n_partitions () const
unsigned int n_processors () const
unsigned int processor_id () const
std::string get_info () const
void print_info (std::ostream &os=std::cout) const
virtual void read (const std::string &name, MeshData *mesh_data=NULL, bool skip_renumber_nodes_and_elements=false)=0
virtual void write (const std::string &name, MeshData *mesh_data=NULL)=0
virtual void all_first_order ()=0
virtual void all_second_order (const bool full_ordered=true)=0
unsigned int recalculate_n_partitions ()
const PointLocatorBasepoint_locator () const
void clear_point_locator ()
virtual element_iterator elements_begin ()=0
virtual element_iterator elements_end ()=0
virtual element_iterator active_elements_begin ()=0
virtual element_iterator active_elements_end ()=0
virtual element_iterator ancestor_elements_begin ()=0
virtual element_iterator ancestor_elements_end ()=0
virtual element_iterator subactive_elements_begin ()=0
virtual element_iterator subactive_elements_end ()=0
virtual element_iterator not_active_elements_begin ()=0
virtual element_iterator not_active_elements_end ()=0
virtual element_iterator not_ancestor_elements_begin ()=0
virtual element_iterator not_ancestor_elements_end ()=0
virtual element_iterator not_subactive_elements_begin ()=0
virtual element_iterator not_subactive_elements_end ()=0
virtual element_iterator local_elements_begin ()=0
virtual element_iterator local_elements_end ()=0
virtual element_iterator not_local_elements_begin ()=0
virtual element_iterator not_local_elements_end ()=0
virtual element_iterator active_local_elements_begin ()=0
virtual element_iterator active_local_elements_end ()=0
virtual element_iterator active_not_local_elements_begin ()=0
virtual element_iterator active_not_local_elements_end ()=0
virtual element_iterator level_elements_begin (const unsigned int level)=0
virtual element_iterator level_elements_end (const unsigned int level)=0
virtual element_iterator not_level_elements_begin (const unsigned int level)=0
virtual element_iterator not_level_elements_end (const unsigned int level)=0
virtual element_iterator local_level_elements_begin (const unsigned int level)=0
virtual element_iterator local_level_elements_end (const unsigned int level)=0
virtual element_iterator local_not_level_elements_begin (const unsigned int level)=0
virtual element_iterator local_not_level_elements_end (const unsigned int level)=0
virtual element_iterator pid_elements_begin (const unsigned int proc_id)=0
virtual element_iterator pid_elements_end (const unsigned int proc_id)=0
virtual element_iterator type_elements_begin (const ElemType type)=0
virtual element_iterator type_elements_end (const ElemType type)=0
virtual element_iterator active_type_elements_begin (const ElemType type)=0
virtual element_iterator active_type_elements_end (const ElemType type)=0
virtual element_iterator active_pid_elements_begin (const unsigned int proc_id)=0
virtual element_iterator active_pid_elements_end (const unsigned int proc_id)=0
virtual element_iterator unpartitioned_elements_begin ()=0
virtual element_iterator unpartitioned_elements_end ()=0
virtual element_iterator active_local_subdomain_elements_begin (const unsigned int subdomain_id)=0
virtual element_iterator active_local_subdomain_elements_end (const unsigned int subdomain_id)=0
virtual const_element_iterator elements_begin () const =0
virtual const_element_iterator elements_end () const =0
virtual const_element_iterator active_elements_begin () const =0
virtual const_element_iterator active_elements_end () const =0
virtual const_element_iterator ancestor_elements_begin () const =0
virtual const_element_iterator ancestor_elements_end () const =0
virtual const_element_iterator subactive_elements_begin () const =0
virtual const_element_iterator subactive_elements_end () const =0
virtual const_element_iterator not_active_elements_begin () const =0
virtual const_element_iterator not_active_elements_end () const =0
virtual const_element_iterator not_ancestor_elements_begin () const =0
virtual const_element_iterator not_ancestor_elements_end () const =0
virtual const_element_iterator not_subactive_elements_begin () const =0
virtual const_element_iterator not_subactive_elements_end () const =0
virtual const_element_iterator local_elements_begin () const =0
virtual const_element_iterator local_elements_end () const =0
virtual const_element_iterator not_local_elements_begin () const =0
virtual const_element_iterator not_local_elements_end () const =0
virtual const_element_iterator active_local_elements_begin () const =0
virtual const_element_iterator active_local_elements_end () const =0
virtual const_element_iterator active_not_local_elements_begin () const =0
virtual const_element_iterator active_not_local_elements_end () const =0
virtual const_element_iterator level_elements_begin (const unsigned int level) const =0
virtual const_element_iterator level_elements_end (const unsigned int level) const =0
virtual const_element_iterator not_level_elements_begin (const unsigned int level) const =0
virtual const_element_iterator not_level_elements_end (const unsigned int level) const =0
virtual const_element_iterator local_level_elements_begin (const unsigned int level) const =0
virtual const_element_iterator local_level_elements_end (const unsigned int level) const =0
virtual const_element_iterator local_not_level_elements_begin (const unsigned int level) const =0
virtual const_element_iterator local_not_level_elements_end (const unsigned int level) const =0
virtual const_element_iterator pid_elements_begin (const unsigned int proc_id) const =0
virtual const_element_iterator pid_elements_end (const unsigned int proc_id) const =0
virtual const_element_iterator type_elements_begin (const ElemType type) const =0
virtual const_element_iterator type_elements_end (const ElemType type) const =0
virtual const_element_iterator active_type_elements_begin (const ElemType type) const =0
virtual const_element_iterator active_type_elements_end (const ElemType type) const =0
virtual const_element_iterator active_pid_elements_begin (const unsigned int proc_id) const =0
virtual const_element_iterator active_pid_elements_end (const unsigned int proc_id) const =0
virtual const_element_iterator unpartitioned_elements_begin () const =0
virtual const_element_iterator unpartitioned_elements_end () const =0
virtual const_element_iterator active_local_subdomain_elements_begin (const unsigned int subdomain_id) const =0
virtual const_element_iterator active_local_subdomain_elements_end (const unsigned int subdomain_id) const =0
virtual node_iterator nodes_begin ()=0
virtual node_iterator nodes_end ()=0
virtual node_iterator active_nodes_begin ()=0
virtual node_iterator active_nodes_end ()=0
virtual node_iterator local_nodes_begin ()=0
virtual node_iterator local_nodes_end ()=0
virtual node_iterator pid_nodes_begin (const unsigned int proc_id)=0
virtual node_iterator pid_nodes_end (const unsigned int proc_id)=0
virtual const_node_iterator nodes_begin () const =0
virtual const_node_iterator nodes_end () const =0
virtual const_node_iterator active_nodes_begin () const =0
virtual const_node_iterator active_nodes_end () const =0
virtual const_node_iterator local_nodes_begin () const =0
virtual const_node_iterator local_nodes_end () const =0
virtual const_node_iterator pid_nodes_begin (const unsigned int proc_id) const =0
virtual const_node_iterator pid_nodes_end (const unsigned int proc_id) const =0

Public Attributes

AutoPtr< BoundaryInfoboundary_info

Protected Member Functions

unsigned int & set_n_partitions ()

Protected Attributes

unsigned int _n_parts
unsigned int _dim
bool _is_prepared
AutoPtr< PointLocatorBase_point_locator
AutoPtr< Partitioner_partitioner

Friends

class Partitioner
class BoundaryInfo
std::ostream & operator<< (std::ostream &os, const MeshBase &m)


Detailed Description

This is the MeshBase class. This class provides all the data necessary to describe a geometric entity. It allows for the description of a dim dimensional object that lives in LIBMESH_DIM-dimensional space.
A mesh is made of nodes and elements, and this class provides data structures to store and access both. A mesh may be partitioned into a number of subdomains, and this class provides that functionality. Furthermore, this class provides functions for reading and writing a mesh to disk in various formats.
Author:
Benjamin S. Kirk
Date:
Date
2009-11-08 16:22:13 -0600 (Sun, 08 Nov 2009)
Version:
Revision
3547

Definition at line 69 of file mesh_base.h.


Member Typedef Documentation

We need an empty, generic class to act as a predicate for this and derived mesh classes.

Definition at line 495 of file mesh_base.h.


Constructor & Destructor Documentation

MeshBase::MeshBase ( unsigned int  d  ) 

Constructor. Requires d, the dimension of the mesh.

Definition at line 44 of file mesh_base.C.

References _dim, and libMesh::initialized().

00044                                   :
00045   boundary_info  (new BoundaryInfo(*this)),
00046   _n_parts       (1),
00047   _dim           (d),
00048   _is_prepared   (false),
00049   _point_locator (NULL),
00050   _partitioner   (NULL)
00051 {
00052   libmesh_assert (LIBMESH_DIM <= 3);
00053   libmesh_assert (LIBMESH_DIM >= _dim);
00054   libmesh_assert (libMesh::initialized());
00055 }

MeshBase::MeshBase ( const MeshBase other_mesh  ) 

Copy-constructor.

Definition at line 59 of file mesh_base.C.

00059                                               :
00060   boundary_info  (new BoundaryInfo(*this)), // no copy constructor defined for BoundaryInfo?
00061   _n_parts       (other_mesh._n_parts),
00062   _dim           (other_mesh._dim),
00063   _is_prepared   (other_mesh._is_prepared),
00064   _point_locator (NULL),
00065   _partitioner   (other_mesh._partitioner->clone())
00066 {
00067 }

MeshBase::~MeshBase (  )  [virtual]

Destructor.

Definition at line 71 of file mesh_base.C.

References clear(), and libMesh::closed().

00072 {
00073   this->clear();
00074 
00075   libmesh_assert (!libMesh::closed());
00076 }


Member Function Documentation

virtual const_element_iterator MeshBase::active_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by SFCPartitioner::_do_partition(), MetisPartitioner::_do_partition(), LinearPartitioner::_do_partition(), DofMap::add_neighbors_to_send_list(), ParmetisPartitioner::assign_partitioning(), EquationSystems::build_discontinuous_solution_vector(), InfElemBuilder::build_inf_elem(), DofMap::compute_sparsity(), MeshTools::correct_node_proc_ids(), MeshTools::Modification::distort(), MeshRefinement::eliminate_unrefined_patches(), PointLocatorTree::enable_out_of_mesh_mode(), LocationMap< T >::fill(), MeshTools::find_boundary_nodes(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), MeshRefinement::flag_elements_by_mean_stddev(), MeshRefinement::flag_elements_by_nelem_target(), MeshTools::Modification::flatten(), PointLocatorList::init(), LaplaceMeshSmoother::init(), ParmetisPartitioner::initialize(), DofMap::invalidate_dofs(), MeshTools::libmesh_assert_valid_elem_ids(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshCommunication::make_elems_parallel_consistent(), MeshRefinement::make_refinement_compatible(), FEMSystem::mesh_position_set(), n_active_sub_elem(), n_subdomains(), PointLocatorTree::operator()(), System::read_legacy_data(), GmshIO::read_mesh(), VariationalMeshSmoother::readgr(), recalculate_n_partitions(), DofMap::reinit(), Partitioner::set_node_processor_ids(), Partitioner::set_parent_processor_ids(), LaplaceMeshSmoother::smooth(), BoundaryInfo::sync(), Tree< N >::Tree(), MeshRefinement::uniformly_coarsen(), MeshRefinement::uniformly_p_coarsen(), MeshRefinement::uniformly_p_refine(), MeshRefinement::uniformly_refine(), TetGenIO::write(), PostscriptIO::write(), FroIO::write(), TecplotIO::write_ascii(), MEDITIO::write_ascii(), GMVIO::write_ascii_new_impl(), GMVIO::write_ascii_old_impl(), TecplotIO::write_binary(), GMVIO::write_discontinuous_gmv(), GmshIO::write_mesh(), GmshIO::write_post(), and GnuPlotIO::write_solution().

virtual const_element_iterator MeshBase::active_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by SFCPartitioner::_do_partition(), MetisPartitioner::_do_partition(), LinearPartitioner::_do_partition(), DofMap::add_neighbors_to_send_list(), ParmetisPartitioner::assign_partitioning(), EquationSystems::build_discontinuous_solution_vector(), InfElemBuilder::build_inf_elem(), DofMap::compute_sparsity(), MeshTools::correct_node_proc_ids(), MeshTools::Modification::distort(), MeshRefinement::eliminate_unrefined_patches(), PointLocatorTree::enable_out_of_mesh_mode(), LocationMap< T >::fill(), MeshTools::find_boundary_nodes(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), MeshRefinement::flag_elements_by_mean_stddev(), MeshRefinement::flag_elements_by_nelem_target(), MeshTools::Modification::flatten(), PointLocatorList::init(), LaplaceMeshSmoother::init(), ParmetisPartitioner::initialize(), DofMap::invalidate_dofs(), MeshTools::libmesh_assert_valid_elem_ids(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshCommunication::make_elems_parallel_consistent(), MeshRefinement::make_refinement_compatible(), FEMSystem::mesh_position_set(), n_active_sub_elem(), n_subdomains(), PointLocatorTree::operator()(), System::read_legacy_data(), GmshIO::read_mesh(), VariationalMeshSmoother::readgr(), recalculate_n_partitions(), DofMap::reinit(), Partitioner::set_node_processor_ids(), Partitioner::set_parent_processor_ids(), LaplaceMeshSmoother::smooth(), BoundaryInfo::sync(), Tree< N >::Tree(), MeshRefinement::uniformly_coarsen(), MeshRefinement::uniformly_p_coarsen(), MeshRefinement::uniformly_p_refine(), MeshRefinement::uniformly_refine(), TetGenIO::write(), PostscriptIO::write(), FroIO::write(), TecplotIO::write_ascii(), MEDITIO::write_ascii(), GMVIO::write_ascii_new_impl(), GMVIO::write_ascii_old_impl(), TecplotIO::write_binary(), GMVIO::write_discontinuous_gmv(), GmshIO::write_mesh(), GmshIO::write_post(), and GnuPlotIO::write_solution().

virtual const_element_iterator MeshBase::active_local_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::active_local_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::active_local_subdomain_elements_begin ( const unsigned int  subdomain_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_local_subdomain_elements_begin ( const unsigned int  subdomain_id  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::active_local_subdomain_elements_end ( const unsigned int  subdomain_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_local_subdomain_elements_end ( const unsigned int  subdomain_id  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_node_iterator MeshBase::active_nodes_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual node_iterator MeshBase::active_nodes_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_node_iterator MeshBase::active_nodes_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual node_iterator MeshBase::active_nodes_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::active_not_local_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_not_local_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::active_not_local_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_not_local_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::active_pid_elements_begin ( const unsigned int  proc_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_pid_elements_begin ( const unsigned int  proc_id  )  [pure virtual]

virtual const_element_iterator MeshBase::active_pid_elements_end ( const unsigned int  proc_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_pid_elements_end ( const unsigned int  proc_id  )  [pure virtual]

virtual const_element_iterator MeshBase::active_type_elements_begin ( const ElemType  type  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_type_elements_begin ( const ElemType  type  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshTools::n_active_elem_of_type().

virtual const_element_iterator MeshBase::active_type_elements_end ( const ElemType  type  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::active_type_elements_end ( const ElemType  type  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshTools::n_active_elem_of_type().

virtual Node* MeshBase::add_node ( Node n  )  [pure virtual]

Add Node n to the end of the vertex array.

Implemented in ParallelMesh, and SerialMesh.

virtual Node* MeshBase::add_point ( const Point p,
const unsigned int  id = DofObject::invalid_id,
const unsigned int  proc_id = DofObject::invalid_processor_id 
) [pure virtual]

virtual void MeshBase::all_first_order (  )  [pure virtual]

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.

Implemented in UnstructuredMesh.

Referenced by ErrorVector::plot_error().

virtual void MeshBase::all_second_order ( const bool  full_ordered = true  )  [pure virtual]

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 ...

Implemented in UnstructuredMesh.

virtual void MeshBase::allgather (  )  [inline, virtual]

Gathers all elements and nodes of the mesh onto every processor

Reimplemented in ParallelMesh.

Definition at line 128 of file mesh_base.h.

Referenced by EquationSystems::allgather().

00128 {}

virtual const_element_iterator MeshBase::ancestor_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::ancestor_elements_begin (  )  [pure virtual]

virtual const_element_iterator MeshBase::ancestor_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::ancestor_elements_end (  )  [pure virtual]

void MeshBase::clear (  )  [virtual]

Deletes all the data that are currently stored.

Reimplemented in ParallelMesh, and SerialMesh.

Definition at line 116 of file mesh_base.C.

References _is_prepared, _n_parts, boundary_info, and clear_point_locator().

Referenced by MeshTools::Generation::build_cube(), MeshTools::Generation::build_delaunay_square(), Triangle::copy_tri_to_mesh(), UnstructuredMesh::create_submesh(), VTKIO::read(), ExodusII_IO::read(), LegacyXdrIO::read_ascii(), LegacyXdrIO::read_binary(), LegacyXdrIO::read_mesh(), GmshIO::read_mesh(), OFFIO::read_stream(), MatlabIO::read_stream(), TriangleInterface::triangulate(), and ~MeshBase().

00117 {
00118   // Reset the number of partitions
00119   _n_parts = 1;
00120 
00121   // Reset the _is_prepared flag
00122   _is_prepared = false;
00123 
00124   // Clear boundary information
00125   this->boundary_info->clear();
00126 
00127   // Clear our point locator.
00128   this->clear_point_locator();
00129 }

void MeshBase::clear_point_locator (  ) 

Releases the current PointLocator object.

Definition at line 295 of file mesh_base.C.

References _point_locator, and AutoPtr< Tp >::reset().

Referenced by clear(), and prepare_for_use().

00296 {
00297   _point_locator.reset(NULL);
00298 }

virtual AutoPtr<MeshBase> MeshBase::clone (  )  const [pure virtual]

Virtual "copy constructor"

Implemented in ParallelMesh, and SerialMesh.

Referenced by ErrorVector::plot_error().

virtual bool MeshBase::contract (  )  [pure virtual]

Delete subactive (i.e. children of coarsened) elements. This removes all elements descended from currently active elements in the mesh.

Implemented in UnstructuredMesh.

Referenced by EquationSystems::reinit().

virtual void MeshBase::delete_elem ( Elem e  )  [pure virtual]

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.

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshTools::Modification::all_tri(), MeshTools::Generation::build_cube(), UnstructuredMesh::contract(), MeshTools::Modification::flatten(), and TetGenMeshInterface::pointset_convexhull().

virtual void MeshBase::delete_node ( Node n  )  [pure virtual]

Removes the Node n from the mesh.

Implemented in ParallelMesh, and SerialMesh.

virtual void MeshBase::delete_remote_elements (  )  [inline, virtual]

When supported, 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 in ParallelMesh.

Definition at line 135 of file mesh_base.h.

Referenced by EquationSystems::init(), and prepare_for_use().

00135 {}

virtual const_element_iterator MeshBase::elements_begin (  )  const [pure virtual]

const Elem iterator accessor functions.

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::elements_begin (  )  [pure virtual]

Elem iterator accessor functions. These must be defined in Concrete base classes.

Implemented in ParallelMesh, and SerialMesh.

Referenced by EquationSystems::_add_system_to_nodes_and_elems(), MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), MeshRefinement::add_p_to_h_refinement(), VariationalMeshSmoother::adjust_adapt_data(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Modification::all_tri(), EquationSystems::allgather(), MeshData::assign(), MeshCommunication::assign_global_indices(), MeshTools::Generation::build_cube(), MeshTools::Generation::build_delaunay_square(), MeshTools::build_nodes_to_elem_map(), MeshRefinement::clean_refinement_flags(), MeshRefinement::coarsen_elements(), CentroidPartitioner::compute_centroids(), UnstructuredMesh::contract(), UnstructuredMesh::copy_nodes_and_elements(), DofMap::create_dof_constraints(), DofMap::distribute_dofs(), MeshTools::elem_types(), UNVIO::element_out(), UnstructuredMesh::find_neighbors(), MeshTools::Modification::flatten(), MeshTools::get_not_subactive_node_ids(), EquationSystems::init(), MeshTools::libmesh_assert_no_links_to_elem(), MeshTools::libmesh_assert_valid_neighbors(), MeshTools::libmesh_assert_valid_node_pointers(), MeshTools::libmesh_assert_valid_refinement_flags(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_flags_parallel_consistent(), n_sub_elem(), TetGenMeshInterface::pointset_convexhull(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), EquationSystems::reinit(), DofMap::reinit(), Partitioner::set_node_processor_ids(), Partitioner::single_partition(), MeshRefinement::switch_h_to_p_refinement(), MeshTools::total_weight(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and LegacyXdrIO::write_mesh().

virtual const_element_iterator MeshBase::elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by EquationSystems::_add_system_to_nodes_and_elems(), MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), MeshRefinement::add_p_to_h_refinement(), VariationalMeshSmoother::adjust_adapt_data(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Modification::all_tri(), EquationSystems::allgather(), MeshData::assign(), MeshCommunication::assign_global_indices(), MeshTools::Generation::build_cube(), MeshTools::Generation::build_delaunay_square(), MeshTools::build_nodes_to_elem_map(), MeshRefinement::clean_refinement_flags(), MeshRefinement::coarsen_elements(), CentroidPartitioner::compute_centroids(), UnstructuredMesh::contract(), UnstructuredMesh::copy_nodes_and_elements(), DofMap::create_dof_constraints(), DofMap::distribute_dofs(), MeshTools::elem_types(), UNVIO::element_out(), UnstructuredMesh::find_neighbors(), MeshTools::Modification::flatten(), MeshTools::get_not_subactive_node_ids(), EquationSystems::init(), MeshTools::libmesh_assert_no_links_to_elem(), MeshTools::libmesh_assert_valid_neighbors(), MeshTools::libmesh_assert_valid_node_pointers(), MeshTools::libmesh_assert_valid_refinement_flags(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_flags_parallel_consistent(), n_sub_elem(), TetGenMeshInterface::pointset_convexhull(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), EquationSystems::reinit(), DofMap::reinit(), Partitioner::set_node_processor_ids(), Partitioner::single_partition(), MeshRefinement::switch_h_to_p_refinement(), MeshTools::total_weight(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and LegacyXdrIO::write_mesh().

virtual void MeshBase::find_neighbors ( const bool  reset_remote_elements = false,
const bool  reset_current_list = true 
) [pure virtual]

Locate element face (edge in 2D) neighbors. This is done with the help of a std::map that functions like a hash table. After this routine is called all the elements with a NULL neighbor pointer are guaranteed to be on the boundary. Thus this routine is useful for automatically determining the boundaries of the domain. If reset_remote_elements is left to false, remote neighbor links are not reset and searched for in the local mesh. If reset_current_list is left as true, then any existing links will be reset before initiating the algorithm, while honoring the value of the reset_remote_elements flag.

Implemented in UnstructuredMesh.

Referenced by InfElemBuilder::build_inf_elem(), and prepare_for_use().

std::string MeshBase::get_info (  )  const

Returns:
a string containing relevant information about the mesh.

Definition at line 221 of file mesh_base.C.

References mesh_dimension(), n_active_elem(), n_elem(), n_local_elem(), n_local_nodes(), n_nodes(), n_processors(), n_subdomains(), processor_id(), and spatial_dimension().

Referenced by print_info().

00222 {
00223   std::ostringstream out;
00224 
00225   out << " Mesh Information:"                                  << '\n'
00226       << "  mesh_dimension()="    << this->mesh_dimension()    << '\n'
00227       << "  spatial_dimension()=" << this->spatial_dimension() << '\n'
00228       << "  n_nodes()="           << this->n_nodes()           << '\n'
00229       << "    n_local_nodes()="   << this->n_local_nodes()     << '\n'
00230       << "  n_elem()="            << this->n_elem()            << '\n'
00231       << "    n_local_elem()="    << this->n_local_elem()      << '\n'
00232 #ifdef LIBMESH_ENABLE_AMR
00233       << "    n_active_elem()="   << this->n_active_elem()     << '\n'
00234 #endif
00235       << "  n_subdomains()="      << this->n_subdomains()      << '\n'
00236       << "  n_processors()="      << this->n_processors()      << '\n'
00237       << "  processor_id()="      << this->processor_id()      << '\n';
00238 
00239   return out.str();
00240 }

virtual Elem* MeshBase::insert_elem ( Elem e  )  [pure virtual]

Insert elem e to the element array, preserving its id and replacing/deleting any existing element with the same id.

Implemented in ParallelMesh, and SerialMesh.

Referenced by UnstructuredMesh::all_first_order(), and UnstructuredMesh::all_second_order().

bool MeshBase::is_prepared (  )  const [inline]

Returns:
true if the mesh has been prepared via a call to prepare_for_use, false otherwise.

Definition at line 114 of file mesh_base.h.

References _is_prepared.

Referenced by DofMap::compute_sparsity(), DofMap::create_dof_constraints(), DofMap::distribute_dofs(), and DofMap::reinit().

00115   { return _is_prepared; }

virtual const_element_iterator MeshBase::level_elements_begin ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::level_elements_begin ( const unsigned int  level  )  [pure virtual]

virtual const_element_iterator MeshBase::level_elements_end ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::level_elements_end ( const unsigned int  level  )  [pure virtual]

virtual const_element_iterator MeshBase::local_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::local_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::local_level_elements_begin ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::local_level_elements_begin ( const unsigned int  level  )  [pure virtual]

virtual const_element_iterator MeshBase::local_level_elements_end ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::local_level_elements_end ( const unsigned int  level  )  [pure virtual]

virtual const_node_iterator MeshBase::local_nodes_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_node_iterator MeshBase::local_nodes_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::local_not_level_elements_begin ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::local_not_level_elements_begin ( const unsigned int  level  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::local_not_level_elements_end ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::local_not_level_elements_end ( const unsigned int  level  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual unsigned int MeshBase::max_elem_id (  )  const [pure virtual]

virtual unsigned int MeshBase::max_node_id (  )  const [pure virtual]

unsigned int MeshBase::mesh_dimension (  )  const [inline]

unsigned int MeshBase::n_active_elem_on_proc ( const unsigned int  proc  )  const

Returns the number of active elements on processor proc.

Definition at line 182 of file mesh_base.C.

References active_pid_elements_begin(), active_pid_elements_end(), and libMesh::n_processors().

Referenced by n_active_local_elem().

00183 {
00184   libmesh_assert (proc_id < libMesh::n_processors());
00185   return static_cast<unsigned int>(std::distance (this->active_pid_elements_begin(proc_id),
00186                                                   this->active_pid_elements_end  (proc_id)));
00187 }

unsigned int MeshBase::n_active_local_elem (  )  const [inline]

Returns the number of active elements on the local processor.

Definition at line 253 of file mesh_base.h.

References n_active_elem_on_proc(), and libMesh::processor_id().

Referenced by ParmetisPartitioner::assign_partitioning(), ParmetisPartitioner::build_graph(), and ParmetisPartitioner::initialize().

00254   { return this->n_active_elem_on_proc (libMesh::processor_id()); }

unsigned int MeshBase::n_active_sub_elem (  )  const

Same, but only counts active elements.

Definition at line 206 of file mesh_base.C.

References active_elements_begin(), and active_elements_end().

Referenced by TecplotIO::write_ascii(), GMVIO::write_ascii_old_impl(), and TecplotIO::write_binary().

00207 {
00208   unsigned int ne=0;
00209 
00210   const_element_iterator       el  = this->active_elements_begin();
00211   const const_element_iterator end = this->active_elements_end(); 
00212 
00213   for (; el!=end; ++el)
00214     ne += (*el)->n_sub_elem(); 
00215 
00216   return ne;
00217 }

unsigned int MeshBase::n_elem_on_proc ( const unsigned int  proc  )  const

Returns the number of elements on processor proc.

Definition at line 169 of file mesh_base.C.

References DofObject::invalid_processor_id, libMesh::n_processors(), pid_elements_begin(), and pid_elements_end().

Referenced by n_local_elem(), and n_unpartitioned_elem().

00170 {
00171   // We're either counting a processor's elements or unpartitioned
00172   // elements
00173   libmesh_assert (proc_id < libMesh::n_processors() ||
00174           proc_id == DofObject::invalid_processor_id);
00175   
00176   return static_cast<unsigned int>(std::distance (this->pid_elements_begin(proc_id),
00177                                                   this->pid_elements_end  (proc_id)));
00178 }

unsigned int MeshBase::n_local_elem (  )  const [inline]

Returns the number of elements on the local processor.

Definition at line 236 of file mesh_base.h.

References n_elem_on_proc(), and libMesh::processor_id().

Referenced by get_info(), ParallelMesh::parallel_n_elem(), and ParallelMesh::update_parallel_id_counts().

00237   { return this->n_elem_on_proc (libMesh::processor_id()); }

unsigned int MeshBase::n_local_nodes (  )  const [inline]

Returns the number of nodes on the local processor.

Definition at line 172 of file mesh_base.h.

References n_nodes_on_proc(), and libMesh::processor_id().

Referenced by get_info(), ParallelMesh::parallel_n_nodes(), and ParallelMesh::update_parallel_id_counts().

00173   { return this->n_nodes_on_proc (libMesh::processor_id()); }

virtual unsigned int MeshBase::n_nodes (  )  const [pure virtual]

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.

Implemented in ParallelMesh, and SerialMesh.

Referenced by UnstructuredMesh::all_second_order(), MeshCommunication::assign_global_indices(), MeshTools::Generation::build_cube(), MeshTools::Generation::build_delaunay_square(), MeshTools::build_nodes_to_elem_map(), EquationSystems::build_solution_vector(), UnstructuredMesh::copy_nodes_and_elements(), UnstructuredMesh::create_submesh(), MeshTools::Modification::distort(), MeshTools::find_boundary_nodes(), get_info(), TetGenMeshInterface::get_node_index(), LaplaceMeshSmoother::init(), ExodusII_IO_Helper::initialize(), TreeNode< N >::insert(), MeshRefinement::limit_level_mismatch_at_node(), VTKIO::nodes_to_vtk(), ParallelMesh::ParallelMesh(), TetGenMeshInterface::pointset_convexhull(), ExodusII_IO::read(), MeshTools::Modification::rotate(), MeshTools::Modification::scale(), VariationalMeshSmoother::smooth(), LaplaceMeshSmoother::smooth(), MeshTools::Modification::smooth(), VTKIO::solution_to_vtk(), MeshTools::subdomain_bounding_box(), BoundaryInfo::sync(), VTKIO::system_vectors_to_vtk(), TreeNode< N >::transform_nodes_to_elements(), MeshTools::Modification::translate(), MeshData::translate(), TriangleInterface::triangulate(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), TetGenMeshInterface::triangulate_pointset(), XdrIO::write(), TetGenIO::write(), FroIO::write(), TecplotIO::write_ascii(), MEDITIO::write_ascii(), GMVIO::write_ascii_new_impl(), GMVIO::write_ascii_old_impl(), TecplotIO::write_binary(), UNVIO::write_implementation(), GmshIO::write_mesh(), GmshIO::write_post(), XdrIO::write_serialized_nodes(), LegacyXdrIO::write_soln(), DivaIO::write_stream(), and VariationalMeshSmoother::writegr().

unsigned int MeshBase::n_nodes_on_proc ( const unsigned int  proc  )  const

Returns the number of nodes on processor proc.

Definition at line 156 of file mesh_base.C.

References DofObject::invalid_processor_id, libMesh::n_processors(), pid_nodes_begin(), and pid_nodes_end().

Referenced by n_local_nodes(), and n_unpartitioned_nodes().

00157 {
00158   // We're either counting a processor's nodes or unpartitioned
00159   // nodes
00160   libmesh_assert (proc_id < libMesh::n_processors() ||
00161           proc_id == DofObject::invalid_processor_id);
00162   
00163   return static_cast<unsigned int>(std::distance (this->pid_nodes_begin(proc_id),
00164                                                   this->pid_nodes_end  (proc_id)));
00165 }

unsigned int MeshBase::n_partitions (  )  const [inline]

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 428 of file mesh_base.h.

References _n_parts.

Referenced by Partitioner::set_node_processor_ids(), BoundaryInfo::sync(), UnstructuredMesh::write(), GMVIO::write_ascii_new_impl(), and GMVIO::write_ascii_old_impl().

00429   { return _n_parts; }

unsigned int MeshBase::n_processors (  )  const [inline]

unsigned int MeshBase::n_sub_elem (  )  const

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 191 of file mesh_base.C.

References elements_begin(), and elements_end().

00192 {
00193   unsigned int ne=0;
00194 
00195   const_element_iterator       el  = this->elements_begin();
00196   const const_element_iterator end = this->elements_end(); 
00197 
00198   for (; el!=end; ++el)
00199     ne += (*el)->n_sub_elem(); 
00200 
00201   return ne;
00202 }

unsigned int MeshBase::n_subdomains (  )  const

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 133 of file mesh_base.C.

References active_elements_begin(), and active_elements_end().

Referenced by get_info(), XdrIO::write(), and UnstructuredMesh::write().

00134 {
00135   // This requires an inspection on every processor
00136   parallel_only();
00137 
00138   const_element_iterator       el  = this->active_elements_begin();
00139   const const_element_iterator end = this->active_elements_end(); 
00140 
00141   std::set<unsigned int> subdomain_ids;
00142   
00143   for (; el!=end; ++el)
00144     subdomain_ids.insert((*el)->subdomain_id());
00145 
00146   // Some subdomains may only live on other processors
00147   Parallel::set_union(subdomain_ids, 0);
00148 
00149   unsigned int n_sbd_ids = subdomain_ids.size();
00150   Parallel::broadcast(n_sbd_ids);
00151 
00152   return n_sbd_ids;
00153 }

unsigned int MeshBase::n_unpartitioned_elem (  )  const [inline]

Returns the number of elements owned by no processor.

Definition at line 242 of file mesh_base.h.

References DofObject::invalid_processor_id, and n_elem_on_proc().

Referenced by ParallelMesh::parallel_n_elem(), and ParallelMesh::update_parallel_id_counts().

unsigned int MeshBase::n_unpartitioned_nodes (  )  const [inline]

Returns the number of nodes owned by no processor.

Definition at line 178 of file mesh_base.h.

References DofObject::invalid_processor_id, and n_nodes_on_proc().

Referenced by ParallelMesh::parallel_n_nodes(), and ParallelMesh::update_parallel_id_counts().

virtual Node& MeshBase::node ( const unsigned int  i  )  [pure virtual]

Return a reference to the $ i^{th} $ node.

Implemented in ParallelMesh, and SerialMesh.

virtual Node* & MeshBase::node_ptr ( const unsigned int  i  )  [pure virtual]

Return a pointer to the $ i^{th} $ node.

Implemented in ParallelMesh, and SerialMesh.

virtual const_node_iterator MeshBase::nodes_begin (  )  const [pure virtual]

const Node iterator accessor functions.

Implemented in ParallelMesh, and SerialMesh.

virtual const_node_iterator MeshBase::nodes_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_active_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_active_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by Partitioner::set_node_processor_ids().

virtual const_element_iterator MeshBase::not_active_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_active_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by Partitioner::set_node_processor_ids().

virtual const_element_iterator MeshBase::not_ancestor_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_ancestor_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_ancestor_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_ancestor_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_level_elements_begin ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_level_elements_begin ( const unsigned int  level  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_level_elements_end ( const unsigned int  level  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_level_elements_end ( const unsigned int  level  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_local_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_local_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_local_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_local_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_subactive_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_subactive_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::not_subactive_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::not_subactive_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

void MeshBase::partition ( const unsigned int  n_parts = libMesh::n_processors()  ) 

Call the default partitioner (currently metis_partition()).

Definition at line 259 of file mesh_base.C.

References partitioner().

Referenced by prepare_for_use().

00260 {
00261   if (partitioner().get()) // "NULL" means don't partition
00262     partitioner()->partition (*this, n_parts);
00263 }

virtual AutoPtr<Partitioner>& MeshBase::partitioner (  )  [inline, virtual]

A partitioner to use at each prepare_for_use()

Definition at line 103 of file mesh_base.h.

References _partitioner.

Referenced by partition(), and BoundaryInfo::sync().

00103 { return _partitioner; }

virtual const_element_iterator MeshBase::pid_elements_begin ( const unsigned int  proc_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::pid_elements_begin ( const unsigned int  proc_id  )  [pure virtual]

virtual const_element_iterator MeshBase::pid_elements_end ( const unsigned int  proc_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::pid_elements_end ( const unsigned int  proc_id  )  [pure virtual]

virtual const_node_iterator MeshBase::pid_nodes_begin ( const unsigned int  proc_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual node_iterator MeshBase::pid_nodes_begin ( const unsigned int  proc_id  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshTools::bounding_box(), and n_nodes_on_proc().

virtual const_node_iterator MeshBase::pid_nodes_end ( const unsigned int  proc_id  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual node_iterator MeshBase::pid_nodes_end ( const unsigned int  proc_id  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshTools::bounding_box(), and n_nodes_on_proc().

const PointLocatorBase & MeshBase::point_locator (  )  const

returns a reference to a PointLocatorBase object for this mesh.

Definition at line 285 of file mesh_base.C.

References _point_locator, PointLocatorBase::build(), AutoPtr< Tp >::get(), AutoPtr< Tp >::release(), AutoPtr< Tp >::reset(), and MeshEnums::TREE.

Referenced by PeriodicBoundaries::neighbor().

00286 {
00287   if (_point_locator.get() == NULL)
00288     _point_locator.reset (PointLocatorBase::build(TREE, *this).release());
00289 
00290   return *_point_locator;
00291 }

void MeshBase::prepare_for_use ( const bool  skip_renumber_nodes_and_elements = false  ) 

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 read_xda_file boolean flag is true when prepare_for_use is called from Mesh::read after reading an xda file. It prevents the renumbering of nodes and elements. In general, leave this at the default value of false.

Definition at line 80 of file mesh_base.C.

References _is_prepared, clear_point_locator(), delete_remote_elements(), find_neighbors(), partition(), and renumber_nodes_and_elements().

Referenced by UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Modification::all_tri(), MeshTools::Generation::build_cube(), InfElemBuilder::build_inf_elem(), MeshRefinement::coarsen_elements(), Triangle::copy_tri_to_mesh(), UnstructuredMesh::create_submesh(), MeshTools::Modification::flatten(), UnstructuredMesh::read(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), BoundaryInfo::sync(), MeshRefinement::uniformly_coarsen(), and MeshRefinement::uniformly_refine().

00081 {  
00082   // Renumber the nodes and elements so that they in contiguous
00083   // blocks.  By default, skip_renumber_nodes_and_elements is false,
00084   // however we may skip this step by passing
00085   // skip_renumber_nodes_and_elements==true to this function.
00086   //
00087   // Instances where you if prepare_for_use() should not renumber the nodes
00088   // and elements include reading in e.g. an xda/r or gmv file. In
00089   // this case, the ordering of the nodes may depend on an accompanying
00090   // solution, and the node ordering cannot be changed.
00091   if(!skip_renumber_nodes_and_elements)
00092     this->renumber_nodes_and_elements();
00093   
00094   // Let all the elements find their neighbors
00095   this->find_neighbors();
00096 
00097   // Partition the mesh.
00098   this->partition();
00099   
00100   // If we're using ParallelMesh, we'll want it parallelized.
00101   this->delete_remote_elements();
00102 
00103   if(!skip_renumber_nodes_and_elements)
00104     this->renumber_nodes_and_elements();
00105 
00106   // Reset our PointLocator.  This needs to happen any time the elements
00107   // in the underlying elements in the mesh have changed, so we do it here.
00108   this->clear_point_locator();
00109 
00110   // The mesh is now prepared for use.
00111   _is_prepared = true;
00112 }

void MeshBase::print_info ( std::ostream &  os = std::cout  )  const

Prints relevant information about the mesh.

Definition at line 243 of file mesh_base.C.

References get_info().

Referenced by InfElemBuilder::build_inf_elem(), and operator<<().

00244 {
00245   os << this->get_info()
00246      << std::endl;
00247 }

virtual void MeshBase::read ( const std::string &  name,
MeshData mesh_data = NULL,
bool  skip_renumber_nodes_and_elements = false 
) [pure virtual]

Interfaces for reading/writing a mesh to/from a file. Must be implemented in derived classes.

Implemented in UnstructuredMesh.

unsigned int MeshBase::recalculate_n_partitions (  ) 

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 267 of file mesh_base.C.

References _n_parts, active_elements_begin(), active_elements_end(), and std::max().

00268 {
00269   const_element_iterator       el  = this->active_elements_begin();
00270   const const_element_iterator end = this->active_elements_end(); 
00271 
00272   unsigned int max_proc_id=0;
00273   
00274   for (; el!=end; ++el)
00275     max_proc_id = std::max(max_proc_id, static_cast<unsigned int>((*el)->processor_id()));
00276 
00277   // The number of partitions is one more than the max processor ID.
00278   _n_parts = max_proc_id+1;
00279 
00280   return _n_parts;
00281 }

virtual void MeshBase::renumber_elem ( unsigned int  old_id,
unsigned int  new_id 
) [pure virtual]

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.

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshCommunication::make_elems_parallel_consistent().

virtual void MeshBase::renumber_node ( unsigned int  old_id,
unsigned int  new_id 
) [pure virtual]

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.

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshCommunication::make_node_ids_parallel_consistent().

virtual void MeshBase::renumber_nodes_and_elements (  )  [pure virtual]

After partitoning a mesh it is useful to renumber the nodes and elements so that they lie in contiguous blocks on the processors. This method does just that.

Implemented in ParallelMesh, and SerialMesh.

Referenced by UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), UnstructuredMesh::contract(), and prepare_for_use().

virtual void MeshBase::reserve_elem ( const unsigned int  ne  )  [pure virtual]

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.

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshTools::Generation::build_cube(), XdrIO::read(), ExodusII_IO::read(), LegacyXdrIO::read_mesh(), and GmshIO::read_mesh().

virtual void MeshBase::reserve_nodes ( const unsigned int  nn  )  [pure virtual]

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.

Implemented in ParallelMesh, and SerialMesh.

Referenced by UnstructuredMesh::all_second_order(), MeshTools::Generation::build_cube(), XdrIO::read(), ExodusII_IO::read(), LegacyXdrIO::read_mesh(), and GmshIO::read_mesh().

void MeshBase::set_mesh_dimension ( unsigned int  d  )  [inline]

Resets the logical dimension of the mesh. Should only be called on an empty mesh.

Definition at line 147 of file mesh_base.h.

References _dim, and n_elem().

Referenced by MeshTools::Generation::build_cube(), MeshTools::Generation::build_delaunay_square(), Triangle::copy_tri_to_mesh(), and TriangleInterface::triangulate().

00148   { libmesh_assert(!this->n_elem()); _dim = d; }

unsigned int& MeshBase::set_n_partitions (  )  [inline, protected]

Returns a writeable reference to the number of partitions.

Definition at line 677 of file mesh_base.h.

References _n_parts.

Referenced by Partitioner::partition(), Partitioner::repartition(), and BoundaryInfo::sync().

00678   { return _n_parts; }

unsigned int MeshBase::spatial_dimension (  )  const [inline]

Returns the spatial dimension of the mesh. Note that this is defined at compile time in the header libmesh_common.h.

Definition at line 154 of file mesh_base.h.

Referenced by get_info(), ExodusII_IO_Helper::initialize(), UNVIO::node_out(), LegacyXdrIO::read_mesh(), MeshTools::Modification::scale(), MeshTools::subdomain_bounding_box(), and LegacyXdrIO::write_mesh().

00155   { return static_cast<unsigned int>(LIBMESH_DIM); }

virtual const_element_iterator MeshBase::subactive_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::subactive_elements_begin (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by Partitioner::set_node_processor_ids().

virtual const_element_iterator MeshBase::subactive_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::subactive_elements_end (  )  [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

Referenced by Partitioner::set_node_processor_ids().

virtual const_element_iterator MeshBase::type_elements_begin ( const ElemType  type  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::type_elements_begin ( const ElemType  type  )  [pure virtual]

virtual const_element_iterator MeshBase::type_elements_end ( const ElemType  type  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual element_iterator MeshBase::type_elements_end ( const ElemType  type  )  [pure virtual]

virtual const_element_iterator MeshBase::unpartitioned_elements_begin (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual const_element_iterator MeshBase::unpartitioned_elements_end (  )  const [pure virtual]

Implemented in ParallelMesh, and SerialMesh.

virtual void MeshBase::update_parallel_id_counts (  )  [pure virtual]

Updates parallel caches so that methods like n_elem() accurately reflect changes on other processors

Implemented in ParallelMesh, and SerialMesh.

Referenced by MeshRefinement::_coarsen_elements(), and MeshRefinement::_refine_elements().

virtual void MeshBase::write ( const std::string &  name,
MeshData mesh_data = NULL 
) [pure virtual]

Implemented in UnstructuredMesh.


Friends And Related Function Documentation

friend class BoundaryInfo [friend]

Make the BoundaryInfo class a friend so that it can create and interact with BoundaryMesh.

Definition at line 728 of file mesh_base.h.

std::ostream& operator<< ( std::ostream &  os,
const MeshBase m 
) [friend]

Equivalent to calling print_info() above, but now you can write: Mesh mesh; std::cout << mesh << std::endl;

Definition at line 250 of file mesh_base.C.

00251 {
00252   m.print_info(os);
00253   return os;
00254 }

friend class Partitioner [friend]

The partitioner class is a friend so that it can set the number of partitions.

Definition at line 722 of file mesh_base.h.


Member Data Documentation

unsigned int MeshBase::_dim [protected]

The logical dimension of the mesh.

Definition at line 694 of file mesh_base.h.

Referenced by UnstructuredMesh::copy_nodes_and_elements(), UnstructuredMesh::find_neighbors(), mesh_dimension(), MeshBase(), and set_mesh_dimension().

bool MeshBase::_is_prepared [protected]

Flag indicating if the mesh has been prepared for use.

Definition at line 699 of file mesh_base.h.

Referenced by UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), clear(), UnstructuredMesh::copy_nodes_and_elements(), is_prepared(), and prepare_for_use().

unsigned int MeshBase::_n_parts [protected]

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 689 of file mesh_base.h.

Referenced by clear(), UnstructuredMesh::copy_nodes_and_elements(), n_partitions(), recalculate_n_partitions(), and set_n_partitions().

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 716 of file mesh_base.h.

Referenced by ParallelMesh::ParallelMesh(), partitioner(), and SerialMesh::SerialMesh().

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 708 of file mesh_base.h.

Referenced by clear_point_locator(), and point_locator().


The documentation for this class was generated from the following files:

Site Created By: libMesh Developers
Last modified: November 25 2009 03:44:36.

Hosted By:
SourceForge.net Logo