fvMeshMoversInterpolator.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
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::fvMeshMovers::interpolator
26 
27 Description
28  Interpolates pre-specified motion specified as a set of pointVectorFields.
29 
30  The motion can be provided either as a set of displacement or position
31  fields and the entry \c displacement specified accordingly.
32 
33 Usage
34  Example:
35  \verbatim
36  mover interpolator;
37 
38  displacementLaplacianCoeffs
39  {
40  field wantedDisplacement;
41  displacement yes;
42  interpolationScheme linear;
43  }
44  \endverbatim
45 
46  This will scan the case for \c wantedDisplacement \c pointVectorFields in
47  the time directories and interpolate those in time (using \c linear
48  interpolation) to obtain the current displacement. The advantage of
49  specifying displacement in this way is that it automatically works in
50  parallel using \c decomposePar to decompose the set of \c pointVectorFields
51  provided.
52 
53 SourceFiles
54  interpolator.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef fvMeshMoversInterpolator_H
59 #define fvMeshMoversInterpolator_H
60 
61 #include "fvMeshMover.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace fvMeshMovers
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class interpolator Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class interpolator
76 :
77  public fvMeshMover
78 {
79  // Private Data
80 
81  dictionary meshCoeffs_;
82 
83  dynamicMeshPointInterpolator pointInterpolator_;
84 
85  const Switch displacement_;
86 
87  //- Starting points
89 
90  //- Optional list of vectorFields to update for mesh motion
91  // For modern solvers using Uf and correctPhi to update the flux
92  // after motion it is not necessary to specify a "velocityFields" list
93  velocityMotionCorrection velocityMotionCorrection_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("interpolator");
100 
101 
102  // Constructors
103 
104  //- Construct from fvMesh
106 
107  //- Disallow default bitwise copy construction
108  interpolator(const interpolator&) = delete;
109 
110 
111  //- Destructor
112  ~interpolator();
113 
114 
115  // Member Functions
116 
117  //- Update the mesh for both mesh motion and topology change
118  virtual bool update();
119 
120  //- Update corresponding to the given map
121  virtual void topoChange(const polyTopoChangeMap&);
122 
123  //- Update from another mesh using the given map
124  virtual void mapMesh(const polyMeshMap&);
125 
126  //- Update corresponding to the given distribution map
127  virtual void distribute(const polyDistributionMap&);
128 
129 
130  // Member Operators
131 
132  //- Disallow default bitwise assignment
133  void operator=(const interpolator&) = delete;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace fvMeshMovers
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Helper class to update the velocity boundary conditions.
Definition: fvMeshMover.H:84
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:53
fvMesh & mesh()
Return the fvMesh.
Definition: fvMeshMover.H:132
Interpolates pre-specified motion specified as a set of pointVectorFields.
virtual void topoChange(const polyTopoChangeMap &)
Update corresponding to the given map.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
interpolator(fvMesh &mesh)
Construct from fvMesh.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("interpolator")
Runtime type information.
virtual bool update()
Update the mesh for both mesh motion and topology change.
void operator=(const interpolator &)=delete
Disallow default bitwise assignment.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.