Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
29#include "volFields.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<class Type>
35(
36 const fvPatch& p,
38)
40 fixedValueFvPatchField<Type>(p, iF),
41 mappedPatchFieldBase<Type>(mappedPatchFieldBase<Type>::mapper(p, iF), *this)
42{}
43
44
45template<class Type>
47(
48 const fvPatch& p,
50 const dictionary& dict
51)
52:
53 fixedValueFvPatchField<Type>(p, iF, dict),
55 (
56 mappedPatchFieldBase<Type>::mapper(p, iF),
57 *this,
59 *this // initial value for database operation
60 )
61{}
62
63
64template<class Type>
66(
68 const fvPatch& p,
70 const fvPatchFieldMapper& mapper
71)
72:
73 fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
75 (
76 mappedPatchFieldBase<Type>::mapper(p, iF),
77 *this,
78 ptf
79 )
80{}
81
82
83template<class Type>
85(
87)
103 (
104 mappedPatchFieldBase<Type>::mapper(this->patch(), iF),
105 *this,
106 ptf
108{}
109
110
111// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
112
113template<class Type>
115{
116 if (this->updated())
117 {
118 return;
119 }
120
121 this->operator==(this->mappedField());
122
123 if (debug)
124 {
125 auto limits = gMinMax(*this);
126 auto avg = gAverage(*this);
127
128 Info<< "mapped on field:"
129 << this->internalField().name()
130 << " patch:" << this->patch().name()
131 << " avg:" << avg
132 << " min:" << limits.min()
133 << " max:" << limits.max()
134 << endl;
141template<class Type>
143{
147}
148
149
150// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
const fvPatch & patch() const noexcept
Return the patch.
bool updated() const noexcept
True if the boundary condition has already been updated.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
This boundary condition maps the value at a set of cells or patch faces back to *this.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
mappedFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
virtual tmp< Field< Type > > mappedField() const
Map sampleField onto *this patch.
virtual void write(Ostream &os) const
Write.
static const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Check that patch is of correct type.
mappedPatchFieldBase(const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const word &fieldName, const bool setAverage, const Type average, const word &interpolationScheme)
Construct from components.
volScalarField & p
auto limits
Definition setRDeltaT.H:186
OBJstream os(runTime.globalPath()/outputName)
Namespace for handling debugging switches.
Definition debug.C:45
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
dictionary dict