timeVaryingMappedFixedValueFvPatchField.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) 2011-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::timeVaryingMappedFixedValueFvPatchField
28 
29 Group
30  grpInletBoundaryConditions grpCoupledBoundaryConditions
31 
32 Description
33  This boundary conditions interpolates the values from a set of supplied
34  points in space and time.
35 
36  Supplied data should be specified in constant/boundaryData/<patchname>/
37  - points : pointField of locations
38  - <time>/<field> : field of values at time <time>
39 
40  The default mode of operation (mapMethod = planar) is to project
41  the points onto a plane (constructed from the first three points) and
42  construct a 2D triangulation and finds for the face centres the triangle it
43  is in and the weights to the 3 vertices.
44 
45  The optional mapMethod nearest will avoid all projection and triangulation
46  and just use the value at the nearest vertex.
47 
48  Values are interpolated linearly between times.
49 
50 Usage
51  \table
52  Property | Description | Required | Default
53  setAverage | Use average value | no | false
54  perturb | Perturb points for regular geometries | no | 1e-5
55  points | Name of points file | no | points
56  fieldTable | Alternative field name to sample | no | this field name
57  mapMethod | Type of mapping | no | planar
58  offset | Offset to mapped values | no | Zero
59  \endtable
60 
61  \verbatim
62  <patchName>
63  {
64  type timeVaryingMappedFixedValue;
65  }
66  \endverbatim
67 
68 See also
69  Foam::fixedValueFvPatchField
70  Foam::Function1Types
71 
72 SourceFiles
73  timeVaryingMappedFixedValueFvPatchField.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef Foam_timeVaryingMappedFixedValueFvPatchField_H
78 #define Foam_timeVaryingMappedFixedValueFvPatchField_H
79 
81 #include "MappedFile.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class timeVaryingMappedFixedValueFvPatchField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 template<class Type>
93 class timeVaryingMappedFixedValueFvPatchField
94 :
95  public fixedValueFvPatchField<Type>
96 {
97  // Private Data
98 
99  autoPtr<PatchFunction1Types::MappedFile<Type>> uniformValue_;
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 fvPatch&,
114  const DimensionedField<Type, volMesh>&
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
121  const DimensionedField<Type, volMesh>&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given timeVaryingMappedFixedValueFvPatchField
126  // onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Construct as copy
137  (
139  );
140 
141  //- Construct as copy setting internal field reference
143  (
146  );
147 
148  //- Return a clone
149  virtual tmp<fvPatchField<Type>> clone() const
150  {
151  return fvPatchField<Type>::Clone(*this);
152  }
153 
154  //- Clone with an internal field reference
156  (
158  ) const
159  {
160  return fvPatchField<Type>::Clone(*this, iF);
161  }
162 
163 
164  // Member functions
165 
166  // Mapping functions
167 
168  //- Map (and resize as needed) from self given a mapping object
169  virtual void autoMap
170  (
171  const fvPatchFieldMapper&
172  );
173 
174  //- Reverse map the given fvPatchField onto this fvPatchField
175  virtual void rmap
176  (
177  const fvPatchField<Type>&,
178  const labelList&
179  );
180 
181 
182  // Evaluation functions
183 
184  //- Update the coefficients associated with the patch field
185  virtual void updateCoeffs();
186 
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #ifdef NoRepository
201 #endif
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
This boundary conditions interpolates the values from a set of supplied points in space and time...
A FieldMapper for finite-volume patch fields.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
timeVaryingMappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.