displacementMotionSolverMeshMover.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) 2015 OpenFOAM Foundation
9 Copyright (C) 2015 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify i
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::displacementMotionSolverMeshMover
29
30Description
31 Quality-based under-relaxation wrapped around generic
32 displacementMotionSolver.
33
34 Example of use in layer settings in snappyHexMeshDict:
35 \verbatim
36 meshShrinker displacementMotionSolver;
37 solver displacementLaplacian;
38 displacementLaplacianCoeffs
39 {
40 diffusivity quadratic inverseDistance 1(wall);
41 }
42 \endverbatim
43
44SourceFiles
45 displacementMotionSolverMeshMover.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef displacementMotionSolverMeshMover_H
50#define displacementMotionSolverMeshMover_H
51
54#include "motionSmootherAlgo.H"
55#include "fieldSmoother.H"
56
57// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58
59namespace Foam
60{
61
62/*---------------------------------------------------------------------------*\
63 Class displacementMotionSolverMeshMover Declaration
64\*---------------------------------------------------------------------------*/
67:
69{
70 // Private Data
71
72 //- Mesh motion solver
74
75 //- IDs of fixedValue patches that we can modify
76 const labelList adaptPatchIDs_;
77
78 //- Combined indirect fixedValue patches that we can modify
80
81 //- Scale factor for displacement
82 pointScalarField scale_;
83
84 //- Old point field
85 pointField oldPoints_;
86
87 //- Mesh mover algorithm
88 motionSmootherAlgo meshMover_;
89
90 //- Field smoothing
91 fieldSmoother fieldSmoother_;
92
93
94 // Private Member Functions
95
96 //- Apply the mesh mover algorithm
97 bool moveMesh
98 (
99 const dictionary& moveDict,
100 const label nAllowableErrors,
101 labelList& checkFaces
102 );
103
104
105public:
106
107 //- Runtime type information
108 TypeName("displacementMotionSolver");
109
110
111 // Constructors
112
113 //- Construct from a polyMesh and an IOdictionary
115 (
116 const dictionary& dict,
117 const List<labelPair>& baffles,
119 const bool dryRun
120 );
121
122
123 //- Destructor
125
126
127 // Member Functions
128
129 //- Move mesh using current pointDisplacement boundary values.
130 // Return true if successful (errors on checkFaces less than
131 // allowable). Updates pointDisplacement.
132 virtual bool move
133 (
134 const dictionary&,
135 const label nAllowableErrors,
136 labelList& checkFaces
137 );
138
139 //- Update local data for geometry changes
140 virtual void movePoints(const pointField&);
141
142 //- Update local data for topology changes
143 virtual void updateMesh(const mapPolyMesh&)
144 {
146 }
147};
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156#endif
157
158// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Quality-based under-relaxation wrapped around generic displacementMotionSolver.
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)
Move mesh using current pointDisplacement boundary values.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
TypeName("displacementMotionSolver")
Runtime type information.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
Utility functions for mesh motion solvers.
Definition: fieldSmoother.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73