initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / zeroGradient / zeroGradientFvPatchField.C
blobad46cd7b261f72a4100be62de28dfeaf8cfa0332
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 "zeroGradientFvPatchField.H"
28 #include "fvPatchFieldMapper.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
35 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
37 template<class Type>
38 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
40     const fvPatch& p,
41     const DimensionedField<Type, volMesh>& iF
44     fvPatchField<Type>(p, iF)
48 template<class Type>
49 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
51     const zeroGradientFvPatchField<Type>& ptf,
52     const fvPatch& p,
53     const DimensionedField<Type, volMesh>& iF,
54     const fvPatchFieldMapper& mapper
57     fvPatchField<Type>(ptf, p, iF, mapper)
61 template<class Type>
62 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
64     const fvPatch& p,
65     const DimensionedField<Type, volMesh>& iF,
66     const dictionary& dict
69     fvPatchField<Type>(p, iF, dict)
71     fvPatchField<Type>::operator=(this->patchInternalField());
75 template<class Type>
76 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
78     const zeroGradientFvPatchField& zgpf
81     fvPatchField<Type>(zgpf)
85 template<class Type>
86 zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
88     const zeroGradientFvPatchField& zgpf,
89     const DimensionedField<Type, volMesh>& iF
92     fvPatchField<Type>(zgpf, iF)
96 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
98 template<class Type>
99 void zeroGradientFvPatchField<Type>::evaluate(const Pstream::commsTypes)
101     if (!this->updated())
102     {
103         this->updateCoeffs();
104     }
106     fvPatchField<Type>::operator==(this->patchInternalField());
107     fvPatchField<Type>::evaluate();
111 template<class Type>
112 tmp<Field<Type> > zeroGradientFvPatchField<Type>::valueInternalCoeffs
114     const tmp<scalarField>&
115 ) const
117     return tmp<Field<Type> >
118     (
119         new Field<Type>(this->size(), pTraits<Type>::one)
120     );
124 template<class Type>
125 tmp<Field<Type> > zeroGradientFvPatchField<Type>::valueBoundaryCoeffs
127     const tmp<scalarField>&
128 ) const
130     return tmp<Field<Type> >
131     (
132         new Field<Type>(this->size(), pTraits<Type>::zero)
133     );
137 template<class Type>
138 tmp<Field<Type> > zeroGradientFvPatchField<Type>::gradientInternalCoeffs() const
140     return tmp<Field<Type> >
141     (
142         new Field<Type>(this->size(), pTraits<Type>::zero)
143     );
147 template<class Type>
148 tmp<Field<Type> > zeroGradientFvPatchField<Type>::gradientBoundaryCoeffs() const
150     return tmp<Field<Type> >
151     (
152         new Field<Type>(this->size(), pTraits<Type>::zero)
153     );
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // ************************************************************************* //