libMesh
mesh_smoother_vsmoother.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 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_SMOOTHER_VSMOOTHER_H
21 #define LIBMESH_MESH_SMOOTHER_VSMOOTHER_H
22 
23 #include "libmesh/libmesh_config.h"
24 #if defined(LIBMESH_ENABLE_VSMOOTHER)
25 
26 // Local Includes
27 #include "libmesh/libmesh_common.h"
28 #include "libmesh/mesh_smoother.h"
29 #include "libmesh/variational_smoother_system.h"
30 #include "petsc_diff_solver.h"
31 
32 // C++ Includes
33 #include <cstddef>
34 #include <vector>
35 #include <map>
36 #include <fstream>
37 
38 namespace libMesh
39 {
40 
41 // Forward declarations
42 class UnstructuredMesh;
43 
66 {
67 public:
68 
73  Real dilation_weight=0.5,
74  const bool preserve_subdomain_boundaries=true);
75 
79  virtual ~VariationalMeshSmoother() = default;
80 
87  virtual void smooth() override {this->smooth(1); }
88 
94  void smooth(unsigned int n_iterations);
95 
96 
97 private:
98 
103 
106 };
107 
108 } // namespace libMesh
109 
110 #endif // defined(LIBMESH_ENABLE_VSMOOTHER)
111 
112 #endif // LIBMESH_MESH_SMOOTHER_VSMOOTHER_H
const Real _dilation_weight
Smoother control variables.
virtual ~VariationalMeshSmoother()=default
Destructor.
MeshBase & mesh
The libMesh namespace provides an interface to certain functionality in the library.
The UnstructuredMesh class is derived from the MeshBase class.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This is an implementation of Larisa Branets&#39; smoothing algorithms.
VariationalMeshSmoother(UnstructuredMesh &mesh, Real dilation_weight=0.5, const bool preserve_subdomain_boundaries=true)
Simple constructor to use for smoothing purposes.
This class provides the necessary interface for mesh smoothing.
Definition: mesh_smoother.h:38
const bool _preserve_subdomain_boundaries
Whether subdomain boundaries are subject to change via smoothing.
virtual void smooth() override
Redefinition of the smooth function from the base class.