geometricElementTransformPointSmoother.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2024 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pointSmoothers::geometricElementTransformPointSmoother
28 
29 Description
30  Geometric Element Transformation Method (GETMe) point smoother. Points are
31  moved in a direction normal to the face of the dual element. This tends to
32  orthogonalise elements. This method can "push" as well as "pull".
33 
34  The original references for this method only formulate it for a limited
35  variety of specific polyhedra. This version is written for arbitrary
36  polyhedra, and most closely follows the following reference:
37 
38  \verbatim
39  "Fast smoothing of mixed volume meshes based on the effective geometric
40  element transformation method"
41  Dimitris Vartziotis, Joachim Wipper,
42  Comput. Methods Appl. Mech. Engrg. 201-204 (2012) 65-81
43  \endverbatim
44 
45  This implementation does not include the various specific measures employed
46  in the referred article to improve the quality of types of irregular
47  polyhedra. It also does not use the same quality criteria as these are only
48  suitable for cell vertices with exactly three connecting edges.
49 
50 SourceFiles
51  geometricElementTransformPointSmoother.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef geometricElementTransformPointSmoother_H
56 #define geometricElementTransformPointSmoother_H
57 
58 #include "pointSmoother.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 class cellPointConnectivity;
66 
67 namespace pointSmoothers
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class geometricElementTransformPointSmoother Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public pointSmoother
77 {
78 private:
79 
80  // Private Data
81 
82  //- Transformation parameter
83  const scalar transformationParameter_;
84 
85 
86  // Private Member Functions
87 
88  static scalar cellQuality
89  (
90  const polyMesh& mesh,
91  const pointField& currentPoints,
92  const cellPointConnectivity& connectivity,
93  const label celli
94  );
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("geometricElementTransform");
101 
102 
103  // Constructors
104 
105  //- Construct from a dictionary and a mesh
107  (
108  const polyMesh& mesh,
109  const dictionary& dict
110  );
111 
112 
113  //- Destructor
114  virtual ~geometricElementTransformPointSmoother() = default;
115 
116 
117  // Member Functions
118 
119  //- Calculate the point displacements
120  virtual void calculate
121  (
122  const labelList& facesToMove,
123  const pointField& oldPoints,
124  const pointField& currentPoints,
125  const pointField& faceCentres,
126  const vectorField& faceAreas,
127  const pointField& cellCentres,
128  const scalarField& cellVolumes,
129  vectorField& pointDisplacement
130  ) const;
131 
133  (
134  const polyMesh& mesh,
135  const pointField& currentPoints
136  );
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace pointSmoothers
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
dictionary dict
Class calculates cell quality measures.
Definition: cellQuality.H:47
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Abstract base class for point smoothing methods. Handles parallel communication via reset and average...
Definition: pointSmoother.H:50
TypeName("geometricElementTransform")
Runtime type information.
geometricElementTransformPointSmoother(const polyMesh &mesh, const dictionary &dict)
Construct from a dictionary and a mesh.
virtual void calculate(const labelList &facesToMove, const pointField &oldPoints, const pointField &currentPoints, const pointField &faceCentres, const vectorField &faceAreas, const pointField &cellCentres, const scalarField &cellVolumes, vectorField &pointDisplacement) const
Calculate the point displacements.
const polyMesh & mesh() const noexcept
Access the mesh.
This class provides ordered connectivity for each point of each cell. Lists are available of the poin...
Geometric Element Transformation Method (GETMe) point smoother. Points are moved in a direction norma...
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:75
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual ~geometricElementTransformPointSmoother()=default
Destructor.
Namespace for OpenFOAM.