interpolator_pointMeshMover.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) 2018-2026 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::pointMeshMovers::interpolator
26 
27 Description
28  Interpolates pointMesh point pointVectorFields
29 
30 SourceFiles
31  interpolator_pointMeshMovers.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef interpolator_pointMeshMovers_H
36 #define interpolator_pointMeshMovers_H
37 
38 #include "primitiveFields.H"
39 #include "pointFieldsFwd.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class polyMesh;
47 class interpolationWeights;
48 
49 namespace pointMeshMovers
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class interpolator Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class interpolator
57 {
58  // Private Data
59 
60  //- Reference to mesh
61  const polyMesh& mesh_;
62 
63  //- Name of displacement field
64  const word fieldName_;
65 
66  const word interpolationScheme_;
67 
68  //- Times with pre-specified displacement
69  wordList timeNames_;
70 
71  //- Times with pre-specified displacement
72  scalarField timeVals_;
73 
74  //- User-specified interpolator
75  mutable autoPtr<interpolationWeights> interpolatorPtr_;
76 
77  //- Cached interpolation times
78  mutable labelList currentIndices_;
79 
80  //- Cached interpolation weights
81  mutable scalarField currentWeights_;
82 
83 
84 public:
85 
86  // Constructors
87 
88  //- Construct from mesh and dictionary
90  (
91  const polyMesh& mesh,
92  const dictionary& dict
93  );
94 
95 
96  //- Destructor
97  ~interpolator();
98 
99 
100  // Member Functions
101 
102  //- Return interpolated pointField for the currentTime
104 
105  //- Write
106  void write(Ostream&) const;
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace pointMeshMovers
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
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
Interpolates pointMesh point pointVectorFields.
interpolator(const polyMesh &mesh, const dictionary &dict)
Construct from mesh and dictionary.
tmp< pointVectorField > curPointField() const
Return interpolated pointField for the currentTime.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
Specialisations of Field<T> for scalar, vector and tensor.
dictionary dict