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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::uniformInterpolatedDisplacementPointPatchVectorField
28 
29 Description
30  Interpolates pre-specified motion.
31 
32  Motion specified as pointVectorFields.
33 
34 Usage
35  Example:
36  \verbatim
37  walls
38  {
39  type uniformInterpolatedDisplacement;
40  value uniform (0 0 0);
41  field wantedDisplacement;
42  interpolationScheme linear;
43  }
44  \endverbatim
45 
46  This will scan the case for \a wantedDisplacement pointVectorFields
47  and interpolate those in time (using \c linear interpolation) to
48  obtain the current displacement.
49  The advantage of specifying displacement in this way is that it
50  automatically works through decomposePar.
51 
52 SourceFiles
53  uniformInterpolatedDisplacementPointPatchVectorField.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef uniformInterpolatedDisplacementPointPatchVectorField_H
58 #define uniformInterpolatedDisplacementPointPatchVectorField_H
59 
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 class interpolationWeights;
68 
69 /*---------------------------------------------------------------------------*\
70  Class uniformInterpolatedDisplacementPointPatchVectorField Declaration
71 \*---------------------------------------------------------------------------*/
72 
74 :
75  public fixedValuePointPatchField<vector>
76 {
77  // Private data
78 
79  //- Name of displacement field
80  const word fieldName_;
81 
82  const word interpolationScheme_;
83 
84  //- Times with pre-specified displacement
85  wordList timeNames_;
86 
87  //- Times with pre-specified displacement
88  scalarField timeVals_;
89 
90  //- User-specified interpolator
91  autoPtr<interpolationWeights> interpolatorPtr_;
92 
93 
94  //- Cached interpolation times
95  labelList currentIndices_;
96 
97  //- Cached interpolation weights
98  scalarField currentWeights_;
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("uniformInterpolatedDisplacement");
104 
105 
106  // Constructors
107 
108  //- Construct from patch and internal field
110  (
111  const pointPatch&,
113  );
114 
115  //- Construct from patch, internal field and dictionary
117  (
118  const pointPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given patchField<vector> onto a new patch
125  (
127  const pointPatch&,
129  const pointPatchFieldMapper&
130  );
131 
132  //- Construct and return a clone
133  virtual autoPtr<pointPatchField<vector>> clone() const
134  {
136  (
138  (
139  *this
140  )
141  );
142  }
143 
144  //- Construct as copy setting internal field reference
146  (
149  );
150 
151  //- Construct and return a clone setting internal field reference
153  (
155  ) const
156  {
158  (
160  (
161  *this,
162  iF
163  )
164  );
165  }
166 
167 
168  // Member functions
169 
170  // Evaluation functions
171 
172  //- Update the coefficients associated with the patch field
173  virtual void updateCoeffs();
174 
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::fixedValuePointPatchField
A FixedValue boundary condition for pointField.
Definition: fixedValuePointPatchField.H:51
Foam::Field< scalar >
Foam::uniformInterpolatedDisplacementPointPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: uniformInterpolatedDisplacementPointPatchVectorField.C:258
Foam::uniformInterpolatedDisplacementPointPatchVectorField::clone
virtual autoPtr< pointPatchField< vector > > clone() const
Construct and return a clone.
Definition: uniformInterpolatedDisplacementPointPatchVectorField.H:132
fixedValuePointPatchField.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::uniformInterpolatedDisplacementPointPatchVectorField::uniformInterpolatedDisplacementPointPatchVectorField
uniformInterpolatedDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
Definition: uniformInterpolatedDisplacementPointPatchVectorField.C:47
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::uniformInterpolatedDisplacementPointPatchVectorField
Interpolates pre-specified motion.
Definition: uniformInterpolatedDisplacementPointPatchVectorField.H:72
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< word >
Foam::uniformInterpolatedDisplacementPointPatchVectorField::TypeName
TypeName("uniformInterpolatedDisplacement")
Runtime type information.
Foam::uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformInterpolatedDisplacementPointPatchVectorField.C:151
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54