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-2015 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
37 template<class Type>
39 (
40  const fvPatch& p,
42 )
43 :
45  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this)
46 {}
47 
48 
49 template<class Type>
51 (
53  const fvPatch& p,
55  const fvPatchFieldMapper& mapper
56 )
57 :
58  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
59  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, ptf)
60 {}
61 
62 
63 template<class Type>
65 (
66  const fvPatch& p,
68  const dictionary& dict
69 )
70 :
72  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, dict)
73 {}
74 
75 
76 template<class Type>
78 (
80 )
81 :
84 {}
85 
86 
87 template<class Type>
89 (
92 )
93 :
95  mappedPatchFieldBase<Type>(this->mapper(this->patch(), iF), *this, ptf)
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
101 template<class Type>
103 (
104  const fvPatch& p,
106 )
107 {
108  if (!isA<mappedPatchBase>(p.patch()))
109  {
111  << "' not type '" << mappedPatchBase::typeName << "'"
112  << "\n for patch " << p.patch().name()
113  << " of field " << iF.name()
114  << " in file " << iF.objectPath()
115  << exit(FatalError);
116  }
117  return refCast<const mappedPatchBase>(p.patch());
118 }
119 
120 
121 template<class Type>
123 {
124  if (this->updated())
125  {
126  return;
127  }
128 
129  this->operator==(this->mappedField());
130 
131  if (debug)
132  {
133  Info<< "mapped on field:"
134  << this->dimensionedInternalField().name()
135  << " patch:" << this->patch().name()
136  << " avg:" << gAverage(*this)
137  << " min:" << gMin(*this)
138  << " max:" << gMax(*this)
139  << endl;
140  }
141 
143 }
144 
145 
146 template<class Type>
148 {
151  this->writeEntry("value", os);
152 }
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // ************************************************************************* //
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:349
p
p
Definition: pEqn.H:62
Foam::mappedFixedValueFvPatchField
This boundary condition maps the value at a set of cells or patch faces back to *this.
Definition: mappedFixedValueFvPatchField.H:123
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:571
dimensionedInternalField
rDeltaT dimensionedInternalField()
Foam::operator==
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:101
Foam::mappedFixedValueFvPatchField::mappedFixedValueFvPatchField
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedFixedValueFvPatchField.C:39
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
Foam::Info
messageStream Info
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::mappedFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedFixedValueFvPatchField.C:122
mappedFixedValueFvPatchField.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::mappedPatchFieldBase
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Definition: mappedPatchFieldBase.H:64
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fvPatchField< Type >::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:296
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::mappedPatchFieldBase::write
virtual void write(Ostream &) const
Write.
Definition: mappedPatchFieldBase.C:315
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:563
Foam::mappedFixedValueFvPatchField::mapper
const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Definition: mappedFixedValueFvPatchField.C:103
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:562
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::mappedFixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedFixedValueFvPatchField.C:147
mappedPatchBase.H