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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::timeVaryingMappedFixedValueFvPatchField
28
29Group
30 grpInletBoundaryConditions grpCoupledBoundaryConditions
31
32Description
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
50Usage
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
68See also
69 Foam::fixedValueFvPatchField
70 Foam::Function1Types
71
72SourceFiles
73 timeVaryingMappedFixedValueFvPatchField.C
74
75\*---------------------------------------------------------------------------*/
76
77#ifndef timeVaryingMappedFixedValueFvPatchField_H
78#define timeVaryingMappedFixedValueFvPatchField_H
79
81#include "MappedFile.H"
82
83// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85namespace Foam
86{
87
88/*---------------------------------------------------------------------------*\
89 Class timeVaryingMappedFixedValueFvPatchField Declaration
90\*---------------------------------------------------------------------------*/
91
92template<class Type>
93class timeVaryingMappedFixedValueFvPatchField
94:
95 public fixedValueFvPatchField<Type>
96{
97 // Private data
98
99 autoPtr<PatchFunction1Types::MappedFile<Type>> uniformValue_;
100
101
102public:
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 {
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 {
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
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();
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// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary conditions interpolates the values from a set of supplied points in space and time.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("timeVaryingMappedFixedValue")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
timeVaryingMappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73