calculatedFvPatchField.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 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30#include "fvPatchFieldMapper.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34template<class Type>
36{
38}
39
40
41// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
43template<class Type>
45(
46 const fvPatch& p,
48)
49:
50 fvPatchField<Type>(p, iF)
51{}
52
53
54template<class Type>
56(
57 const fvPatch& p,
59 const dictionary& dict,
60 const bool valueRequired
61)
62:
63 fvPatchField<Type>(p, iF, dict, valueRequired)
64{}
65
66
67template<class Type>
69(
71 const fvPatch& p,
73 const fvPatchFieldMapper& mapper
74)
75:
76 fvPatchField<Type>(ptf, p, iF, mapper)
77{}
78
79
80template<class Type>
82(
84)
85:
86 fvPatchField<Type>(ptf)
87{}
88
89
90template<class Type>
92(
95)
96:
97 fvPatchField<Type>(ptf, iF)
98{}
99
100
101template<class Type>
104(
105 const fvPatch& p
106)
107{
108 auto* patchTypeCtor = patchConstructorTable(p.type());
109
110 if (patchTypeCtor)
111 {
112 return patchTypeCtor
113 (
114 p,
116 );
117 }
118 else
119 {
121 (
123 (
124 p,
126 )
127 );
128 }
129}
130
131
132template<class Type>
133template<class Type2>
135(
136 const fvPatchField<Type2>& pf
137)
138{
139 return NewCalculatedType(pf.patch());
140}
141
142
143// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
144
145template<class Type>
148(
149 const tmp<scalarField>&
150) const
151{
153 << "cannot be called for a calculatedFvPatchField"
154 << "\n on patch " << this->patch().name()
155 << " of field " << this->internalField().name()
156 << " in file " << this->internalField().objectPath()
157 << "\n You are probably trying to solve for a field with a "
158 "default boundary condition."
159 << abort(FatalError);
160
161 return *this;
162}
163
164
165template<class Type>
168(
169 const tmp<scalarField>&
170) const
171{
173 << "cannot be called for a calculatedFvPatchField"
174 << "\n on patch " << this->patch().name()
175 << " of field " << this->internalField().name()
176 << " in file " << this->internalField().objectPath()
177 << "\n You are probably trying to solve for a field with a "
178 "default boundary condition."
179 << abort(FatalError);
180
181 return *this;
182}
183
184
185template<class Type>
188{
190 << "cannot be called for a calculatedFvPatchField"
191 << "\n on patch " << this->patch().name()
192 << " of field " << this->internalField().name()
193 << " in file " << this->internalField().objectPath()
194 << "\n You are probably trying to solve for a field with a "
195 "default boundary condition."
196 << abort(FatalError);
197
198 return *this;
199}
200
201
202template<class Type>
205{
207 << "cannot be called for a calculatedFvPatchField"
208 << "\n on patch " << this->patch().name()
209 << " of field " << this->internalField().name()
210 << " in file " << this->internalField().objectPath()
211 << "\n You are probably trying to solve for a field with a "
212 "default boundary condition."
213 << abort(FatalError);
214
215 return *this;
216}
217
218
219template<class Type>
221{
223 this->writeEntry("value", os);
224}
225
226
227// ************************************************************************* //
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
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
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
static tmp< fvPatchField< Type > > NewCalculatedType(const fvPatch &)
Return a pointer to a new calculatedFvPatchField created on.
static const word & calculatedType()
Return the type of the calculated for of fvPatchField.
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:362
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError
dictionary dict