interpolator_fvMeshMover.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-2024 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  interpolatorCoeffs
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 interpolator_fvMeshMover_H
59 #define interpolator_fvMeshMover_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  dynamicMeshPointInterpolator pointInterpolator_;
82 
83  const Switch displacement_;
84 
85  //- Starting points
87 
88  //- Optional list of vectorFields to update for mesh motion
89  // For modern solvers using Uf and correctPhi to update the flux
90  // after motion it is not necessary to specify a "velocityFields" list
91  velocityMotionCorrection velocityMotionCorrection_;
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("interpolator");
98 
99 
100  // Constructors
101 
102  //- Construct from fvMesh and dictionary
104 
105  //- Disallow default bitwise copy construction
106  interpolator(const interpolator&) = delete;
107 
108 
109  //- Destructor
110  ~interpolator();
111 
112 
113  // Member Functions
114 
115  //- Update the mesh for both mesh motion and topology change
116  virtual bool update();
117 
118  //- Update corresponding to the given map
119  virtual void topoChange(const polyTopoChangeMap&);
120 
121  //- Update from another mesh using the given map
122  virtual void mapMesh(const polyMeshMap&);
123 
124  //- Update corresponding to the given distribution map
125  virtual void distribute(const polyDistributionMap&);
126 
127 
128  // Member Operators
129 
130  //- Disallow default bitwise assignment
131  void operator=(const interpolator&) = delete;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace fvMeshMovers
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Helper class to update the velocity boundary conditions.
Definition: fvMeshMover.H:81
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:53
fvMesh & mesh()
Return the fvMesh.
Definition: fvMeshMover.H:129
Interpolates pre-specified motion specified as a set of pointVectorFields.
interpolator(fvMesh &mesh, const dictionary &dict)
Construct from fvMesh and dictionary.
virtual void topoChange(const polyTopoChangeMap &)
Update corresponding to the given map.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
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:96
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.
dictionary dict