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 :
46  mappedPatchBase(p.patch()),
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 :
75  mappedPatchBase(p.patch(), dict),
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 // ************************************************************************* //
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:349
Foam::mappedPatchBase::write
virtual void write(Ostream &) const
Write as a dictionary.
Definition: mappedPatchBase.C:1387
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:571
interpolationCell.H
dimensionedInternalField
rDeltaT dimensionedInternalField()
Foam::operator==
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::mappedFieldFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedFieldFvPatchField.C:148
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:101
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
mappedFieldFvPatchField.H
Foam::Info
messageStream Info
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::mappedPatchFieldBase
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Definition: mappedPatchFieldBase.H:64
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fvPatchField< Type >::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:296
Foam::distance
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
Foam::mappedPatchFieldBase::write
virtual void write(Ostream &) const
Write.
Definition: mappedPatchFieldBase.C:315
Foam::mappedFieldFvPatchField
This boundary condition provides a self-contained version of the mapped condition....
Definition: mappedFieldFvPatchField.H:111
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::mappedFieldFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedFieldFvPatchField.C:172
Foam::fvPatchField< Type >::patch
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:300
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:563
Foam::mappedFieldFvPatchField::mappedFieldFvPatchField
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedFieldFvPatchField.C:40
Foam::mappedPatchBase::sampleMode
sampleMode
Mesh items to sample.
Definition: mappedPatchBase.H:109
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:562
Foam::average
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:335
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51