Loading...
Searching...
No Matches
emptyFvsPatchField.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) 2024 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#include "surfaceMesh.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
35template<class Type>
37(
38 const fvPatch& p,
41:
42 fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
43{}
44
45
46template<class Type>
48(
49 const fvPatch& p,
51 const dictionary& dict
52)
53:
54 fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
55{
56 // Empty means empty, so no patchType override
57 // with fvsPatchFieldBase::readDict(dict);
58
60 {
62 << "patch " << this->patch().index() << " not empty type. "
63 << "Patch type = " << p.type()
65 }
66}
67
68
69template<class Type>
71(
72 const emptyFvsPatchField<Type>&,
73 const fvPatch& p,
74 const DimensionedField<Type, surfaceMesh>& iF,
75 const fvPatchFieldMapper&
76)
77:
78 fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
79{
80 if (!isType<emptyFvPatch>(this->patch()))
81 {
83 << "Field type does not correspond to patch type for patch "
84 << this->patch().index() << "." << endl
85 << "Field type: " << typeName << endl
86 << "Patch type: " << this->patch().type()
87 << exit(FatalError);
88 }
89}
90
91
92template<class Type>
94(
95 const emptyFvsPatchField<Type>& ptf,
96 const DimensionedField<Type, surfaceMesh>& iF
98:
99 fvsPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized
100{}
101
102
103template<class Type>
105(
106 const emptyFvsPatchField<Type>& ptf
107)
108:
110{}
111
112
113// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114
115template<class Type>
117{
119 // Never write "value"
120}
121
122
123// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition provides an 'empty' condition for reduced dimensions cases.
virtual void write(Ostream &) const
Write without "value" entry!
emptyFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
label index() const noexcept
The index of this patch in the boundary mesh.
Definition fvPatch.H:218
const fvPatch & patch() const noexcept
Return the patch.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
fvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &os) const
Write the patch "type".
const DimensionedField< Type, surfaceMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
volScalarField & p
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition error.H:629
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
OBJstream os(runTime.globalPath()/outputName)
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
bool isType(const U &obj)
Check if typeid of the object and Type are identical.
Definition typeInfo.H:112
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