unstructured_mesh.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_UNSTRUCTURED_MESH_H
21 #define LIBMESH_UNSTRUCTURED_MESH_H
22 
23 // Local Includes
24 #include "libmesh/mesh_base.h"
25 
26 // C++ Includes
27 #include <cstddef>
28 
29 namespace libMesh
30 {
31 
48 class UnstructuredMesh : public MeshBase
49 {
50 public:
51 
57  explicit
59  unsigned char dim=1);
60 
64  UnstructuredMesh(const UnstructuredMesh &) = default;
65 
69  UnstructuredMesh(UnstructuredMesh &&) = default;
70 
74  UnstructuredMesh & operator= (const UnstructuredMesh &) = delete;
76 
80  virtual ~UnstructuredMesh();
81 
96  virtual void read (const std::string & name,
97  void * mesh_data=nullptr,
98  bool skip_renumber_nodes_and_elements=false,
99  bool skip_find_neighbors=false) override;
104  virtual void write (const std::string & name) override;
105 
110  void write (const std::string & name,
111  const std::vector<Number> & values,
112  const std::vector<std::string> & variable_names);
113 
120  virtual void all_first_order () override;
121 
133  virtual void all_second_order (const bool full_ordered=true) override;
134 
141  void create_pid_mesh (UnstructuredMesh & pid_mesh,
142  const processor_id_type pid) const;
143 
149  void create_submesh (UnstructuredMesh & new_mesh,
150  const const_element_iterator & it,
151  const const_element_iterator & it_end) const;
152 
153 
158  virtual void copy_nodes_and_elements (const UnstructuredMesh & other_mesh,
159  const bool skip_find_neighbors = false,
160  dof_id_type element_id_offset = 0,
161  dof_id_type node_id_offset = 0,
162  unique_id_type unique_id_offset = 0);
163 
164 
168  virtual void find_neighbors (const bool reset_remote_elements = false,
169  const bool reset_current_list = true) override;
170 
171 #ifdef LIBMESH_ENABLE_AMR
172 
177  virtual bool contract () override;
178 #endif // #ifdef LIBMESH_ENABLE_AMR
179 
180 };
181 
182 
183 } // namespace libMesh
184 
185 #endif // LIBMESH_UNSTRUCTURED_MESH_H
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
UnstructuredMesh & operator=(const UnstructuredMesh &)=delete
virtual void copy_nodes_and_elements(const UnstructuredMesh &other_mesh, const bool skip_find_neighbors=false, dof_id_type element_id_offset=0, dof_id_type node_id_offset=0, unique_id_type unique_id_offset=0)
uint8_t processor_id_type
Definition: id_types.h:99
virtual void all_first_order() override
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true) override
void create_pid_mesh(UnstructuredMesh &pid_mesh, const processor_id_type pid) const
Base class for Mesh.
Definition: mesh_base.h:77
virtual bool contract() override
Base class for Replicated and Distributed meshes.
UnstructuredMesh(const Parallel::Communicator &comm_in, unsigned char dim=1)
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false) override
virtual void all_second_order(const bool full_ordered=true) override
uint8_t unique_id_type
Definition: id_types.h:79
void create_submesh(UnstructuredMesh &new_mesh, const const_element_iterator &it, const const_element_iterator &it_end) const
virtual void write(const std::string &name) override
uint8_t dof_id_type
Definition: id_types.h:64