uniformInterpolatedDisplacementPointPatchVectorField.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) 2012-2016 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::uniformInterpolatedDisplacementPointPatchVectorField
26 
27 Description
28  Interpolates pre-specified motion.
29 
30  Motion specified as pointVectorFields.
31 
32 Usage
33  Example:
34  \verbatim
35  walls
36  {
37  type uniformInterpolatedDisplacement;
38  value uniform (0 0 0);
39  field wantedDisplacement;
40  interpolationScheme linear;
41  }
42  \endverbatim
43 
44  This will scan the case for \a wantedDisplacement pointVectorFields
45  and interpolate those in time (using \c linear interpolation) to
46  obtain the current displacement.
47  The advantage of specifying displacement in this way is that it
48  automatically works through decomposePar.
49 
50 SourceFiles
51  uniformInterpolatedDisplacementPointPatchVectorField.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef uniformInterpolatedDisplacementPointPatchVectorField_H
56 #define uniformInterpolatedDisplacementPointPatchVectorField_H
57 
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 class interpolationWeights;
66 
67 /*---------------------------------------------------------------------------*\
68  Class uniformInterpolatedDisplacementPointPatchVectorField Declaration
69 \*---------------------------------------------------------------------------*/
70 
72 :
73  public fixedValuePointPatchField<vector>
74 {
75  // Private data
76 
77  //- Name of displacement field
78  const word fieldName_;
79 
80  const word interpolationScheme_;
81 
82  //- Times with pre-specified displacement
83  wordList timeNames_;
84 
85  //- Times with pre-specified displacement
86  scalarField timeVals_;
87 
88  //- User-specified interpolator
89  autoPtr<interpolationWeights> interpolatorPtr_;
90 
91 
92  //- Cached interpolation times
93  labelList currentIndices_;
94 
95  //- Cached interpolation weights
96  scalarField currentWeights_;
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("uniformInterpolatedDisplacement");
102 
103 
104  // Constructors
105 
106  //- Construct from patch and internal field
108  (
109  const pointPatch&,
111  );
112 
113  //- Construct from patch, internal field and dictionary
115  (
116  const pointPatch&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given patchField<vector> onto a new patch
123  (
125  const pointPatch&,
127  const pointPatchFieldMapper&
128  );
129 
130  //- Construct and return a clone
131  virtual autoPtr<pointPatchField<vector>> clone() const
132  {
134  (
136  (
137  *this
138  )
139  );
140  }
141 
142  //- Construct as copy setting internal field reference
144  (
147  );
148 
149  //- Construct and return a clone setting internal field reference
151  (
153  ) const
154  {
156  (
158  (
159  *this,
160  iF
161  )
162  );
163  }
164 
165 
166  // Member functions
167 
168  // Evaluation functions
169 
170  //- Update the coefficients associated with the patch field
171  virtual void updateCoeffs();
172 
173 
174  //- Write
175  virtual void write(Ostream&) const;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
TypeName("uniformInterpolatedDisplacement")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A FixedValue boundary condition for pointField.
Foam::pointPatchFieldMapper.
A class for handling words, derived from string.
Definition: word.H:59
uniformInterpolatedDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual autoPtr< pointPatchField< vector > > clone() const
Construct and return a clone.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Namespace for OpenFOAM.