timeVaryingMappedFixedValuePointPatchField.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::timeVaryingMappedFixedValuePointPatchField
26 
27 Description
28  A time-varying form of a mapped fixed value boundary condition.
29 
30 See also
31  Foam::timeVaryingMappedFixedValueFvPatchField
32 
33 SourceFiles
34  timeVaryingMappedFixedValuePointPatchField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef timeVaryingMappedFixedValuePointPatchField_H
39 #define timeVaryingMappedFixedValuePointPatchField_H
40 
42 #include "instantList.H"
44 #include "Function1.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class timeVaryingMappedFixedValuePointPatchField Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Type>
57 :
58  public fixedValuePointPatchField<Type>
59 {
60  // Private data
61 
62  //- Name of the field data table, defaults to the name of the field
63  word fieldTableName_;
64 
65  //- If true adjust the mapped field to maintain average value
66  bool setAverage_;
67 
68  //- Fraction of perturbation (fraction of bounding box) to add
69  scalar perturb_;
70 
71  //- Interpolation scheme to use
72  word mapMethod_;
73 
74  //- 2D interpolation (for 'planarInterpolation' mapMethod)
76 
77  //- List of boundaryData time directories
78  instantList sampleTimes_;
79 
80  //- Current starting index in sampleTimes
81  label startSampleTime_;
82 
83  //- Interpolated values from startSampleTime
84  Field<Type> startSampledValues_;
85 
86  //- If setAverage: starting average value
87  Type startAverage_;
88 
89  //- Current end index in sampleTimes
90  label endSampleTime_;
91 
92  //- Interpolated values from endSampleTime
93  Field<Type> endSampledValues_;
94 
95  //- If setAverage: end average value
96  Type endAverage_;
97 
98  //- Time varying offset values to interpolated data
99  autoPtr<Function1<Type>> offset_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("timeVaryingMappedFixedValue");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const pointPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const pointPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given patch field onto a new patch
127  (
129  const pointPatch&,
131  const pointPatchFieldMapper&
132  );
133 
134  //- Construct as copy
136  (
138  );
139 
140  //- Construct and return a clone
141  virtual autoPtr<pointPatchField<Type>> clone() const
142  {
144  (
146  );
147  }
148 
149  //- Construct as copy setting internal field reference
151  (
154  );
155 
156  //- Construct and return a clone setting internal field reference
158  (
160  ) const
161  {
163  (
165  );
166  }
167 
168 
169  // Member functions
170 
171  // Utility functions
172 
173  //- Find boundary data inbetween current time and interpolate
174  void checkTable();
175 
176 
177  // Mapping functions
178 
179  //- Map (and resize as needed) from self given a mapping object
180  virtual void autoMap
181  (
182  const pointPatchFieldMapper&
183  );
184 
185  //- Reverse map the given PointPatchField onto
186  // this PointPatchField
187  virtual void rmap
188  (
189  const pointPatchField<Type>&,
190  const labelList&
191  );
192 
193 
194  // Evaluation functions
195 
196  //- Update the coefficients associated with the patch field
197  virtual void updateCoeffs();
198 
199 
200  //- Write
201  virtual void write(Ostream&) const;
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #ifdef NoRepository
213 #endif
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given PointPatchField onto.
void checkTable()
Find boundary data inbetween current time and interpolate.
A time-varying form of a mapped fixed value boundary condition.
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.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
timeVaryingMappedFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Abstract base class for point-mesh patch fields.
Pre-declare SubField and related Field type.
Definition: Field.H:57
A class for handling words, derived from string.
Definition: word.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
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...
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.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.