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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2018 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 \*---------------------------------------------------------------------------*/
27 
29 #include "volFields.H"
30 #include "interpolationCell.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 template<class Type>
36 (
37  const fvPatch& p,
39 )
40 :
41  fixedValueFvPatchField<Type>(p, iF),
43  mappedPatchFieldBase<Type>(*this, *this)
44 {}
45 
46 
47 template<class Type>
49 (
50  const fvPatch& p,
52  const dictionary& dict
53 )
54 :
55  fixedValueFvPatchField<Type>(p, iF, dict),
57  mappedPatchFieldBase<Type>(*this, *this, dict, *this)
58 {}
59 
60 
61 template<class Type>
63 (
65  const fvPatch& p,
67  const fvPatchFieldMapper& mapper
68 )
69 :
70  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
72  mappedPatchFieldBase<Type>(*this, *this, ptf)
73 {}
74 
75 
76 template<class Type>
78 (
79  const fvPatch& p,
81 
82  // mappedPatchBase
83  const word& sampleRegion,
84  const sampleMode sampleMode,
85  const word& samplePatch,
86  const scalar distance,
87 
88  // My settings
89  const word& fieldName,
90  const bool setAverage,
91  const Type average,
92  const word& interpolationScheme
93 )
94 :
95  fixedValueFvPatchField<Type>(p, iF),
97  (
98  p.patch(),
99  sampleRegion,
100  sampleMode,
101  samplePatch,
102  distance
103  ),
105  (
106  *this,
107  *this,
108  fieldName,
109  setAverage,
110  average,
111  interpolationScheme
112  )
113 {}
114 
115 
116 template<class Type>
118 (
120 )
121 :
122  fixedValueFvPatchField<Type>(ptf),
123  mappedPatchBase(ptf.patch().patch(), ptf),
124  mappedPatchFieldBase<Type>(ptf)
125 {}
126 
127 
128 template<class Type>
130 (
133 )
134 :
135  fixedValueFvPatchField<Type>(ptf, iF),
136  mappedPatchBase(ptf.patch().patch(), ptf),
137  mappedPatchFieldBase<Type>(*this, *this, ptf)
138 {}
139 
140 
141 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
142 
143 template<class Type>
145 (
146  const fvPatchFieldMapper& m
147 )
148 {
151 }
152 
153 
154 template<class Type>
156 (
157  const fvPatchField<Type>& ptf,
158  const labelList& addr
159 )
160 {
163 }
164 
165 
166 template<class Type>
168 {
169  if (this->updated())
170  {
171  return;
172  }
173 
174  this->operator==(this->mappedField());
175 
176  if (debug)
177  {
178  Info<< "operating on field:" << this->internalField().name()
179  << " patch:" << this->patch().name()
180  << " avg:" << gAverage(*this)
181  << " min:" << gMin(*this)
182  << " max:" << gMax(*this)
183  << endl;
184  }
185 
187 }
188 
189 
190 template<class Type>
192 {
196  this->writeEntry("value", os);
197 }
198 
199 
200 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Foam::fvPatchField< Type >
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Definition: fvPatchField.C:377
Foam::mappedPatchBase::clearOut
void clearOut()
Definition: mappedPatchBase.C:1566
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::mappedFieldFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Definition: mappedFieldFvPatchField.C:138
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:597
Foam::fac::average
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facAverage.C:40
interpolationCell.H
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::mappedFieldFvPatchField::updateCoeffs
virtual void updateCoeffs()
Definition: mappedFieldFvPatchField.C:160
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:108
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:76
mappedFieldFvPatchField.H
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
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:101
Foam::fvPatchField< Type >::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Definition: fvPatchField.C:304
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
os
OBJstream os(runTime.globalPath()/outputName)
Foam::fvPatchField< Type >::updateCoeffs
virtual void updateCoeffs()
Definition: fvPatchField.C:314
Foam::distance
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
Foam::mappedPatchFieldBase::write
virtual void write(Ostream &os) const
Definition: mappedPatchFieldBase.C:1000
Foam::mappedFieldFvPatchField
This boundary condition provides a self-contained version of the mapped condition....
Definition: mappedFieldFvPatchField.H:110
Foam::foamVersion::patch
const std::string patch
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
Foam::mappedPatchBase::write
virtual void write(Ostream &os) const
Definition: mappedPatchBase.C:1935
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Definition: foamVtkOutputTemplates.C:29
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:41
Foam::mappedFieldFvPatchField::write
virtual void write(Ostream &) const
Definition: mappedFieldFvPatchField.C:184
Foam::fvPatchField< Type >::patch
const fvPatch & patch() const
Definition: fvPatchField.H:353
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:586
Foam::mappedFieldFvPatchField::mappedFieldFvPatchField
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Definition: mappedFieldFvPatchField.C:29
Foam::mappedPatchBase::sampleMode
sampleMode
Definition: mappedPatchBase.H:115
Foam::fvPatchField< Type >::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Definition: fvPatchField.C:241
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:585
Foam::mappedFieldFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Definition: mappedFieldFvPatchField.C:149
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:50