Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / constraint / empty / emptyFvPatchField.C
blob39e4de6bef969d55040dac37d274b5cf31e92a3d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
35 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
37 template<class Type>
38 emptyFvPatchField<Type>::emptyFvPatchField
40     const fvPatch& p,
41     const DimensionedField<Type, volMesh>& iF
44     fvPatchField<Type>(p, iF, Field<Type>(0))
48 template<class Type>
49 emptyFvPatchField<Type>::emptyFvPatchField
51     const emptyFvPatchField<Type>&,
52     const fvPatch& p,
53     const DimensionedField<Type, volMesh>& iF,
54     const fvPatchFieldMapper&
57     fvPatchField<Type>(p, iF, Field<Type>(0))
59     if (!isType<emptyFvPatch>(p))
60     {
61         FatalErrorIn
62         (
63             "emptyFvPatchField<Type>::emptyFvPatchField\n"
64             "(\n"
65             "    const emptyFvPatchField<Type>&,\n"
66             "    const fvPatch& p,\n"
67             "    const DimensionedField<Type, volMesh>& iF,\n"
68             "    const fvPatchFieldMapper& mapper\n"
69             ")\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);
76     }
80 template<class Type>
81 emptyFvPatchField<Type>::emptyFvPatchField
83     const fvPatch& p,
84     const DimensionedField<Type, volMesh>& iF,
85     const dictionary& dict
88     fvPatchField<Type>(p, iF, Field<Type>(0))
90     if (!isType<emptyFvPatch>(p))
91     {
92         FatalIOErrorIn
93         (
94             "emptyFvPatchField<Type>::emptyFvPatchField\n"
95             "(\n"
96             "    const fvPatch& p,\n"
97             "    const Field<Type>& field,\n"
98             "    const dictionary& dict\n"
99             ")\n",
100             dict
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);
107     }
111 template<class Type>
112 emptyFvPatchField<Type>::emptyFvPatchField
114     const emptyFvPatchField<Type>& ptf
117     fvPatchField<Type>
118     (
119         ptf.patch(),
120         ptf.dimensionedInternalField(),
121         Field<Type>(0)
122     )
126 template<class Type>
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  * * * * * * * * * * * * * //
139 template<class Type>
140 void emptyFvPatchField<Type>::updateCoeffs()
142     if
143     (
144         this->dimensionedInternalField().mesh().nCells() > 0
145      && (
146             this->patch().patch().size()
147           % this->dimensionedInternalField().mesh().nCells()
148         )
149     )
150     {
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."
155             << exit(FatalError);
156     }
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // ************************************************************************* //