libMesh
Loading...
Searching...
No Matches
mesh_modification.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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_MESH_MODIFICATION_H
21#define LIBMESH_MESH_MODIFICATION_H
22
23// Local Includes
24#include "libmesh/libmesh_common.h"
25#include "libmesh/id_types.h" // for boundary_id_type, subdomain_id_type
26#include "libmesh/tensor_value.h"
27
28// C++ Includes
29#include <set>
30
31namespace libMesh
32{
33
34// forward declarations
35template <typename Output> class FunctionBase;
36class MeshBase;
37class Surface;
38
39
40// ------------------------------------------------------------
41// MeshTools::Modification namespace
42namespace MeshTools
43{
50namespace Modification
51{
59void distort (MeshBase & mesh,
60 const Real factor, const bool perturb_boundary=false);
61
75
84
99 const FunctionBase<Real> & mapfunc);
100
101
107void translate (MeshBase & mesh,
108 const Real xt=0., const Real yt=0., const Real zt=0.);
109
110// /**
111// * Rotates the mesh in the xy plane. The rotation is
112// * counter-clock-wise (mathematical definition).
113// * The angle is in degrees (360 make a full circle)
114// */
115// void rotate2D (MeshBase & mesh,
116// const Real alpha=0.);
117
127 const Real phi, const Real theta=0., const Real psi=0.);
128
135void scale (MeshBase & mesh,
136 const Real xs, const Real ys=0., const Real zs=0.);
137
146void all_tri (MeshBase & mesh);
147
154void all_rbb (MeshBase & mesh);
155
168void smooth(MeshBase &, unsigned int, Real);
169
191 const Surface & surface,
192 std::set<std::size_t> ids={},
193 bool use_boundary_nodes=true);
194
195#ifdef LIBMESH_ENABLE_AMR
206void flatten(MeshBase & mesh);
207#endif // #ifdef LIBMESH_ENABLE_AMR
208
214 const boundary_id_type old_id,
215 const boundary_id_type new_id);
216
222 const subdomain_id_type old_id,
223 const subdomain_id_type new_id);
224
225} // end namespace Meshtools::Modification
226} // end namespace MeshTools
227
228} // namespace libMesh
229
230
231#endif // LIBMESH_MESH_MODIFICATION_H
Base class for functors that can be evaluated at a point and (optionally) time.
This is the MeshBase class.
Definition mesh_base.h:81
The base class for all "surface" related geometric objects.
Definition surface.h:43
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
MeshBase & mesh
void all_tri(MeshBase &mesh)
Subdivides any non-simplex elements in a Mesh to produce simplex (triangular in 2D,...
void smooth(MeshBase &, unsigned int, Real)
Smooth the mesh with a simple Laplace smoothing algorithm.
void change_subdomain_id(MeshBase &mesh, const subdomain_id_type old_id, const subdomain_id_type new_id)
Finds any subdomain ids that are currently old_id, changes them to new_id.
void flatten(MeshBase &mesh)
Removes all the refinement tree structure of Mesh, leaving only the highest-level (most-refined) elem...
void change_boundary_id(MeshBase &mesh, const boundary_id_type old_id, const boundary_id_type new_id)
Finds any boundary ids that are currently old_id, changes them to new_id.
void scale(MeshBase &mesh, const Real xs, const Real ys=0., const Real zs=0.)
Scales the mesh.
void interpolate_surface(MeshBase &mesh, const Surface &surface, std::set< std::size_t > ids={}, bool use_boundary_nodes=true)
Move nodes in mesh to their closest points on the specified surface.
void all_rbb(MeshBase &mesh)
Converts all element geometric mappings from the default Lagrange to the more flexible Rational-Bezie...
void redistribute(MeshBase &mesh, const FunctionBase< Real > &mapfunc)
Deterministically perturb the nodal locations.
void distort(MeshBase &mesh, const Real factor, const bool perturb_boundary=false)
Randomly perturb the nodal locations.
void orient_elements(MeshBase &mesh)
Redo the nodal ordering of each element as necessary to give the element Jacobian a positive orientat...
RealTensorValue rotate(MeshBase &mesh, const Real phi, const Real theta=0., const Real psi=0.)
Rotates the mesh in 3D space.
void translate(MeshBase &mesh, const Real xt=0., const Real yt=0., const Real zt=0.)
Translates the mesh.
void permute_elements(MeshBase &mesh)
Randomly permute the nodal ordering of each element (without twisting the element mapping).
The libMesh namespace provides an interface to certain functionality in the library.
int8_t boundary_id_type
Definition id_types.h:51
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real