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.cxx
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef Foam_uniformInterpolatedDisplacementPointPatchVectorField_H
58 #define Foam_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 {
79 
80  // Private Data
81 
82  //- Name of displacement field
83  const word fieldName_;
84 
85  const word interpolationScheme_;
86 
87  //- Times with pre-specified displacement
88  wordList timeNames_;
89 
90  //- Times with pre-specified displacement
91  scalarField timeVals_;
92 
93  //- User-specified interpolator
94  autoPtr<interpolationWeights> interpolatorPtr_;
95 
96 
97  //- Cached interpolation times
98  labelList currentIndices_;
99 
100  //- Cached interpolation weights
101  scalarField currentWeights_;
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("uniformInterpolatedDisplacement");
107 
108 
109  // Constructors
110 
111  //- Construct from patch and internal field
113  (
114  const pointPatch&,
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const pointPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping onto a new patch
128  (
129  const this_bctype&,
130  const pointPatch&,
132  const pointPatchFieldMapper&
133  );
134 
135  //- Construct as copy setting internal field reference
137  (
138  const this_bctype&,
140  );
141 
142  //- No copy without an internal field
144  (
145  const this_bctype&
146  ) = delete;
147 
148  //- Clone with an internal field reference
150  (
152  ) const
153  {
154  return pointPatchField<vector>::Clone(*this, iF);
155  }
156 
157 
158  // Member Functions
159 
160  // Evaluation functions
161 
162  //- Update the coefficients associated with the patch field
163  virtual void updateCoeffs();
164 
165 
166  //- Write
167  virtual void write(Ostream&) const;
168 
169 
170  // Member Operators
172  //- Inherit assignment
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
TypeName("uniformInterpolatedDisplacement")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
A FixedValue boundary condition for pointField.
Foam::pointPatchFieldMapper.
virtual autoPtr< pointPatchField< vector > > clone() const
No clone without an internal field reference.
friend Ostream & operator(Ostream &, const pointPatchField< vector > &)
A class for handling words, derived from Foam::string.
Definition: word.H:63
uniformInterpolatedDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Namespace for OpenFOAM.