OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

emptyFvPatchField.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "emptyFvPatchField.H"
00028 #include "fvPatchFieldMapper.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00036 
00037 template<class Type>
00038 emptyFvPatchField<Type>::emptyFvPatchField
00039 (
00040     const fvPatch& p,
00041     const DimensionedField<Type, volMesh>& iF
00042 )
00043 :
00044     fvPatchField<Type>(p, iF, Field<Type>(0))
00045 {}
00046 
00047 
00048 template<class Type>
00049 emptyFvPatchField<Type>::emptyFvPatchField
00050 (
00051     const emptyFvPatchField<Type>&,
00052     const fvPatch& p,
00053     const DimensionedField<Type, volMesh>& iF,
00054     const fvPatchFieldMapper&
00055 )
00056 :
00057     fvPatchField<Type>(p, iF, Field<Type>(0))
00058 {
00059     if (!isType<emptyFvPatch>(p))
00060     {
00061         FatalErrorIn
00062         (
00063             "emptyFvPatchField<Type>::emptyFvPatchField\n"
00064             "(\n"
00065             "    const emptyFvPatchField<Type>&,\n"
00066             "    const fvPatch& p,\n"
00067             "    const DimensionedField<Type, volMesh>& iF,\n"
00068             "    const fvPatchFieldMapper& mapper\n"
00069             ")\n"
00070         )   << "\n    patch type '" << p.type()
00071             << "' not constraint type '" << typeName << "'"
00072             << "\n    for patch " << p.name()
00073             << " of field " << this->dimensionedInternalField().name()
00074             << " in file " << this->dimensionedInternalField().objectPath()
00075             << exit(FatalIOError);
00076     }
00077 }
00078 
00079 
00080 template<class Type>
00081 emptyFvPatchField<Type>::emptyFvPatchField
00082 (
00083     const fvPatch& p,
00084     const DimensionedField<Type, volMesh>& iF,
00085     const dictionary& dict
00086 )
00087 :
00088     fvPatchField<Type>(p, iF, Field<Type>(0))
00089 {
00090     if (!isType<emptyFvPatch>(p))
00091     {
00092         FatalIOErrorIn
00093         (
00094             "emptyFvPatchField<Type>::emptyFvPatchField\n"
00095             "(\n"
00096             "    const fvPatch& p,\n"
00097             "    const Field<Type>& field,\n"
00098             "    const dictionary& dict\n"
00099             ")\n",
00100             dict
00101         )   << "\n    patch type '" << p.type()
00102             << "' not constraint type '" << typeName << "'"
00103             << "\n    for patch " << p.name()
00104             << " of field " << this->dimensionedInternalField().name()
00105             << " in file " << this->dimensionedInternalField().objectPath()
00106             << exit(FatalIOError);
00107     }
00108 }
00109 
00110 
00111 template<class Type>
00112 emptyFvPatchField<Type>::emptyFvPatchField
00113 (
00114     const emptyFvPatchField<Type>& ptf
00115 )
00116 :
00117     fvPatchField<Type>
00118     (
00119         ptf.patch(),
00120         ptf.dimensionedInternalField(),
00121         Field<Type>(0)
00122     )
00123 {}
00124 
00125 
00126 template<class Type>
00127 emptyFvPatchField<Type>::emptyFvPatchField
00128 (
00129     const emptyFvPatchField<Type>& ptf,
00130     const DimensionedField<Type, volMesh>& iF
00131 )
00132 :
00133     fvPatchField<Type>(ptf.patch(), iF, Field<Type>(0))
00134 {}
00135 
00136 
00137 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00138 
00139 template<class Type>
00140 void emptyFvPatchField<Type>::updateCoeffs()
00141 {
00142     if
00143     (
00144         this->patch().patch().size()
00145       % this->dimensionedInternalField().mesh().nCells()
00146     )
00147     {
00148         FatalErrorIn("emptyFvPatchField<Type>::updateCoeffs()")
00149             << "This mesh contains patches of type empty but is not 1D or 2D\n"
00150                "    by virtue of the fact that the number of faces of this\n"
00151                "    empty patch is not divisible by the number of cells."
00152             << exit(FatalError);
00153     }
00154 }
00155 
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 } // End namespace Foam
00160 
00161 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd