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

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