mappedFieldFvPatchField.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-2018 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\*---------------------------------------------------------------------------*/
27
29#include "volFields.H"
30#include "interpolationCell.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const fvPatch& p,
39)
40:
41 fixedValueFvPatchField<Type>(p, iF),
42 mappedPatchBase(p.patch()),
43 mappedPatchFieldBase<Type>(*this, *this)
44{}
45
46
47template<class Type>
49(
50 const fvPatch& p,
52 const dictionary& dict
53)
54:
55 fixedValueFvPatchField<Type>(p, iF, dict),
56 mappedPatchBase(p.patch(), dict),
57 mappedPatchFieldBase<Type>(*this, *this, dict, *this)
58{}
59
60
61template<class Type>
63(
65 const fvPatch& p,
67 const fvPatchFieldMapper& mapper
68)
69:
70 fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
71 mappedPatchBase(p.patch(), ptf),
72 mappedPatchFieldBase<Type>(*this, *this, ptf)
73{}
74
75
76template<class Type>
78(
79 const fvPatch& p,
81
82 // mappedPatchBase
83 const word& sampleRegion,
85 const word& samplePatch,
86 const scalar distance,
87
88 // My settings
89 const word& fieldName,
90 const bool setAverage,
91 const Type average,
92 const word& interpolationScheme
93)
94:
95 fixedValueFvPatchField<Type>(p, iF),
97 (
98 p.patch(),
99 sampleRegion,
101 samplePatch,
103 ),
105 (
106 *this,
107 *this,
108 fieldName,
109 setAverage,
110 average,
111 interpolationScheme
112 )
113{}
114
115
116template<class Type>
118(
120)
121:
122 fixedValueFvPatchField<Type>(ptf),
123 mappedPatchBase(ptf.patch().patch(), ptf),
124 mappedPatchFieldBase<Type>(ptf)
125{}
126
127
128template<class Type>
130(
133)
134:
135 fixedValueFvPatchField<Type>(ptf, iF),
136 mappedPatchBase(ptf.patch().patch(), ptf),
137 mappedPatchFieldBase<Type>(*this, *this, ptf)
138{}
139
140
141// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
142
143template<class Type>
145(
146 const fvPatchFieldMapper& m
147)
148{
151}
152
153
154template<class Type>
156(
157 const fvPatchField<Type>& ptf,
158 const labelList& addr
159)
160{
163}
164
165
166template<class Type>
168{
169 if (this->updated())
170 {
171 return;
172 }
173
174 this->operator==(this->mappedField());
175
176 if (debug)
177 {
178 Info<< "operating on field:" << this->internalField().name()
179 << " patch:" << this->patch().name()
180 << " avg:" << gAverage(*this)
181 << " min:" << gMin(*this)
182 << " max:" << gMax(*this)
183 << endl;
184 }
185
187}
188
189
190template<class Type>
192{
196 this->writeEntry("value", os);
197}
198
199
200// ************************************************************************* //
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:62
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
void rmap(const atmBoundaryLayer &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a self-contained version of the mapped condition....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
sampleMode
Mesh items to sample.
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Type gAverage(const FieldField< Field, Type > &f)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
dictionary dict