v0.9.0
MeshRefinement.hpp
Go to the documentation of this file.
1 /** \file MeshRefinement.hpp
2  * \brief Interface for mesh refinement
3  *
4  * \ingroup mofem_refiner
5  */
6 
7 /*
8  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11  * License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
15  */
16 
17 #ifndef __MESHREFINE_HPP__
18 #define __MESHREFINE_HPP__
19 
20 #include "UnknownInterface.hpp"
21 
22 namespace MoFEM {
23 
26 
27 /** \brief Mesh refinement interface
28 
29  Currently this class is abstraction to Core interface. In future should be
30  outsourced as independent interface.
31 
32  \bug Not working on partitioned meshes
33  \bug Need to be implemented as a stand alone interface not as a part of core
34  structure which should be only basic database
35  \bug If outsourced, class member functions should follow name convention
36  \bug Spelling mistakes will be corrected with names fix to follow name
37  convetion
38 
39  \ingroup mofem_refiner
40  */
42 
44  UnknownInterface **iface) const;
45 
47  MeshRefinement(const MoFEM::Core &core);
48 
49  /// destructor
51 
52  /**
53  * \brief make vertices in the middle of edges in meshset and add them to
54  * refinement levels defined by bit
55  *
56  * Takes entities fromm meshsets and queried recursively (get entities from
57  * meshsets in meshsets, usually have to be used for CUBIT meshset).
58  * If meshset does not contain any edges, get entities in dimension 3 and get
59  * edge adjacencies.
60  *
61  * \param EntityHandle meshset
62  * \param BitRefLevel bitLevel
63  * \param recursive If true, meshsets containing meshsets are queried
64  * recursively. Returns the contents of meshsets, but not the meshsets
65  * themselves if true.
66  */
68  const EntityHandle meshset, const BitRefLevel &bit,
69  const bool recursive = false, int verb = QUIET, EntityHandle start_v = 0);
70 
71  /// \deprecated Use function with correct spelling
73  const EntityHandle meshset, const BitRefLevel &bit,
74  const bool recursive = false, int verb = QUIET,
75  EntityHandle start_v = 0) {
76  return add_vertices_in_the_middle_of_edges(meshset, bit, recursive, verb,
77  start_v);
78  }
79 
80  /**
81  * \brief make vertices in the middle of edges in meshset and add them to
82  * Refinement levels defined by bit
83  *
84  * Takes entities from meshsets and queried recursively (get entities from
85  * meshsets in meshsets, usually have to be used for CUBIT meshset).
86  * If meshset does not contain any edges, get entities in dimension 3 and get
87  * edge adjacencies.
88  *
89  * \param Range consisting edges for refine
90  * \param BitRefLevel bitLevel
91  * \param recursive If true, meshsets containing meshsets are queried
92  * recursively. Returns the contents of meshsets, but not the meshsets
93  * themselves if true.
94  */
95  virtual MoFEMErrorCode
96  add_vertices_in_the_middle_of_edges(const Range &edges, const BitRefLevel &bit,
97  int verb = QUIET,
98  EntityHandle start_v = 0);
99 
100  /// \deprecated Use function with correct spelling
102  const Range &edges, const BitRefLevel &bit, int verb = QUIET,
103  EntityHandle start_v = 0) {
104  return add_vertices_in_the_middle_of_edges(edges, bit, verb, start_v);
105  }
106 
107  /**\brief refine TET in the meshset
108  *
109  * \param EntityHandle meshset
110  * \param BitRefLevel bitLevel
111  * \param bool respect_interface If TRUE, interface elements would be refined
112  * \param verb verbosity level
113  * \param Range * pointer to range in not null check consistency of refinement
114  */
115  virtual MoFEMErrorCode refine_TET(const EntityHandle meshset,
116  const BitRefLevel &bit,
117  const bool respect_interface = false,
118  int verb = QUIET, Range *ref_edges = NULL,
119  const bool debug = false);
120 
121  /**\brief refine TET in the meshset
122  *
123  * \param Range of tets to refine
124  * \param BitRefLevel bitLevel
125  * \param BitRefLevel bitLevel
126  * \param bool respect_interface If TRUE, interface elements would be refined
127  * \param verb verbosity level
128  * \param Range * pointer to range in not null check consistency of refinement
129  */
130  virtual MoFEMErrorCode refine_TET(const Range &tets, const BitRefLevel &bit,
131  const bool respect_interface = false,
132  int verb = QUIET, Range *ref_edges = NULL,
133  const bool debug = false);
134 
135  /**\brief refine PRISM in the meshset
136  *
137  * \param EntityHandle meshset
138  * \param BitRefLevel bitLevel
139  */
140  virtual MoFEMErrorCode refine_PRISM(const EntityHandle meshset,
141  const BitRefLevel &bit, int verb = QUIET);
142 
143  /**\brief refine meshset, i.e. add child of refined entities to meshset
144  *
145  * \param EntityHandle meshset where to save the child refined entities
146  * \param BitRefLevel bitLevel
147  * \param recursive If true, meshsets containing meshsets are queried
148  * recursively. Returns the contents of meshsets, but not the meshsets
149  * themselves if true.
150  */
151  virtual MoFEMErrorCode refine_MESHSET(const EntityHandle meshset,
152  const BitRefLevel &bit,
153  const bool recursive = false,
154  int verb = QUIET);
155 };
156 
157 } // namespace MoFEM
158 
159 #endif // __MESHREFINE_HPP__
160 
161 /**
162  * \defgroup mofem_refiner MeshRefinement
163  * \brief Refine mesh by splitting edges
164  *
165  */
MeshRefinement(const MoFEM::Core &core)
MoFEM interface unique ID.
DEPRECATED MoFEMErrorCode add_verices_in_the_middel_of_edges(const Range &edges, const BitRefLevel &bit, int verb=QUIET, EntityHandle start_v=0)
virtual MoFEMErrorCode refine_TET(const EntityHandle meshset, const BitRefLevel &bit, const bool respect_interface=false, int verb=QUIET, Range *ref_edges=NULL, const bool debug=false)
refine TET in the meshset
virtual MoFEMErrorCode add_vertices_in_the_middle_of_edges(const EntityHandle meshset, const BitRefLevel &bit, const bool recursive=false, int verb=QUIET, EntityHandle start_v=0)
make vertices in the middle of edges in meshset and add them to refinement levels defined by bit
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, UnknownInterface **iface) const
DEPRECATED MoFEMErrorCode add_verices_in_the_middel_of_edges(const EntityHandle meshset, const BitRefLevel &bit, const bool recursive=false, int verb=QUIET, EntityHandle start_v=0)
base class for all interface classes
Core (interface) class.
Definition: Core.hpp:50
MoFEM interface.
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
virtual MoFEMErrorCode refine_PRISM(const EntityHandle meshset, const BitRefLevel &bit, int verb=QUIET)
refine PRISM in the meshset
virtual MoFEMErrorCode refine_MESHSET(const EntityHandle meshset, const BitRefLevel &bit, const bool recursive=false, int verb=QUIET)
refine meshset, i.e. add child of refined entities to meshset
static const MOFEMuuid IDD_MOFEMMeshRefine
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
static const bool debug
Mesh refinement interface.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
#define DEPRECATED
Definition: definitions.h:29