mappedFieldFvPatchField.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-2019 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 #include "interpolationCell.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class Type>
34 (
35  const fvPatch& p,
37 )
38 :
41  mappedPatchFieldBase<Type>(*this, *this)
42 {}
43 
44 
45 template<class Type>
47 (
48  const fvPatch& p,
50  const dictionary& dict
51 )
52 :
55  mappedPatchFieldBase<Type>(*this, *this, dict)
56 {}
57 
58 
59 template<class Type>
61 (
63  const fvPatch& p,
65  const fvPatchFieldMapper& mapper
66 )
67 :
68  fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
69  mappedPatchBase(p.patch(), ptf),
70  mappedPatchFieldBase<Type>(*this, *this, ptf)
71 {}
72 
73 
74 template<class Type>
76 (
77  const fvPatch& p,
79 
80  // mappedPatchBase
81  const word& sampleRegion,
82  const sampleMode sampleMode,
83  const word& samplePatch,
84  const scalar distance,
85 
86  // My settings
87  const word& fieldName,
88  const bool setAverage,
89  const Type average,
90  const word& interpolationScheme
91 )
92 :
95  (
96  p.patch(),
97  sampleRegion,
98  sampleMode,
99  samplePatch,
100  distance
101  ),
103  (
104  *this,
105  *this,
106  fieldName,
107  setAverage,
108  average,
109  interpolationScheme
110  )
111 {}
112 
113 
114 template<class Type>
116 (
118 )
119 :
121  mappedPatchBase(ptf.patch().patch(), ptf),
123 {}
124 
125 
126 template<class Type>
128 (
131 )
132 :
134  mappedPatchBase(ptf.patch().patch(), ptf),
135  mappedPatchFieldBase<Type>(*this, *this, ptf)
136 {}
137 
138 
139 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
140 
141 template<class Type>
143 (
144  const fvPatchFieldMapper& m
145 )
146 {
148  mappedPatchBase::clearOut();
149 }
150 
151 
152 template<class Type>
154 (
155  const fvPatchField<Type>& ptf,
156  const labelList& addr
157 )
158 {
160  mappedPatchBase::clearOut();
161 }
162 
163 
164 template<class Type>
166 {
167  if (this->updated())
168  {
169  return;
170  }
171 
172  this->operator==(this->mappedField());
173 
174  if (debug)
175  {
176  Info<< "operating on field:" << this->internalField().name()
177  << " patch:" << this->patch().name()
178  << " avg:" << gAverage(*this)
179  << " min:" << gMin(*this)
180  << " max:" << gMax(*this)
181  << endl;
182  }
183 
185 }
186 
187 
188 template<class Type>
190 {
194  writeEntry(os, "value", *this);
195 }
196 
197 
198 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Type gMin(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:325
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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
This boundary condition provides a self-contained version of the mapped condition. It does not use information on the patch; instead it holds thr data locally.
virtual void write(Ostream &) const
Write.
volScalarField & p
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.