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-2016 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 #include "volFields.H"
28 #include "interpolationCell.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class Type>
34 (
35  const fvPatch& p,
37 )
38 :
41  mappedPatchFieldBase<Type>(*this, *this)
42 {}
43 
44 
45 template<class Type>
47 (
48  const fvPatch& p,
50  const dictionary& dict
51 )
52 :
55  mappedPatchFieldBase<Type>(*this, *this, dict)
56 {}
57 
58 
59 template<class Type>
61 (
63  const fvPatch& p,
65  const fvPatchFieldMapper& mapper
66 )
67 :
68  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
69  mappedPatchBase(p.patch(), ptf),
70  mappedPatchFieldBase<Type>(*this, *this, ptf)
71 {}
72 
73 
74 template<class Type>
76 (
77  const fvPatch& p,
79 
80  // mappedPatchBase
81  const word& sampleRegion,
82  const sampleMode sampleMode,
83  const word& samplePatch,
84  const scalar distance,
85 
86  // My settings
87  const word& fieldName,
88  const bool setAverage,
89  const Type average,
90  const word& interpolationScheme
91 )
92 :
95  (
96  p.patch(),
97  sampleRegion,
98  sampleMode,
99  samplePatch,
100  distance
101  ),
103  (
104  *this,
105  *this,
106  fieldName,
107  setAverage,
108  average,
109  interpolationScheme
110  )
111 {}
112 
113 
114 template<class Type>
116 (
118 )
119 :
121  mappedPatchBase(ptf.patch().patch(), ptf),
123 {}
124 
125 
126 template<class Type>
128 (
131 )
132 :
134  mappedPatchBase(ptf.patch().patch(), ptf),
135  mappedPatchFieldBase<Type>(*this, *this, ptf)
136 {}
137 
138 
139 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
140 
141 template<class Type>
143 {
144  if (this->updated())
145  {
146  return;
147  }
148 
149  this->operator==(this->mappedField());
150 
151  if (debug)
152  {
153  Info<< "operating on field:" << this->internalField().name()
154  << " patch:" << this->patch().name()
155  << " avg:" << gAverage(*this)
156  << " min:" << gMin(*this)
157  << " max:" << gMax(*this)
158  << endl;
159  }
160 
162 }
163 
164 
165 template<class Type>
167 {
171  this->writeEntry("value", os);
172 }
173 
174 
175 // ************************************************************************* //
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:339
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Type gMin(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
virtual void write(Ostream &) const
Write.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Type gMax(const FieldField< Field, Type > &f)
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Type gAverage(const FieldField< Field, Type > &f)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
messageStream Info
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.
volScalarField & p
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
runTime write()