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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
29 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class Type>
35 (
36  const fvPatch& p,
38 )
39 :
41  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this)
42 {}
43 
44 
45 template<class Type>
47 (
48  const fvPatch& p,
50  const dictionary& dict
51 )
52 :
54  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, dict)
55 {}
56 
57 
58 template<class Type>
60 (
62  const fvPatch& p,
64  const fvPatchFieldMapper& mapper
65 )
66 :
67  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
68  mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, ptf)
69 {}
70 
71 
72 template<class Type>
74 (
76 )
77 :
80 {}
81 
82 
83 template<class Type>
85 (
88 )
89 :
91  mappedPatchFieldBase<Type>(this->mapper(this->patch(), iF), *this, ptf)
92 {}
93 
94 
95 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
96 
97 template<class Type>
99 (
100  const fvPatch& p,
102 )
103 {
104  if (!isA<mappedPatchBase>(p.patch()))
105  {
107  << "' not type '" << mappedPatchBase::typeName << "'"
108  << "\n for patch " << p.patch().name()
109  << " of field " << iF.name()
110  << " in file " << iF.objectPath()
111  << exit(FatalError);
112  }
113  return refCast<const mappedPatchBase>(p.patch());
114 }
115 
116 
117 template<class Type>
119 {
120  if (this->updated())
121  {
122  return;
123  }
124 
125  this->operator==(this->mappedField());
126 
127  if (debug)
128  {
129  Info<< "mapped on field:"
130  << this->internalField().name()
131  << " patch:" << this->patch().name()
132  << " avg:" << gAverage(*this)
133  << " min:" << gMin(*this)
134  << " max:" << gMax(*this)
135  << endl;
136  }
137 
139 }
140 
141 
142 template<class Type>
144 {
147  this->writeEntry("value", os);
148 }
149 
150 
151 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
volFields.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::mappedFixedValueFvPatchField
This boundary condition maps the value at a set of cells or patch faces back to *this.
Definition: mappedFixedValueFvPatchField.H:125
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:604
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:105
Foam::mappedFixedValueFvPatchField::mappedFixedValueFvPatchField
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: mappedFixedValueFvPatchField.C:35
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::mappedFixedValueFvPatchField::mapper
const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Definition: mappedFixedValueFvPatchField.C:99
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Foam::mappedFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mappedFixedValueFvPatchField.C:118
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:102
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:593
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:592
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::mappedFixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: mappedFixedValueFvPatchField.C:143