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 | 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::timeVaryingMappedFixedValuePointPatchField
28 
29 Description
30  A time-varying form of a mapped fixed value boundary condition.
31 
32 See also
33  Foam::timeVaryingMappedFixedValueFvPatchField
34 
35 SourceFiles
36  timeVaryingMappedFixedValuePointPatchField.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef timeVaryingMappedFixedValuePointPatchField_H
41 #define timeVaryingMappedFixedValuePointPatchField_H
42 
44 #include "instantList.H"
46 #include "Function1.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class timeVaryingMappedFixedValuePointPatchField Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class Type>
59 :
60  public fixedValuePointPatchField<Type>
61 {
62  // Private data
63 
64  //- Name of the field data table, defaults to the name of the field
65  word fieldTableName_;
66 
67  //- If true adjust the mapped field to maintain average value
68  Switch setAverage_;
69 
70  //- Fraction of perturbation (fraction of bounding box) to add
71  scalar perturb_;
72 
73  //- Interpolation scheme to use
74  word mapMethod_;
75 
76  //- 2D interpolation (for 'planarInterpolation' mapMethod)
78 
79  //- List of boundaryData time directories
80  instantList sampleTimes_;
81 
82  //- Current starting index in sampleTimes
83  label startSampleTime_;
84 
85  //- Interpolated values from startSampleTime
86  Field<Type> startSampledValues_;
87 
88  //- If setAverage: starting average value
89  Type startAverage_;
90 
91  //- Current end index in sampleTimes
92  label endSampleTime_;
93 
94  //- Interpolated values from endSampleTime
95  Field<Type> endSampledValues_;
96 
97  //- If setAverage: end average value
98  Type endAverage_;
99 
100  //- Time varying offset values to interpolated data
101  autoPtr<Function1<Type>> offset_;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("timeVaryingMappedFixedValue");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const pointPatch&,
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const pointPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given patch field onto a new patch
129  (
131  const pointPatch&,
133  const pointPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual autoPtr<pointPatchField<Type>> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  );
168  }
169 
170 
171  // Member functions
172 
173  // Utility functions
174 
175  //- Find boundary data inbetween current time and interpolate
176  void checkTable();
177 
178 
179  // Mapping functions
180 
181  //- Map (and resize as needed) from self given a mapping object
182  virtual void autoMap
183  (
184  const pointPatchFieldMapper&
185  );
186 
187  //- Reverse map the given PointPatchField onto
188  // this PointPatchField
189  virtual void rmap
190  (
191  const pointPatchField<Type>&,
192  const labelList&
193  );
194 
195 
196  // Evaluation functions
197 
198  //- Update the coefficients associated with the patch field
199  virtual void updateCoeffs();
200 
201 
202  //- Write
203  virtual void write(Ostream&) const;
204 };
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #ifdef NoRepository
215 #endif
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
instantList.H
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Function1.H
Foam::timeVaryingMappedFixedValuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: timeVaryingMappedFixedValuePointPatchField.C:505
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::timeVaryingMappedFixedValuePointPatchField::TypeName
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition: pointMVCWeight.H:60
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
timeVaryingMappedFixedValuePointPatchField.C
Foam::fixedValuePointPatchField
A FixedValue boundary condition for pointField.
Definition: fixedValuePointPatchField.H:51
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::timeVaryingMappedFixedValuePointPatchField
A time-varying form of a mapped fixed value boundary condition.
Definition: timeVaryingMappedFixedValuePointPatchField.H:57
pointToPointPlanarInterpolation.H
Foam::timeVaryingMappedFixedValuePointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given PointPatchField onto.
Definition: timeVaryingMappedFixedValuePointPatchField.C:223
Foam::timeVaryingMappedFixedValuePointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: timeVaryingMappedFixedValuePointPatchField.C:611
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::timeVaryingMappedFixedValuePointPatchField::timeVaryingMappedFixedValuePointPatchField
timeVaryingMappedFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: timeVaryingMappedFixedValuePointPatchField.C:38
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< instant >
Foam::timeVaryingMappedFixedValuePointPatchField::autoMap
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: timeVaryingMappedFixedValuePointPatchField.C:204
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::timeVaryingMappedFixedValuePointPatchField::checkTable
void checkTable()
Find boundary data inbetween current time and interpolate.
Definition: timeVaryingMappedFixedValuePointPatchField.C:244
Foam::timeVaryingMappedFixedValuePointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: timeVaryingMappedFixedValuePointPatchField.H:142
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54