DOLFIN
DOLFIN C++ interface
MeshSmoothing.h
1 // Copyright (C) 2008-2010 Anders Logg
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2008-07-16
19 // Last changed: 2010-03-02
20 
21 #ifndef __MESH_SMOOTHING_H
22 #define __MESH_SMOOTHING_H
23 
24 namespace dolfin
25 {
26 
27  class Mesh;
28  class SubDomain;
29 
31 
33  {
34  public:
35 
37  static void smooth(Mesh& mesh, std::size_t num_iterations=1);
38 
41  static void smooth_boundary(Mesh& mesh,
42  std::size_t num_iterations=1,
43  bool harmonic_smoothing=true);
44 
47  static void snap_boundary(Mesh& mesh,
48  const SubDomain& sub_domain,
49  bool harmonic_smoothing=true);
50 
51  private:
52 
53  // Move interior vertices
54  static void move_interior_vertices(Mesh& mesh,
55  BoundaryMesh& boundary,
56  bool harmonic_smoothing);
57 
58  };
59 
60 }
61 
62 #endif
Definition: SubDomain.h:42
Definition: adapt.h:29
static void smooth_boundary(Mesh &mesh, std::size_t num_iterations=1, bool harmonic_smoothing=true)
Definition: MeshSmoothing.cpp:160
static void smooth(Mesh &mesh, std::size_t num_iterations=1)
Smooth internal vertices of mesh by local averaging.
Definition: MeshSmoothing.cpp:41
static void snap_boundary(Mesh &mesh, const SubDomain &sub_domain, bool harmonic_smoothing=true)
Definition: MeshSmoothing.cpp:176
This class implements various mesh smoothing algorithms.
Definition: MeshSmoothing.h:32
Definition: BoundaryMesh.h:39
Definition: Mesh.h:82