1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "emptyFvPatchField.H"
28 #include "fvPatchFieldMapper.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 emptyFvPatchField<Type>::emptyFvPatchField
41 const DimensionedField<Type, volMesh>& iF
44 fvPatchField<Type>(p, iF, Field<Type>(0))
49 emptyFvPatchField<Type>::emptyFvPatchField
51 const emptyFvPatchField<Type>&,
53 const DimensionedField<Type, volMesh>& iF,
54 const fvPatchFieldMapper&
57 fvPatchField<Type>(p, iF, Field<Type>(0))
59 if (!isType<emptyFvPatch>(p))
63 "emptyFvPatchField<Type>::emptyFvPatchField\n"
65 " const emptyFvPatchField<Type>&,\n"
66 " const fvPatch& p,\n"
67 " const DimensionedField<Type, volMesh>& iF,\n"
68 " const fvPatchFieldMapper& mapper\n"
70 ) << "\n patch type '" << p.type()
71 << "' not constraint type '" << typeName << "'"
72 << "\n for patch " << p.name()
73 << " of field " << this->dimensionedInternalField().name()
74 << " in file " << this->dimensionedInternalField().objectPath()
75 << exit(FatalIOError);
81 emptyFvPatchField<Type>::emptyFvPatchField
84 const DimensionedField<Type, volMesh>& iF,
85 const dictionary& dict
88 fvPatchField<Type>(p, iF, Field<Type>(0))
90 if (!isType<emptyFvPatch>(p))
94 "emptyFvPatchField<Type>::emptyFvPatchField\n"
96 " const fvPatch& p,\n"
97 " const Field<Type>& field,\n"
98 " const dictionary& dict\n"
101 ) << "\n patch type '" << p.type()
102 << "' not constraint type '" << typeName << "'"
103 << "\n for patch " << p.name()
104 << " of field " << this->dimensionedInternalField().name()
105 << " in file " << this->dimensionedInternalField().objectPath()
106 << exit(FatalIOError);
112 emptyFvPatchField<Type>::emptyFvPatchField
114 const emptyFvPatchField<Type>& ptf
120 ptf.dimensionedInternalField(),
127 emptyFvPatchField<Type>::emptyFvPatchField
129 const emptyFvPatchField<Type>& ptf,
130 const DimensionedField<Type, volMesh>& iF
133 fvPatchField<Type>(ptf.patch(), iF, Field<Type>(0))
137 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
140 void emptyFvPatchField<Type>::updateCoeffs()
144 this->dimensionedInternalField().mesh().nCells() > 0
146 this->patch().patch().size()
147 % this->dimensionedInternalField().mesh().nCells()
151 FatalErrorIn("emptyFvPatchField<Type>::updateCoeffs()")
152 << "This mesh contains patches of type empty but is not 1D or 2D\n"
153 " by virtue of the fact that the number of faces of this\n"
154 " empty patch is not divisible by the number of cells."
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // ************************************************************************* //