Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / basic / fixedGradient / fixedGradientFvPatchField.H
blobc816508c5f1c79103282df021725b29744e2045b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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::fixedGradientFvPatchField
28 Description
29     Foam::fixedGradientFvPatchField
31 SourceFiles
32     fixedGradientFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef fixedGradientFvPatchField_H
37 #define fixedGradientFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                     Class fixedGradientFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class fixedGradientFvPatchField
53     public fvPatchField<Type>
55     // Private data
57         Field<Type> gradient_;
60 public:
62     //- Runtime type information
63     TypeName("fixedGradient");
66     // Constructors
68         //- Construct from patch and internal field
69         fixedGradientFvPatchField
70         (
71             const fvPatch&,
72             const DimensionedField<Type, volMesh>&
73         );
75         //- Construct from patch, internal field and dictionary
76         fixedGradientFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&,
80             const dictionary&
81         );
83         //- Construct by mapping the given fixedGradientFvPatchField
84         //  onto a new patch
85         fixedGradientFvPatchField
86         (
87             const fixedGradientFvPatchField<Type>&,
88             const fvPatch&,
89             const DimensionedField<Type, volMesh>&,
90             const fvPatchFieldMapper&
91         );
93         //- Construct as copy
94         fixedGradientFvPatchField
95         (
96             const fixedGradientFvPatchField<Type>&
97         );
99         //- Construct and return a clone
100         virtual tmp<fvPatchField<Type> > clone() const
101         {
102             return tmp<fvPatchField<Type> >
103             (
104                 new fixedGradientFvPatchField<Type>(*this)
105             );
106         }
108         //- Construct as copy setting internal field reference
109         fixedGradientFvPatchField
110         (
111             const fixedGradientFvPatchField<Type>&,
112             const DimensionedField<Type, volMesh>&
113         );
115         //- Construct and return a clone setting internal field reference
116         virtual tmp<fvPatchField<Type> > clone
117         (
118             const DimensionedField<Type, volMesh>& iF
119         ) const
120         {
121             return tmp<fvPatchField<Type> >
122             (
123                 new fixedGradientFvPatchField<Type>(*this, iF)
124             );
125         }
128     // Member functions
130         // Return defining fields
132             //- Return gradient at boundary
133             virtual Field<Type>& gradient()
134             {
135                 return gradient_;
136             }
138             virtual const Field<Type>& gradient() const
139             {
140                 return gradient_;
141             }
144         // Mapping functions
146             //- Map (and resize as needed) from self given a mapping object
147             virtual void autoMap
148             (
149                 const fvPatchFieldMapper&
150             );
152             //- Reverse map the given fvPatchField onto this fvPatchField
153             virtual void rmap
154             (
155                 const fvPatchField<Type>&,
156                 const labelList&
157             );
160         // Evaluation functions
162             //- Return gradient at boundary
163             virtual tmp<Field<Type> > snGrad() const
164             {
165                 return gradient_;
166             }
168             //- Evaluate the patch field
169             virtual void evaluate
170             (
171                 const Pstream::commsTypes commsType=Pstream::blocking
172             );
174             //- Return the matrix diagonal coefficients corresponding to the
175             //  evaluation of the value of this patchField with given weights
176             virtual tmp<Field<Type> > valueInternalCoeffs
177             (
178                 const tmp<scalarField>&
179             ) const;
181             //- Return the matrix source coefficients corresponding to the
182             //  evaluation of the value of this patchField with given weights
183             virtual tmp<Field<Type> > valueBoundaryCoeffs
184             (
185                 const tmp<scalarField>&
186             ) const;
188             //- Return the matrix diagonal coefficients corresponding to the
189             //  evaluation of the gradient of this patchField
190             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
192             //- Return the matrix source coefficients corresponding to the
193             //  evaluation of the gradient of this patchField
194             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
197         //- Write
198         virtual void write(Ostream&) const;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #ifdef NoRepository
209 #   include "fixedGradientFvPatchField.C"
210 #endif
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #endif
216 // ************************************************************************* //