mappedFixedValueFvPatchField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class Type>
33 (
34  const fvPatch& p,
36 )
37 :
39  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this)
40 {}
41 
42 
43 template<class Type>
45 (
46  const fvPatch& p,
48  const dictionary& dict
49 )
50 :
52  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, dict)
53 {}
54 
55 
56 template<class Type>
58 (
60  const fvPatch& p,
62  const fvPatchFieldMapper& mapper
63 )
64 :
65  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
66  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, ptf)
67 {}
68 
69 
70 template<class Type>
72 (
74 )
75 :
78 {}
79 
80 
81 template<class Type>
83 (
86 )
87 :
89  mappedPatchFieldBase<Type>(this->mapper(this->patch(), iF), *this, ptf)
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
95 template<class Type>
97 (
98  const fvPatch& p,
100 )
101 {
102  if (!isA<mappedPatchBase>(p.patch()))
103  {
105  << "' not type '" << mappedPatchBase::typeName << "'"
106  << "\n for patch " << p.patch().name()
107  << " of field " << iF.name()
108  << " in file " << iF.objectPath()
109  << exit(FatalError);
110  }
111  return refCast<const mappedPatchBase>(p.patch());
112 }
113 
114 
115 template<class Type>
117 {
118  if (this->updated())
119  {
120  return;
121  }
122 
123  this->operator==(this->mappedField());
124 
125  if (debug)
126  {
127  Info<< "mapped on field:"
128  << this->internalField().name()
129  << " patch:" << this->patch().name()
130  << " avg:" << gAverage(*this)
131  << " min:" << gMin(*this)
132  << " max:" << gMax(*this)
133  << endl;
134  }
135 
137 }
138 
139 
140 template<class Type>
142 {
145  this->writeEntry("value", os);
146 }
147 
148 
149 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
const word & name() const
Return name.
const word & name() const
Return name.
Definition: IOobject.H:297
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:256
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.
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
Foam::fvPatchFieldMapper.
virtual void write(Ostream &) const
Write.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
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
fileName objectPath() const
Return complete path + object name.
Definition: IOobject.H:418