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 {
197 }
198 
199 
200 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: fvPatchField.C:236
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Type gMin(const FieldField< Field, Type > &f)
virtual void write(Ostream &os) const
Write.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
Definition: facAverage.C:40
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
Definition: fvPatchField.H:375
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:372
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: fvPatchField.C:299
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
virtual void write(Ostream &os) const
Write as a dictionary.
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Type gAverage(const FieldField< Field, Type > &f)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:309
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
This boundary condition provides a self-contained version of the mapped condition. It does not use information on the patch; instead it holds the data locally.
virtual void write(Ostream &) const
Write.
volScalarField & p
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.