displacementPointSmoothingMotionSolver.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::displacementPointSmoothingMotionSolver
28 
29 Description
30  Quality-based under-relaxation for run-time selectable point smoothing.
31 
32 SourceFiles
33  displacementPointSmoothingMotionSolver.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef displacementPointSmoothingMotionSolver_H
38 #define displacementPointSmoothingMotionSolver_H
39 
41 #include "pointSmoother.H"
42 #include "polyMeshGeometry.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class displacementPointSmoothingMotionSolver Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
56 {
57 protected:
58 
59  // Protected Data
60 
61  //- Part-updatable mesh geometry
63 
64  //- Point smoothing method
66 
67  //- Number of point smoother iterations per timestep
68  const label nPointSmootherIter_;
69 
70 
71  // Mesh quality based relaxation of smoothed position
72 
73  //- Relaxation factors to use in each iteration
75 
76  //- Relaxed point field
78 
79  //- Set of the faces which are to be moved
81 
82  //- Mesh quality dictionary
84 
85 
86  // Private Member Functions
87 
88  //- Mark affected faces
90  (
91  const labelHashSet& changedFaces,
92  labelHashSet& affectedFaces
93  );
94 
95  //- Relax the points
96  bool relax();
97 
98  //- Set all the faces to be moved
99  void virtual setFacesToMove(const dictionary&);
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("displacementPointSmoothing");
106 
107 
108  // Constructors
109 
110  //- Construct from a polyMesh and an IOdictionary
112  (
113  const polyMesh&,
114  const IOdictionary&
115  );
116 
117  //- Construct from components
119  (
120  const polyMesh& mesh,
121  const IOdictionary& dict,
123  const pointIOField& points0
124  );
125 
126 
127  //- Destructor
128  virtual ~displacementPointSmoothingMotionSolver() = default;
129 
130 
131  // Member Functions
132 
133  //- Return point location obtained from the current motion field
134  virtual tmp<pointField> curPoints() const;
135 
136  //- Solve for motion
137  virtual void solve();
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
dictionary dict
Virtual base class for displacement motion solver.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
pointVectorField & pointDisplacement() noexcept
Return reference to the point motion displacement field.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
labelHashSet facesToMove_
Set of the faces which are to be moved.
TypeName("displacementPointSmoothing")
Runtime type information.
displacementPointSmoothingMotionSolver(const polyMesh &, const IOdictionary &)
Construct from a polyMesh and an IOdictionary.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
scalarList relaxationFactors_
Relaxation factors to use in each iteration.
Updateable mesh geometry and checking routines.
virtual ~displacementPointSmoothingMotionSolver()=default
Destructor.
void markAffectedFaces(const labelHashSet &changedFaces, labelHashSet &affectedFaces)
Mark affected faces.
virtual void setFacesToMove(const dictionary &)
Set all the faces to be moved.
autoPtr< pointSmoother > pointSmoother_
Point smoothing method.
pointField & points0() noexcept
Return reference to the reference (&#39;0&#39;) pointField.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:75
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:165
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const label nPointSmootherIter_
Number of point smoother iterations per timestep.
Quality-based under-relaxation for run-time selectable point smoothing.
A primitive field of type <T> with automated input and output.
polyMeshGeometry meshGeometry_
Part-updatable mesh geometry.
Namespace for OpenFOAM.