mappedFixedValueFvPatchField.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 "mappedPatchBase.H"
28 #include "volFields.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class Type>
34 (
35  const fvPatch& p,
37 )
38 :
40  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this)
41 {}
42 
43 
44 template<class Type>
46 (
47  const fvPatch& p,
49  const dictionary& dict
50 )
51 :
53  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, dict)
54 {}
55 
56 
57 template<class Type>
59 (
61  const fvPatch& p,
63  const fvPatchFieldMapper& mapper
64 )
65 :
66  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
67  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, ptf)
68 {}
69 
70 
71 template<class Type>
73 (
75 )
76 :
79 {}
80 
81 
82 template<class Type>
84 (
87 )
88 :
90  mappedPatchFieldBase<Type>(this->mapper(this->patch(), iF), *this, ptf)
91 {}
92 
93 
94 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
95 
96 template<class Type>
98 (
99  const fvPatch& p,
101 )
102 {
103  if (!isA<mappedPatchBase>(p.patch()))
104  {
106  << "' not type '" << mappedPatchBase::typeName << "'"
107  << "\n for patch " << p.patch().name()
108  << " of field " << iF.name()
109  << " in file " << iF.objectPath()
110  << exit(FatalError);
111  }
112  return refCast<const mappedPatchBase>(p.patch());
113 }
114 
115 
116 template<class Type>
118 {
119  if (this->updated())
120  {
121  return;
122  }
123 
124  this->operator==(this->mappedField());
125 
126  if (debug)
127  {
128  Info<< "mapped on field:"
129  << this->internalField().name()
130  << " patch:" << this->patch().name()
131  << " avg:" << gAverage(*this)
132  << " min:" << gMin(*this)
133  << " max:" << gMax(*this)
134  << endl;
135  }
136 
138 }
139 
140 
141 template<class Type>
143 {
146  this->writeEntry("value", os);
147 }
148 
149 
150 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
fileName objectPath() const
Return complete path + object name.
Definition: IOobject.H:363
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
Type gMin(const FieldField< Field, Type > &f)
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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
This boundary condition maps the value at a set of cells or patch faces back to *this.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
virtual void write(Ostream &) const
Write.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Foam::fvPatchFieldMapper.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
const word & name() const
Return name.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
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
const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
volScalarField & p
runTime write()
const word & name() const
Return name.
Definition: IOobject.H:260