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 planarInterpolation) 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 | planarInterpolation
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 timeVaryingMappedFixedValueFvPatchField_H
78 #define 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 and return a clone
142  virtual tmp<fvPatchField<Type>> clone() const
143  {
144  return tmp<fvPatchField<Type>>
145  (
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
163  return tmp<fvPatchField<Type>>
164  (
166  );
167  }
168 
169 
170  // Member functions
171 
172  // Mapping functions
173 
174  //- Map (and resize as needed) from self given a mapping object
175  virtual void autoMap
176  (
177  const fvPatchFieldMapper&
178  );
179 
180  //- Reverse map the given fvPatchField onto this fvPatchField
181  virtual void rmap
182  (
183  const fvPatchField<Type>&,
184  const labelList&
185  );
186 
187 
188  // Evaluation functions
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 
193 
194  //- Write
195  virtual void write(Ostream&) const;
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
Foam::timeVaryingMappedFixedValueFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: timeVaryingMappedFixedValueFvPatchField.C:160
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::timeVaryingMappedFixedValueFvPatchField
This boundary conditions interpolates the values from a set of supplied points in space and time.
Definition: timeVaryingMappedFixedValueFvPatchField.H:127
Foam::timeVaryingMappedFixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: timeVaryingMappedFixedValueFvPatchField.C:199
timeVaryingMappedFixedValueFvPatchField.C
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::timeVaryingMappedFixedValueFvPatchField::timeVaryingMappedFixedValueFvPatchField
timeVaryingMappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: timeVaryingMappedFixedValueFvPatchField.C:37
Foam::timeVaryingMappedFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: timeVaryingMappedFixedValueFvPatchField.C:175
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::timeVaryingMappedFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: timeVaryingMappedFixedValueFvPatchField.H:176
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::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::timeVaryingMappedFixedValueFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: timeVaryingMappedFixedValueFvPatchField.C:149
Foam::List< label >
fixedValueFvPatchFields.H
Foam::timeVaryingMappedFixedValueFvPatchField::TypeName
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
MappedFile.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54