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 | Copyright (C) 2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify i
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::displacementMotionSolverMeshMover
26 
27 Description
28  Quality-based under-relaxation wrapped around generic
29  displacementMotionSolver.
30 
31  Example of use in layer settings in snappyHexMeshDict:
32  \verbatim
33  meshShrinker displacementMotionSolver;
34  solver displacementLaplacian;
35  displacementLaplacianCoeffs
36  {
37  diffusivity quadratic inverseDistance 1(wall);
38  }
39  \endverbatim
40 
41 SourceFiles
42  displacementMotionSolverMeshMover.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef displacementMotionSolverMeshMover_H
47 #define displacementMotionSolverMeshMover_H
48 
51 #include "motionSmootherAlgo.H"
52 #include "fieldSmoother.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class displacementMotionSolverMeshMover Declaration
61 \*---------------------------------------------------------------------------*/
62 
64 :
66 {
67  // Private Data
68 
69  //- Mesh motion solver
71 
72  //- IDs of fixedValue patches that we can modify
74 
75  //- Combined indirect fixedValue patches that we can modify
77 
78  //- Scale factor for displacemen
80 
81  //- Old point field
83 
84  //- Mesh mover algorithm
86 
87  //- Field smoothing
89 
90 
91  // Private Member Functions
92 
93  //- Apply the mesh mover algorithm
94  bool moveMesh
95  (
96  const dictionary& moveDict,
97  const label nAllowableErrors,
98  labelList& checkFaces
99  );
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("displacementMotionSolver");
106 
107 
108  // Constructors
109 
110  //- Construct from a polyMesh and an IOdictionary
112  (
113  const dictionary& dict,
114  const List<labelPair>& baffles,
115  pointVectorField& pointDisplacemen
116  );
117 
118 
119  //- Destructor
121 
122 
123  // Member Functions
124 
125  //- Move mesh using current pointDisplacement boundary values.
126  // Return true if succesful (errors on checkFaces less than
127  // allowable). Updates pointDisplacement.
128  virtual bool move
129  (
130  const dictionary&,
131  const label nAllowableErrors,
132  labelList& checkFaces
133  );
134 
135  //- Update local data for geometry changes
136  virtual void movePoints(const pointField&);
137 
138  //- Update local data for topology changes
139  virtual void updateMesh(const mapPolyMesh&)
140  {
142  }
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::displacementMotionSolverMeshMover::~displacementMotionSolverMeshMover
virtual ~displacementMotionSolverMeshMover()
Destructor.
Definition: displacementMotionSolverMeshMover.C:190
Foam::displacementMotionSolverMeshMover
Quality-based under-relaxation wrapped around generic displacementMotionSolver.
Definition: displacementMotionSolverMeshMover.H:62
Foam::displacementMotionSolverMeshMover::displacementMotionSolverMeshMover
displacementMotionSolverMeshMover(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacemen)
Construct from a polyMesh and an IOdictionary.
Definition: displacementMotionSolverMeshMover.C:109
Foam::fieldSmoother
Utility functions for mesh motion solvers.
Definition: fieldSmoother.H:48
Foam::displacementMotionSolverMeshMover::movePoints
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Definition: displacementMotionSolverMeshMover.C:298
Foam::displacementMotionSolverMeshMover::adaptPatchPtr_
autoPtr< indirectPrimitivePatch > adaptPatchPtr_
Combined indirect fixedValue patches that we can modify.
Definition: displacementMotionSolverMeshMover.H:75
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
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:97
Foam::displacementMotionSolverMeshMover::meshMover_
motionSmootherAlgo meshMover_
Mesh mover algorithm.
Definition: displacementMotionSolverMeshMover.H:84
Foam::displacementMotionSolverMeshMover::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Definition: displacementMotionSolverMeshMover.H:138
Foam::displacementMotionSolverMeshMover::move
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)
Move mesh using current pointDisplacement boundary values.
Definition: displacementMotionSolverMeshMover.C:197
Foam::externalDisplacementMeshMover
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
Definition: externalDisplacementMeshMover.H:56
Foam::displacementMotionSolverMeshMover::adaptPatchIDs_
const labelList adaptPatchIDs_
IDs of fixedValue patches that we can modify.
Definition: displacementMotionSolverMeshMover.H:72
dict
dictionary dict
Definition: searchingEngine.H:14
fieldSmoother.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::displacementMotionSolverMeshMover::solverPtr_
autoPtr< displacementMotionSolver > solverPtr_
Mesh motion solver.
Definition: displacementMotionSolverMeshMover.H:69
displacementMotionSolver.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::displacementMotionSolverMeshMover::scale_
pointScalarField scale_
Scale factor for displacemen.
Definition: displacementMotionSolverMeshMover.H:78
Foam::displacementMotionSolverMeshMover::fieldSmoother_
fieldSmoother fieldSmoother_
Field smoothing.
Definition: displacementMotionSolverMeshMover.H:87
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::displacementMotionSolverMeshMover::oldPoints_
pointField oldPoints_
Old point field.
Definition: displacementMotionSolverMeshMover.H:81
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:158
Foam::displacementMotionSolverMeshMover::moveMesh
bool moveMesh(const dictionary &moveDict, const label nAllowableErrors, labelList &checkFaces)
Apply the mesh mover algorithm.
Definition: displacementMotionSolverMeshMover.C:48
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52