Loading...
Searching...
No Matches
calculatedFaPatchField.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) 2016-2017 Wikki Ltd
9 Copyright (C) 2021-2023 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 "faPatchFieldMapper.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const faPatch& p,
40:
41 faPatchField<Type>(p, iF)
42{}
43
44
45template<class Type>
47(
48 const faPatch& p,
50 const dictionary& dict,
53:
54 faPatchField<Type>(p, iF, dict, requireValue)
55{}
56
57
58template<class Type>
60(
62 const faPatch& p,
64 const faPatchFieldMapper& mapper
66:
67 faPatchField<Type>(ptf, p, iF, mapper)
68{}
69
70
71template<class Type>
73(
76:
77 faPatchField<Type>(ptf)
78{}
79
80
81template<class Type>
83(
86)
88 faPatchField<Type>(ptf, iF)
89{}
90
91
92template<class Type>
95(
96 const faPatch& 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<faPatchField<Type>>
112 (
113 new calculatedFaPatchField<Type>
114 (
115 p,
116 DimensionedField<Type, areaMesh>::null()
117 )
118 );
120}
121
122
123template<class Type>
124template<class AnyType>
127(
128 const faPatchField<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 << "valueInternalCoeffs cannot be called for a calculatedFaPatchField"
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 << exit(FatalError);
153 return *this;
154}
155
156
157template<class Type>
160(
161 const tmp<scalarField>&
162) const
163{
165 << "valueBoundaryCoeffs cannot be called for a calculatedFaPatchField"
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 << exit(FatalError);
173 return *this;
174}
175
176
177template<class Type>
180{
182 << "gradientInternalCoeffs cannot be called for a "
183 "calculatedFaPatchField"
184 << "\n on patch " << this->patch().name()
185 << " of field " << this->internalField().name()
186 << " in file " << this->internalField().objectPath()
187 << "\n You are probably trying to solve for a field with a "
188 "default boundary condition."
189 << exit(FatalError);
191 return *this;
192}
193
194
195template<class Type>
198{
200 << "\n "
201 "gradientBoundaryCoeffs cannot be called for a "
202 "calculatedFaPatchField"
203 << "\n on patch " << this->patch().name()
204 << " of field " << this->internalField().name()
205 << " in file " << this->internalField().objectPath()
206 << "\n You are probably trying to solve for a field with a "
207 "default boundary condition."
209
210 return *this;
211}
212
213
214template<class Type>
216{
219}
220
221
222// ************************************************************************* //
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
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
virtual void write(Ostream &) const
Write.
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.
calculatedFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
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 faPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-area patch fields.
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
static tmp< faPatchField< Type > > NewCalculatedType(const faPatch &p)
Return a pointer to a new calculatedFaPatchField created on freestore without setting patchField valu...
virtual void write(Ostream &os) const
Write.
const DimensionedField< Type, areaMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
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)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
dictionary dict