timeVaryingMappedFixedValuePointPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2022 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  Switch 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  //- Disallow copy without setting internal field reference
136  (
138  ) = delete;
139 
140  //- Copy constructor setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
154  (
156  );
157  }
158 
159 
160  // Member Functions
161 
162  // Utility functions
163 
164  //- Find boundary data in between current time and interpolate
165  void checkTable();
166 
167 
168  // Mapping functions
169 
170  //- Map (and resize as needed) from self given a mapping object
171  // Used to update fields following mesh topology change
172  virtual void autoMap(const pointPatchFieldMapper&);
173 
174  //- Reverse map the given pointPatchField onto this pointPatchField
175  // Used to reconstruct fields
176  virtual void rmap(const pointPatchField<Type>&, const labelList&);
177 
178  //- Reset the pointPatchField to the given pointPatchField
179  // Used for mesh to mesh mapping
180  virtual void reset(const pointPatchField<Type>&);
181 
182 
183  // Evaluation functions
184 
185  //- Update the coefficients associated with the patch field
186  virtual void updateCoeffs();
187 
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #ifdef NoRepository
202 #endif
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
void checkTable()
Find boundary data in between 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:156
A FixedValue boundary condition for pointField.
Foam::pointPatchFieldMapper.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
timeVaryingMappedFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Abstract base class for point-mesh patch fields.
Pre-declare SubField and related Field type.
Definition: Field.H:56
A class for handling words, derived from string.
Definition: word.H:59
tmp< Field< Type > > clone() const
Clone.
Definition: Field.C:240
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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:52
Namespace for OpenFOAM.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void reset(const pointPatchField< Type > &)
Reset the pointPatchField to the given pointPatchField.