FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "emptyFvPatchField.H"
00027 #include <finiteVolume/fvPatchFieldMapper.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 
00034 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00035 
00036 template<class Type>
00037 emptyFvPatchField<Type>::emptyFvPatchField
00038 (
00039     const fvPatch& p,
00040     const DimensionedField<Type, volMesh>& iF
00041 )
00042 :
00043     fvPatchField<Type>(p, iF, Field<Type>(0))
00044 {}
00045 
00046 
00047 template<class Type>
00048 emptyFvPatchField<Type>::emptyFvPatchField
00049 (
00050     const emptyFvPatchField<Type>&,
00051     const fvPatch& p,
00052     const DimensionedField<Type, volMesh>& iF,
00053     const fvPatchFieldMapper&
00054 )
00055 :
00056     fvPatchField<Type>(p, iF, Field<Type>(0))
00057 {
00058     if (!isType<emptyFvPatch>(p))
00059     {
00060         FatalErrorIn
00061         (
00062             "emptyFvPatchField<Type>::emptyFvPatchField\n"
00063             "(\n"
00064             "    const emptyFvPatchField<Type>&,\n"
00065             "    const fvPatch& p,\n"
00066             "    const DimensionedField<Type, volMesh>& iF,\n"
00067             "    const fvPatchFieldMapper& mapper\n"
00068             ")\n"
00069         )   << "\n    patch type '" << p.type()
00070             << "' not constraint type '" << typeName << "'"
00071             << "\n    for patch " << p.name()
00072             << " of field " << this->dimensionedInternalField().name()
00073             << " in file " << this->dimensionedInternalField().objectPath()
00074             << exit(FatalIOError);
00075     }
00076 }
00077 
00078 
00079 template<class Type>
00080 emptyFvPatchField<Type>::emptyFvPatchField
00081 (
00082     const fvPatch& p,
00083     const DimensionedField<Type, volMesh>& iF,
00084     const dictionary& dict
00085 )
00086 :
00087     fvPatchField<Type>(p, iF, Field<Type>(0))
00088 {
00089     if (!isType<emptyFvPatch>(p))
00090     {
00091         FatalIOErrorIn
00092         (
00093             "emptyFvPatchField<Type>::emptyFvPatchField\n"
00094             "(\n"
00095             "    const fvPatch& p,\n"
00096             "    const Field<Type>& field,\n"
00097             "    const dictionary& dict\n"
00098             ")\n",
00099             dict
00100         )   << "\n    patch type '" << p.type()
00101             << "' not constraint type '" << typeName << "'"
00102             << "\n    for patch " << p.name()
00103             << " of field " << this->dimensionedInternalField().name()
00104             << " in file " << this->dimensionedInternalField().objectPath()
00105             << exit(FatalIOError);
00106     }
00107 }
00108 
00109 
00110 template<class Type>
00111 emptyFvPatchField<Type>::emptyFvPatchField
00112 (
00113     const emptyFvPatchField<Type>& ptf
00114 )
00115 :
00116     fvPatchField<Type>
00117     (
00118         ptf.patch(),
00119         ptf.dimensionedInternalField(),
00120         Field<Type>(0)
00121     )
00122 {}
00123 
00124 
00125 template<class Type>
00126 emptyFvPatchField<Type>::emptyFvPatchField
00127 (
00128     const emptyFvPatchField<Type>& ptf,
00129     const DimensionedField<Type, volMesh>& iF
00130 )
00131 :
00132     fvPatchField<Type>(ptf.patch(), iF, Field<Type>(0))
00133 {}
00134 
00135 
00136 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00137 
00138 template<class Type>
00139 void emptyFvPatchField<Type>::updateCoeffs()
00140 {
00141     if (debug)
00142     {
00143         if
00144         (
00145             this->dimensionedInternalField().mesh().nCells() > 0
00146         && (
00147                 this->patch().patch().size()
00148             % this->dimensionedInternalField().mesh().nCells()
00149             )
00150         )
00151         {
00152             WarningIn("emptyFvPatchField<Type>::updateCoeffs()")
00153                 << "This mesh contains patches of type empty but is not 1D or 2D\n"
00154                 "    by virtue of the fact that the number of faces of this\n"
00155                 "    empty patch is not divisible by the number of cells."
00156                 << endl;
00157         }
00158     }
00159 }
00160 
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 } // End namespace Foam
00165 
00166 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines