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-2022 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 (
119 )
120 :
122  mappedPatchBase(ptf.patch().patch(), ptf),
123  mappedPatchFieldBase<Type>(*this, *this, ptf)
124 {}
125 
126 
127 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
128 
129 template<class Type>
131 (
132  const fvPatchFieldMapper& m
133 )
134 {
136  mappedPatchBase::clearOut();
137 }
138 
139 
140 template<class Type>
142 (
143  const fvPatchField<Type>& ptf,
144  const labelList& addr
145 )
146 {
148  mappedPatchBase::clearOut();
149 }
150 
151 
152 template<class Type>
154 (
155  const fvPatchField<Type>& ptf
156 )
157 {
159  mappedPatchBase::clearOut();
160 }
161 
162 
163 template<class Type>
165 {
166  if (this->updated())
167  {
168  return;
169  }
170 
171  this->operator==(this->mappedField());
172 
173  if (debug)
174  {
175  Info<< "operating on field:" << this->internalField().name()
176  << " patch:" << this->patch().name()
177  << " avg:" << gAverage(*this)
178  << " min:" << gMin(*this)
179  << " max:" << gMax(*this)
180  << endl;
181  }
182 
184 }
185 
186 
187 template<class Type>
189 {
193  writeEntry(os, "value", *this);
194 }
195 
196 
197 // ************************************************************************* //
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:156
Type gMin(const FieldField< Field, Type > &f)
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
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
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 ...
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:351
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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.