mappedFieldFvPatchField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 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 \*---------------------------------------------------------------------------*/
25 
27 
28 #include "volFields.H"
29 #include "interpolationCell.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 
38 template<class Type>
40 (
41  const fvPatch& p,
43 )
44 :
47  mappedPatchFieldBase<Type>(*this, *this)
48 {}
49 
50 
51 template<class Type>
53 (
55  const fvPatch& p,
57  const fvPatchFieldMapper& mapper
58 )
59 :
60  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
61  mappedPatchBase(p.patch(), ptf),
62  mappedPatchFieldBase<Type>(*this, *this, ptf)
63 {}
64 
65 
66 template<class Type>
68 (
69  const fvPatch& p,
71  const dictionary& dict
72 )
73 :
76  mappedPatchFieldBase<Type>(*this, *this, dict)
77 {}
78 
79 
80 template<class Type>
82 (
83  const fvPatch& p,
85 
86  // mappedPatchBase
87  const word& sampleRegion,
88  const sampleMode sampleMode,
89  const word& samplePatch,
90  const scalar distance,
91 
92  // My settings
93  const word& fieldName,
94  const bool setAverage,
95  const Type average,
96  const word& interpolationScheme
97 )
98 :
101  (
102  p.patch(),
103  sampleRegion,
104  sampleMode,
105  samplePatch,
106  distance
107  ),
109  (
110  *this,
111  *this,
112  fieldName,
113  setAverage,
114  average,
115  interpolationScheme
116  )
117 {}
118 
119 
120 template<class Type>
122 (
124 )
125 :
127  mappedPatchBase(ptf.patch().patch(), ptf),
129 {}
130 
131 
132 template<class Type>
134 (
137 )
138 :
140  mappedPatchBase(ptf.patch().patch(), ptf),
141  mappedPatchFieldBase<Type>(*this, *this, ptf)
142 {}
143 
144 
145 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
146 
147 template<class Type>
149 {
150  if (this->updated())
151  {
152  return;
153  }
154 
155  this->operator==(this->mappedField());
156 
157  if (debug)
158  {
159  Info<< "operating on field:" << this->dimensionedInternalField().name()
160  << " patch:" << this->patch().name()
161  << " avg:" << gAverage(*this)
162  << " min:" << gMin(*this)
163  << " max:" << gMax(*this)
164  << endl;
165  }
166 
168 }
169 
170 
171 template<class Type>
173 {
177  this->writeEntry("value", os);
178 }
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // ************************************************************************* //
virtual void write(Ostream &) const
Write.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:301
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
messageStream Info
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:354
Namespace for OpenFOAM.
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
dictionary dict
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
volScalarField & p
Definition: createFields.H:51
virtual void write(Ostream &) const
Write.
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Type gMin(const FieldField< Field, Type > &f)
rDeltaT dimensionedInternalField()
This boundary condition provides a self-contained version of the mapped condition. It does not use information on the patch; instead it holds thr data locally.
Type gAverage(const FieldField< Field, Type > &f)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:300
Type gMax(const FieldField< Field, Type > &f)
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write as a dictionary.