libMesh
unstructured_mesh.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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
58  UnstructuredMesh (const Parallel::Communicator & comm_in,
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 
165  virtual void copy_nodes_and_elements (const UnstructuredMesh & other_mesh,
166  const bool skip_find_neighbors = false,
167  dof_id_type element_id_offset = 0,
168  dof_id_type node_id_offset = 0,
169  unique_id_type unique_id_offset = 0);
170 
171 
175  virtual void find_neighbors (const bool reset_remote_elements = false,
176  const bool reset_current_list = true) override;
177 
178 #ifdef LIBMESH_ENABLE_AMR
179 
184  virtual bool contract () override;
185 #endif // #ifdef LIBMESH_ENABLE_AMR
186 
187 };
188 
189 
190 } // namespace libMesh
191 
192 #endif // LIBMESH_UNSTRUCTURED_MESH_H
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::UnstructuredMesh::find_neighbors
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true) override
Other functions from MeshBase requiring re-definition.
Definition: unstructured_mesh.C:257
libMesh::unique_id_type
uint8_t unique_id_type
Definition: id_types.h:86
libMesh::UnstructuredMesh::create_pid_mesh
void create_pid_mesh(UnstructuredMesh &pid_mesh, const processor_id_type pid) const
Generates a new mesh containing all the elements which are assigned to processor pid.
Definition: unstructured_mesh.C:672
libMesh::UnstructuredMesh::operator=
UnstructuredMesh & operator=(const UnstructuredMesh &)=delete
Copy and move assignment are not allowed.
libMesh::UnstructuredMesh::copy_nodes_and_elements
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)
Deep copy of nodes and elements from another unstructured mesh class (used by subclass copy construct...
Definition: unstructured_mesh.C:61
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
dim
unsigned int dim
Definition: adaptivity_ex3.C:113
libMesh::UnstructuredMesh::all_first_order
virtual void all_first_order() override
Converts a mesh with higher-order elements into a mesh with linear elements.
Definition: unstructured_mesh.C:860
libMesh::UnstructuredMesh::~UnstructuredMesh
virtual ~UnstructuredMesh()
Destructor.
Definition: unstructured_mesh.C:246
libMesh::UnstructuredMesh::write
virtual void write(const std::string &name) override
Write the file specified by name.
Definition: unstructured_mesh.C:650
libMesh::MeshBase
This is the MeshBase class.
Definition: mesh_base.h:78
libMesh::UnstructuredMesh::contract
virtual bool contract() override
Delete subactive (i.e.
Definition: unstructured_mesh.C:797
libMesh::UnstructuredMesh::read
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false) override
Reads the file specified by name.
Definition: unstructured_mesh.C:620
libMesh::processor_id_type
uint8_t processor_id_type
Definition: id_types.h:104
libMesh::MeshBase::const_element_iterator
The definition of the const_element_iterator struct.
Definition: mesh_base.h:1891
libMesh::UnstructuredMesh::UnstructuredMesh
UnstructuredMesh(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
Definition: unstructured_mesh.C:52
libMesh::UnstructuredMesh
The UnstructuredMesh class is derived from the MeshBase class.
Definition: unstructured_mesh.h:48
libMesh::UnstructuredMesh::all_second_order
virtual void all_second_order(const bool full_ordered=true) override
Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements...
Definition: unstructured_mesh.C:998
libMesh::UnstructuredMesh::create_submesh
void create_submesh(UnstructuredMesh &new_mesh, const const_element_iterator &it, const const_element_iterator &it_end) const
Constructs a mesh called "new_mesh" from the current mesh by iterating over the elements between it a...
Definition: unstructured_mesh.C:707
libMesh::Quality::name
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42