initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / zeroGradient / zeroGradientFvPatchField.H
blob59c7b7f568a12a6e14f9b73748562d8bc89c5562
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 Class
26     Foam::zeroGradientFvPatchField
28 Description
29     Foam::zeroGradientFvPatchField
31 SourceFiles
32     zeroGradientFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef zeroGradientFvPatchField_H
37 #define zeroGradientFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                       Class zeroGradientFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class zeroGradientFvPatchField
53     public fvPatchField<Type>
56 public:
58     //- Runtime type information
59     TypeName("zeroGradient");
62     // Constructors
64         //- Construct from patch and internal field
65         zeroGradientFvPatchField
66         (
67             const fvPatch&,
68             const DimensionedField<Type, volMesh>&
69         );
71         //- Construct from patch, internal field and dictionary
72         zeroGradientFvPatchField
73         (
74             const fvPatch&,
75             const DimensionedField<Type, volMesh>&,
76             const dictionary&
77         );
79         //- Construct by mapping the given zeroGradientFvPatchField<Type>
80         //  onto a new patch
81         zeroGradientFvPatchField
82         (
83             const zeroGradientFvPatchField<Type>&,
84             const fvPatch&,
85             const DimensionedField<Type, volMesh>&,
86             const fvPatchFieldMapper&
87         );
89         //- Construct as copy
90         zeroGradientFvPatchField
91         (
92             const zeroGradientFvPatchField<Type>&
93         );
95         //- Construct and return a clone
96         virtual tmp<fvPatchField<Type> > clone() const
97         {
98             return tmp<fvPatchField<Type> >
99             (
100                 new zeroGradientFvPatchField<Type>(*this)
101             );
102         }
104         //- Construct as copy setting internal field reference
105         zeroGradientFvPatchField
106         (
107             const zeroGradientFvPatchField<Type>&,
108             const DimensionedField<Type, volMesh>&
109         );
111         //- Construct and return a clone setting internal field reference
112         virtual tmp<fvPatchField<Type> > clone
113         (
114             const DimensionedField<Type, volMesh>& iF
115         ) const
116         {
117             return tmp<fvPatchField<Type> >
118             (
119                 new zeroGradientFvPatchField<Type>(*this, iF)
120             );
121         }
124     // Member functions
126         // Evaluation functions
128             //- Return gradient at boundary
129             virtual tmp<Field<Type> > snGrad() const
130             {
131                 return tmp<Field<Type> >
132                 (
133                     new Field<Type>(this->size(), pTraits<Type>::zero)
134                 );
135             }
137             //- Evaluate the patch field
138             virtual void evaluate
139             (
140                 const Pstream::commsTypes commsType=Pstream::blocking
141             );
143             //- Return the matrix diagonal coefficients corresponding to the
144             //  evaluation of the value of this patchField with given weights
145             virtual tmp<Field<Type> > valueInternalCoeffs
146             (
147                 const tmp<scalarField>&
148             ) const;
150             //- Return the matrix source coefficients corresponding to the
151             //  evaluation of the value of this patchField with given weights
152             virtual tmp<Field<Type> > valueBoundaryCoeffs
153             (
154                 const tmp<scalarField>&
155             ) const;
157             //- Return the matrix diagonal coefficients corresponding to the
158             //  evaluation of the gradient of this patchField
159             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
161             //- Return the matrix source coefficients corresponding to the
162             //  evaluation of the gradient of this patchField
163             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #ifdef NoRepository
174 #   include "zeroGradientFvPatchField.C"
175 #endif
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #endif
181 // ************************************************************************* //