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 -------------------------------------------------------------------------------
11 License
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 
29 #include "emptyFvsPatchField.H"
31 #include "surfaceMesh.H"
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 
35 template<class Type>
37 (
38  const fvPatch& p,
40 )
41 :
42  fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
43 {}
44 
45 
46 template<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 
59  if (!isType<emptyFvPatch>(p))
60  {
62  << "patch " << this->patch().index() << " not empty type. "
63  << "Patch type = " << p.type()
65  }
66 }
67 
68 
69 template<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()
88  }
89 }
90 
91 
92 template<class Type>
94 (
95  const emptyFvsPatchField<Type>& ptf,
96  const DimensionedField<Type, surfaceMesh>& iF
97 )
98 :
99  fvsPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized
100 {}
101 
102 
103 template<class Type>
105 (
106  const emptyFvsPatchField<Type>& ptf
107 )
108 :
109  emptyFvsPatchField<Type>(ptf, ptf.internalField())
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 
115 template<class Type>
117 {
119  // Never write "value"
120 }
121 
122 
123 // ************************************************************************* //
dictionary dict
virtual void write(Ostream &) const
Write without "value" entry!
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:608
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
const fvPatch & patch() const noexcept
Return the patch.
static const char *const typeName
Typename for Field.
Definition: Field.H:86
emptyFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
Generic templated field type.
Definition: Field.H:62
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
virtual void write(Ostream &os) const
Write the patch "type".
This boundary condition provides an &#39;empty&#39; condition for reduced dimensions cases.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:637
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
volScalarField & p
label index() const noexcept
The index of this patch in the boundary mesh.
Definition: fvPatch.H:218
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...