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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::displacementMotionSolverMeshMover
29 
30 Description
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 
44 SourceFiles
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 
59 namespace Foam
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class displacementMotionSolverMeshMover Declaration
64 \*---------------------------------------------------------------------------*/
65 
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
79  autoPtr<indirectPrimitivePatch> adaptPatchPtr_;
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 
105 public:
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 // ************************************************************************* //
Foam::displacementMotionSolverMeshMover::displacementMotionSolverMeshMover
displacementMotionSolverMeshMover(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement, const bool dryRun)
Construct from a polyMesh and an IOdictionary.
Definition: displacementMotionSolverMeshMover.C:112
Foam::displacementMotionSolverMeshMover::~displacementMotionSolverMeshMover
virtual ~displacementMotionSolverMeshMover()
Destructor.
Definition: displacementMotionSolverMeshMover.C:195
Foam::displacementMotionSolverMeshMover
Quality-based under-relaxation wrapped around generic displacementMotionSolver.
Definition: displacementMotionSolverMeshMover.H:65
Foam::fieldSmoother
Utility functions for mesh motion solvers.
Definition: fieldSmoother.H:50
Foam::displacementMotionSolverMeshMover::movePoints
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Definition: displacementMotionSolverMeshMover.C:306
Foam::externalDisplacementMeshMover::pointDisplacement
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
Definition: externalDisplacementMeshMover.H:159
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::Field< vector >
externalDisplacementMeshMover.H
Foam::motionSmootherAlgo
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
Definition: motionSmootherAlgo.H:100
Foam::displacementMotionSolverMeshMover::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Definition: displacementMotionSolverMeshMover.H:142
Foam::displacementMotionSolverMeshMover::move
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)
Move mesh using current pointDisplacement boundary values.
Definition: displacementMotionSolverMeshMover.C:202
Foam::externalDisplacementMeshMover
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
Definition: externalDisplacementMeshMover.H:58
dict
dictionary dict
Definition: searchingEngine.H:14
fieldSmoother.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
displacementMotionSolver.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< label >
motionSmootherAlgo.H
Foam::displacementMotionSolverMeshMover::TypeName
TypeName("displacementMotionSolver")
Runtime type information.
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::GeometricField< scalar, pointPatchField, pointMesh >