libMesh
unstructured_mesh.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 
61 #ifndef LIBMESH_DISABLE_COMMWORLD
62 
70 #ifdef LIBMESH_ENABLE_DEPRECATED
71  UnstructuredMesh (unsigned char dim=1);
72 #endif
73 #endif
74 
78  virtual ~UnstructuredMesh();
79 
94  virtual void read (const std::string & name,
95  void * mesh_data=libmesh_nullptr,
96  bool skip_renumber_nodes_and_elements=false,
97  bool skip_find_neighbors=false) libmesh_override;
102  virtual void write (const std::string & name) libmesh_override;
103 
108  void write (const std::string & name,
109  const std::vector<Number> & values,
110  const std::vector<std::string> & variable_names);
111 
118  virtual void all_first_order () libmesh_override;
119 
131  virtual void all_second_order (const bool full_ordered=true) libmesh_override;
132 
139  void create_pid_mesh (UnstructuredMesh & pid_mesh,
140  const processor_id_type pid) const;
141 
147  void create_submesh (UnstructuredMesh & new_mesh,
149  const const_element_iterator & it_end) const;
150 
151 
156  virtual void copy_nodes_and_elements(const UnstructuredMesh & other_mesh, const bool skip_find_neighbors=false);
157 
158 
162  virtual void find_neighbors (const bool reset_remote_elements = false,
163  const bool reset_current_list = true) libmesh_override;
164 
165 #ifdef LIBMESH_ENABLE_AMR
166 
171  virtual bool contract () libmesh_override;
172 #endif // #ifdef LIBMESH_ENABLE_AMR
173 
174 };
175 
176 
177 } // namespace libMesh
178 
179 #endif // LIBMESH_UNSTRUCTURED_MESH_H
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
virtual void read(const std::string &name, void *mesh_data=libmesh_nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false) libmesh_override
Reads the file specified by name.
Encapsulates the MPI_Comm object.
Definition: parallel.h:657
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.
virtual void all_first_order() libmesh_override
Converts a mesh with higher-order elements into a mesh with linear elements.
virtual void copy_nodes_and_elements(const UnstructuredMesh &other_mesh, const bool skip_find_neighbors=false)
Deep copy of another unstructured mesh class (used by subclass copy constructors) ...
The definition of the const_element_iterator struct.
Definition: mesh_base.h:1494
unsigned int dim
virtual void all_second_order(const bool full_ordered=true) libmesh_override
Converts a (conforming, non-refined) mesh with linear elements into a mesh with second-order elements...
uint8_t processor_id_type
Definition: id_types.h:99
const class libmesh_nullptr_t libmesh_nullptr
The libMesh namespace provides an interface to certain functionality in the library.
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true) libmesh_override
Other functions from MeshBase requiring re-definition.
This is the MeshBase class.
Definition: mesh_base.h:68
void create_submesh(UnstructuredMesh &new_mesh, 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...
The UnstructuredMesh class is derived from the MeshBase class.
virtual bool contract() libmesh_override
Delete subactive (i.e.
virtual void write(const std::string &name) libmesh_override
Write the file specified by name.
UnstructuredMesh(const Parallel::Communicator &comm_in, unsigned char dim=1)
Constructor.
virtual ~UnstructuredMesh()
Destructor.