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-2023 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, internal field and dictionary
112  (
113  const pointPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given
119  // timeVaryingMappedFixedValuePointPatchField
120  // onto a new patch
122  (
124  const pointPatch&,
126  const pointPatchFieldMapper&
127  );
128 
129  //- Disallow copy without setting internal field reference
131  (
133  ) = delete;
134 
135  //- Copy constructor setting internal field reference
137  (
140  );
141 
142  //- Construct and return a clone setting internal field reference
144  (
146  ) const
147  {
149  (
151  );
152  }
153 
154 
155  // Member Functions
156 
157  // Utility functions
158 
159  //- Find boundary data in between current time and interpolate
160  void checkTable();
161 
162 
163  // Mapping functions
164 
165  //- Map the given pointPatchField onto this pointPatchField
166  virtual void map
167  (
168  const pointPatchField<Type>&,
169  const pointPatchFieldMapper&
170  );
171 
172  //- Reset the pointPatchField to the given pointPatchField
173  // Used for mesh to mesh mapping
174  virtual void reset(const pointPatchField<Type>&);
175 
176 
177  // Evaluation functions
178 
179  //- Update the coefficients associated with the patch field
180  virtual void updateCoeffs();
181 
182 
183  //- Write
184  virtual void write(Ostream&) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #ifdef NoRepository
196 #endif
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:82
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:57
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A FixedValue boundary condition for pointField.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:57
A time-varying form of a mapped fixed value boundary condition.
timeVaryingMappedFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void checkTable()
Find boundary data in between current time and interpolate.
virtual void reset(const pointPatchField< Type > &)
Reset the pointPatchField to the given pointPatchField.
virtual void map(const pointPatchField< Type > &, const pointPatchFieldMapper &)
Map the given pointPatchField onto this pointPatchField.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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