Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::displacementPointSmoothingMotionSolver
28
29Description
30 Quality-based under-relaxation for run-time selectable point smoothing.
31
32SourceFiles
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
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class displacementPointSmoothingMotionSolver Declaration
51\*---------------------------------------------------------------------------*/
52
54:
56{
57protected:
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_;
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
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
102public:
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// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
pointVectorField & pointDisplacement() noexcept
Return reference to the point motion displacement field.
displacementMotionSolver(const displacementMotionSolver &)=delete
No copy construct.
autoPtr< pointSmoother > pointSmoother_
Point smoothing method.
displacementPointSmoothingMotionSolver(const polyMesh &, const IOdictionary &)
Construct from a polyMesh and an IOdictionary.
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.
polyMeshGeometry meshGeometry_
Part-updatable mesh geometry.
TypeName("displacementPointSmoothing")
Runtime type information.
scalarList relaxationFactors_
Relaxation factors to use in each iteration.
void markAffectedFaces(const labelHashSet &changedFaces, labelHashSet &affectedFaces)
Mark affected faces.
const label nPointSmootherIter_
Number of point smoother iterations per timestep.
virtual ~displacementPointSmoothingMotionSolver()=default
Destructor.
virtual void setFacesToMove(const dictionary &)
Set all the faces to be moved.
const polyMesh & mesh() const
Return reference to mesh.
pointField & points0() noexcept
Return reference to the reference ('0') pointField.
Updateable mesh geometry and checking routines.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition HashSet.H:85
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
vectorIOField pointIOField
pointIOField is a vectorIOField.
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
List of scalar.
Definition scalarList.H:32
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68