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

zeroGradientFvPatchField.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 "zeroGradientFvPatchField.H"
00027 #include <finiteVolume/fvPatchFieldMapper.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 
00034 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00035 
00036 template<class Type>
00037 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
00038 (
00039     const fvPatch& p,
00040     const DimensionedField<Type, volMesh>& iF
00041 )
00042 :
00043     fvPatchField<Type>(p, iF)
00044 {}
00045 
00046 
00047 template<class Type>
00048 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
00049 (
00050     const zeroGradientFvPatchField<Type>& ptf,
00051     const fvPatch& p,
00052     const DimensionedField<Type, volMesh>& iF,
00053     const fvPatchFieldMapper& mapper
00054 )
00055 :
00056     fvPatchField<Type>(ptf, p, iF, mapper)
00057 {}
00058 
00059 
00060 template<class Type>
00061 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
00062 (
00063     const fvPatch& p,
00064     const DimensionedField<Type, volMesh>& iF,
00065     const dictionary& dict
00066 )
00067 :
00068     fvPatchField<Type>(p, iF, dict)
00069 {
00070     fvPatchField<Type>::operator=(this->patchInternalField());
00071 }
00072 
00073 
00074 template<class Type>
00075 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
00076 (
00077     const zeroGradientFvPatchField& zgpf
00078 )
00079 :
00080     fvPatchField<Type>(zgpf)
00081 {}
00082 
00083 
00084 template<class Type>
00085 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
00086 (
00087     const zeroGradientFvPatchField& zgpf,
00088     const DimensionedField<Type, volMesh>& iF
00089 )
00090 :
00091     fvPatchField<Type>(zgpf, iF)
00092 {}
00093 
00094 
00095 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00096 
00097 template<class Type>
00098 void zeroGradientFvPatchField<Type>::evaluate(const Pstream::commsTypes)
00099 {
00100     if (!this->updated())
00101     {
00102         this->updateCoeffs();
00103     }
00104 
00105     fvPatchField<Type>::operator==(this->patchInternalField());
00106     fvPatchField<Type>::evaluate();
00107 }
00108 
00109 
00110 template<class Type>
00111 tmp<Field<Type> > zeroGradientFvPatchField<Type>::valueInternalCoeffs
00112 (
00113     const tmp<scalarField>&
00114 ) const
00115 {
00116     return tmp<Field<Type> >
00117     (
00118         new Field<Type>(this->size(), pTraits<Type>::one)
00119     );
00120 }
00121 
00122 
00123 template<class Type>
00124 tmp<Field<Type> > zeroGradientFvPatchField<Type>::valueBoundaryCoeffs
00125 (
00126     const tmp<scalarField>&
00127 ) const
00128 {
00129     return tmp<Field<Type> >
00130     (
00131         new Field<Type>(this->size(), pTraits<Type>::zero)
00132     );
00133 }
00134 
00135 
00136 template<class Type>
00137 tmp<Field<Type> > zeroGradientFvPatchField<Type>::gradientInternalCoeffs() const
00138 {
00139     return tmp<Field<Type> >
00140     (
00141         new Field<Type>(this->size(), pTraits<Type>::zero)
00142     );
00143 }
00144 
00145 
00146 template<class Type>
00147 tmp<Field<Type> > zeroGradientFvPatchField<Type>::gradientBoundaryCoeffs() const
00148 {
00149     return tmp<Field<Type> >
00150     (
00151         new Field<Type>(this->size(), pTraits<Type>::zero)
00152     );
00153 }
00154 
00155 
00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00157 
00158 } // End namespace Foam
00159 
00160 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines