$extrastylesheet
unstructured_mesh.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_UNSTRUCTURED_MESH_H
00021 #define LIBMESH_UNSTRUCTURED_MESH_H
00022 
00023 // Local Includes -----------------------------------
00024 #include "libmesh/mesh_base.h"
00025 
00026 // C++ Includes   -----------------------------------
00027 #include <cstddef>
00028 
00029 namespace libMesh
00030 {
00031 
00032 // Forward Declarations
00033 class MeshData;
00034 
00035 
00049 // ------------------------------------------------------------
00050 // UnstructuredMesh class definition
00051 class UnstructuredMesh : public MeshBase
00052 {
00053 public:
00054 
00060   explicit
00061   UnstructuredMesh (const Parallel::Communicator &comm_in,
00062                     unsigned char dim=1);
00063 
00064 #ifndef LIBMESH_DISABLE_COMMWORLD
00065 
00070   UnstructuredMesh (unsigned char dim=1);
00071 #endif
00072 
00076   virtual ~UnstructuredMesh();
00077 
00091   void read (const std::string& name,
00092              MeshData* mesh_data=NULL,
00093              bool skip_renumber_nodes_and_elements=false);
00102   void write (const std::string& name,
00103               MeshData* mesh_data=NULL);
00104 
00109   void write (const std::string& name,
00110               const std::vector<Number>& values,
00111               const std::vector<std::string>& variable_names);
00112 
00119   virtual void all_first_order ();
00120 
00132   virtual void all_second_order (const bool full_ordered=true);
00133 
00140   void create_pid_mesh (UnstructuredMesh& pid_mesh,
00141                         const processor_id_type pid) const;
00142 
00148   void create_submesh (UnstructuredMesh& new_mesh,
00149                        const_element_iterator& it,
00150                        const const_element_iterator& it_end) const;
00151 
00152 
00157   virtual void copy_nodes_and_elements(const UnstructuredMesh& other_mesh, const bool skip_find_neighbors=false);
00158 
00159 
00163   virtual void find_neighbors (const bool reset_remote_elements = false,
00164                                const bool reset_current_list    = true);
00165 
00166 #ifdef LIBMESH_ENABLE_AMR
00167 
00172   virtual bool contract ();
00173 #endif // #ifdef LIBMESH_ENABLE_AMR
00174 
00175 };
00176 
00177 
00178 } // namespace libMesh
00179 
00180 #endif // LIBMESH_UNSTRUCTURED_MESH_H