Loading...
Searching...
No Matches
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\*---------------------------------------------------------------------------*/
30#include "fvPatchFieldMapper.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const fvPatch& p,
40:
41 fvPatchField<Type>(p, iF)
42{}
43
44
45template<class Type>
47(
48 const fvPatch& p,
50 const dictionary& dict,
53:
54 fvPatchField<Type>(p, iF, dict, requireValue)
55{}
56
57
58template<class Type>
60(
62 const fvPatch& p,
64 const fvPatchFieldMapper& mapper
66:
67 fvPatchField<Type>(ptf, p, iF, mapper)
68{}
69
70
71template<class Type>
73(
76:
77 fvPatchField<Type>(ptf)
78{}
79
80
81template<class Type>
83(
86)
88 fvPatchField<Type>(ptf, iF)
89{}
90
91
92template<class Type>
95(
96 const fvPatch& p
97)
98{
99 auto* patchTypeCtor = patchConstructorTable(p.type());
100
101 if (patchTypeCtor)
102 {
103 return patchTypeCtor
104 (
105 p,
107 );
108 }
109 else
110 {
111 return tmp<fvPatchField<Type>>
112 (
113 new calculatedFvPatchField<Type>
114 (
115 p,
116 DimensionedField<Type, volMesh>::null()
117 )
118 );
120}
121
122
123template<class Type>
124template<class AnyType>
127(
128 const fvPatchField<AnyType>& pf
129)
130{
131 return NewCalculatedType(pf.patch());
133
134
135// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
136
137template<class Type>
140(
141 const tmp<scalarField>&
142) const
143{
145 << "cannot be called for a calculatedFvPatchField"
146 << "\n on patch " << this->patch().name()
147 << " of field " << this->internalField().name()
148 << " in file " << this->internalField().objectPath()
149 << "\n You are probably trying to solve for a field with a "
150 "default boundary condition."
151 << abort(FatalError);
153 return *this;
154}
155
156
157template<class Type>
160(
161 const tmp<scalarField>&
162) const
163{
165 << "cannot be called for a calculatedFvPatchField"
166 << "\n on patch " << this->patch().name()
167 << " of field " << this->internalField().name()
168 << " in file " << this->internalField().objectPath()
169 << "\n You are probably trying to solve for a field with a "
170 "default boundary condition."
171 << abort(FatalError);
173 return *this;
174}
175
176
177template<class Type>
180{
182 << "cannot be called for a calculatedFvPatchField"
183 << "\n on patch " << this->patch().name()
184 << " of field " << this->internalField().name()
185 << " in file " << this->internalField().objectPath()
186 << "\n You are probably trying to solve for a field with a "
187 "default boundary condition."
188 << abort(FatalError);
190 return *this;
191}
192
193
194template<class Type>
197{
199 << "cannot be called for a calculatedFvPatchField"
200 << "\n on patch " << this->patch().name()
201 << " of field " << this->internalField().name()
202 << " in file " << this->internalField().objectPath()
203 << "\n You are probably trying to solve for a field with a "
204 "default boundary condition."
206
207 return *this;
208}
209
210
211template<class Type>
213{
216}
217
218
219// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static const this_type & null() noexcept
Return a null DimensionedField (reference to a nullObject).
readOption
Enumeration defining read preferences.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
calculatedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write includes "value" entry.
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:133
const fvPatch & patch() const noexcept
Return the patch.
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.
static tmp< fvPatchField< Type > > NewCalculatedType(const fvPatch &p)
Return a pointer to a new calculatedFvPatchField created on.
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
volScalarField & p
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
Definition errorManip.H:139
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dictionary dict