1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
26 Foam::fixedGradientFvPatchField
29 Foam::fixedGradientFvPatchField
32 fixedGradientFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef fixedGradientFvPatchField_H
37 #define fixedGradientFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class fixedGradientFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
51 class fixedGradientFvPatchField
53 public fvPatchField<Type>
57 Field<Type> gradient_;
62 //- Runtime type information
63 TypeName("fixedGradient");
68 //- Construct from patch and internal field
69 fixedGradientFvPatchField
72 const DimensionedField<Type, volMesh>&
75 //- Construct from patch, internal field and dictionary
76 fixedGradientFvPatchField
79 const DimensionedField<Type, volMesh>&,
83 //- Construct by mapping the given fixedGradientFvPatchField
85 fixedGradientFvPatchField
87 const fixedGradientFvPatchField<Type>&,
89 const DimensionedField<Type, volMesh>&,
90 const fvPatchFieldMapper&
94 fixedGradientFvPatchField
96 const fixedGradientFvPatchField<Type>&
99 //- Construct and return a clone
100 virtual tmp<fvPatchField<Type> > clone() const
102 return tmp<fvPatchField<Type> >
104 new fixedGradientFvPatchField<Type>(*this)
108 //- Construct as copy setting internal field reference
109 fixedGradientFvPatchField
111 const fixedGradientFvPatchField<Type>&,
112 const DimensionedField<Type, volMesh>&
115 //- Construct and return a clone setting internal field reference
116 virtual tmp<fvPatchField<Type> > clone
118 const DimensionedField<Type, volMesh>& iF
121 return tmp<fvPatchField<Type> >
123 new fixedGradientFvPatchField<Type>(*this, iF)
130 // Return defining fields
132 //- Return gradient at boundary
133 virtual Field<Type>& gradient()
138 virtual const Field<Type>& gradient() const
146 //- Map (and resize as needed) from self given a mapping object
149 const fvPatchFieldMapper&
152 //- Reverse map the given fvPatchField onto this fvPatchField
155 const fvPatchField<Type>&,
160 // Evaluation functions
162 //- Return gradient at boundary
163 virtual tmp<Field<Type> > snGrad() const
168 //- Evaluate the patch field
169 virtual void evaluate
171 const Pstream::commsTypes commsType=Pstream::blocking
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
178 const tmp<scalarField>&
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
185 const tmp<scalarField>&
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;
198 virtual void write(Ostream&) const;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 # include "fixedGradientFvPatchField.C"
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 // ************************************************************************* //