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-2020 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 (
75 )
76 :
78  mappedPatchFieldBase<Type>(this->mapper(this->patch(), iF), *this, ptf)
79 {}
80 
81 
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 
84 template<class Type>
86 (
87  const fvPatch& p,
89 )
90 {
91  if (!isA<mappedPatchBase>(p.patch()))
92  {
94  << "' not type '" << mappedPatchBase::typeName << "'"
95  << "\n for patch " << p.patch().name()
96  << " of field " << iF.name()
97  << " in file " << iF.objectPath()
98  << exit(FatalError);
99  }
100  return refCast<const mappedPatchBase>(p.patch());
101 }
102 
103 
104 template<class Type>
106 {
107  if (this->updated())
108  {
109  return;
110  }
111 
112  this->operator==(this->mappedField());
113 
114  if (debug)
115  {
116  Info<< "mapped on field:"
117  << this->internalField().name()
118  << " patch:" << this->patch().name()
119  << " avg:" << gAverage(*this)
120  << " min:" << gMin(*this)
121  << " max:" << gMax(*this)
122  << endl;
123  }
124 
126 }
127 
128 
129 template<class Type>
131 {
134  writeEntry(os, "value", *this);
135 }
136 
137 
138 // ************************************************************************* //
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:303
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:156
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:323
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:251
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
This boundary condition maps the value at a set of cells or patch faces back to *this.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:138
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 ...
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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:54
Type gMax(const FieldField< Field, Type > &f)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
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:419