1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::fixedGradientFvPatchField
28 Foam::fixedGradientFvPatchField
31 fixedGradientFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fixedGradientFvPatchField_H
36 #define fixedGradientFvPatchField_H
38 #include "fvPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class fixedGradientFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
50 class fixedGradientFvPatchField
52 public fvPatchField<Type>
56 Field<Type> gradient_;
61 //- Runtime type information
62 TypeName("fixedGradient");
67 //- Construct from patch and internal field
68 fixedGradientFvPatchField
71 const DimensionedField<Type, volMesh>&
74 //- Construct from patch, internal field and dictionary
75 fixedGradientFvPatchField
78 const DimensionedField<Type, volMesh>&,
82 //- Construct by mapping the given fixedGradientFvPatchField
84 fixedGradientFvPatchField
86 const fixedGradientFvPatchField<Type>&,
88 const DimensionedField<Type, volMesh>&,
89 const fvPatchFieldMapper&
93 fixedGradientFvPatchField
95 const fixedGradientFvPatchField<Type>&
98 //- Construct and return a clone
99 virtual tmp<fvPatchField<Type> > clone() const
101 return tmp<fvPatchField<Type> >
103 new fixedGradientFvPatchField<Type>(*this)
107 //- Construct as copy setting internal field reference
108 fixedGradientFvPatchField
110 const fixedGradientFvPatchField<Type>&,
111 const DimensionedField<Type, volMesh>&
114 //- Construct and return a clone setting internal field reference
115 virtual tmp<fvPatchField<Type> > clone
117 const DimensionedField<Type, volMesh>& iF
120 return tmp<fvPatchField<Type> >
122 new fixedGradientFvPatchField<Type>(*this, iF)
129 // Return defining fields
131 //- Return gradient at boundary
132 virtual Field<Type>& gradient()
137 virtual const Field<Type>& gradient() const
145 //- Map (and resize as needed) from self given a mapping object
148 const fvPatchFieldMapper&
151 //- Reverse map the given fvPatchField onto this fvPatchField
154 const fvPatchField<Type>&,
159 // Evaluation functions
161 //- Return gradient at boundary
162 virtual tmp<Field<Type> > snGrad() const
167 //- Evaluate the patch field
168 virtual void evaluate
170 const Pstream::commsTypes commsType=Pstream::blocking
173 //- Return the matrix diagonal coefficients corresponding to the
174 // evaluation of the value of this patchField with given weights
175 virtual tmp<Field<Type> > valueInternalCoeffs
177 const tmp<scalarField>&
180 //- Return the matrix source coefficients corresponding to the
181 // evaluation of the value of this patchField with given weights
182 virtual tmp<Field<Type> > valueBoundaryCoeffs
184 const tmp<scalarField>&
187 //- Return the matrix diagonal coefficients corresponding to the
188 // evaluation of the gradient of this patchField
189 virtual tmp<Field<Type> > gradientInternalCoeffs() const;
191 //- Return the matrix source coefficients corresponding to the
192 // evaluation of the gradient of this patchField
193 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
197 virtual void write(Ostream&) const;
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 # include "fixedGradientFvPatchField.C"
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 // ************************************************************************* //