OpenFOAM logo
Open Source CFD Toolkit

fixedGradientFaPatchField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     fixedGradientFaPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     fixedGradientFaPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef fixedGradientFaPatchField_H
00036 #define fixedGradientFaPatchField_H
00037 
00038 #include "faPatchField.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                            Class fixedGradientFaPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class Type>
00050 class fixedGradientFaPatchField
00051 :
00052     public faPatchField<Type>
00053 {
00054     // Private data
00055 
00056         Field<Type> gradient_;
00057 
00058 public:
00059 
00060     //- Runtime type information
00061     TypeName("fixedGradient");
00062 
00063 
00064     // Constructors
00065 
00066         //- Construct from patch and internal field
00067         fixedGradientFaPatchField
00068         (
00069             const faPatch&,
00070             const Field<Type>&
00071         );
00072 
00073         //- Construct from patch, internal field and Istream
00074         fixedGradientFaPatchField
00075         (
00076             const faPatch&,
00077             const Field<Type>&,
00078             Istream&
00079         );
00080 
00081         //- Construct from patch, internal field and dictionary
00082         fixedGradientFaPatchField
00083         (
00084             const faPatch&,
00085             const Field<Type>&,
00086             const dictionary&
00087         );
00088 
00089         //- Construct by mapping the given fixedGradientFaPatchField<Type>
00090         //  onto a new patch
00091         fixedGradientFaPatchField
00092         (
00093             const fixedGradientFaPatchField<Type>&,
00094             const faPatch&,
00095             const Field<Type>&,
00096             const faPatchFieldMapper&
00097         );
00098 
00099         //- Construct and return a clone
00100         virtual tmp<faPatchField<Type> > clone() const
00101         {
00102             return tmp<faPatchField<Type> >
00103             (
00104                 new fixedGradientFaPatchField<Type>(*this)
00105             );
00106         }
00107 
00108         //- Construct as copy setting internal field reference
00109         fixedGradientFaPatchField
00110         (
00111             const fixedGradientFaPatchField<Type>&,
00112             const Field<Type>&
00113         );
00114 
00115         //- Construct and return a clone setting internal field reference
00116         virtual tmp<faPatchField<Type> > clone(const Field<Type>& iF) const
00117         {
00118             return tmp<faPatchField<Type> >
00119             (
00120                 new fixedGradientFaPatchField<Type>(*this, iF)
00121             );
00122         }
00123 
00124 
00125     // Member functions
00126 
00127         // Return defining fields
00128 
00129             //- Return gradient at boundary
00130             virtual Field<Type>& gradient()
00131             {
00132                 return gradient_;
00133             }
00134 
00135             virtual const Field<Type>& gradient() const
00136             {
00137                 return gradient_;
00138             }
00139 
00140         // Access
00141 
00142 
00143         // Evaluation functions
00144 
00145             //- Return gradient at boundary
00146             virtual tmp<Field<Type> > snGrad() const
00147             {
00148                 return gradient_;
00149             }
00150 
00151             //- Evaluate the patch field
00152             virtual void evaluate();
00153 
00154 
00155             //- Return the matrix diagonal coefficients corresponding to the
00156             //  evaluation of the value of this patchField with given weights
00157             virtual tmp<Field<Type> > valueInternalCoeffs
00158             (
00159                 const tmp<scalarField>&
00160             ) const;
00161 
00162             //- Return the matrix source coefficients corresponding to the
00163             //  evaluation of the value of this patchField with given weights
00164             virtual tmp<Field<Type> > valueBoundaryCoeffs
00165             (
00166                 const tmp<scalarField>&
00167             ) const;
00168 
00169             //- Return the matrix diagonal coefficients corresponding to the
00170             //  evaluation of the gradient of this patchField
00171             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
00172 
00173             //- Return the matrix source coefficients corresponding to the
00174             //  evaluation of the gradient of this patchField
00175             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
00176 
00177 
00178         //- Write
00179         virtual void write(Ostream&) const;
00180 
00181 
00182     // Member operators
00183 
00184         virtual void operator=(const UList<Type>&) {}
00185 
00186         virtual void operator=(const faPatchField<Type>&) {}
00187         virtual void operator+=(const faPatchField<Type>&) {}
00188         virtual void operator-=(const faPatchField<Type>&) {}
00189         virtual void operator*=(const faPatchField<scalar>&) {}
00190         virtual void operator/=(const faPatchField<scalar>&) {}
00191 
00192         virtual void operator+=(const Field<Type>&) {}
00193         virtual void operator-=(const Field<Type>&) {}
00194 
00195         virtual void operator*=(const Field<scalar>&) {}
00196         virtual void operator/=(const Field<scalar>&) {}
00197 
00198         virtual void operator=(const Type&) {}
00199         virtual void operator+=(const Type&) {}
00200         virtual void operator-=(const Type&) {}
00201         virtual void operator*=(const scalar) {}
00202         virtual void operator/=(const scalar) {}
00203 };
00204 
00205 
00206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00207 
00208 } // End namespace Foam
00209 
00210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00211 
00212 #ifdef NoRepository
00213 #   include "fixedGradientFaPatchField.C"
00214 #else
00215 #   ifdef xlC
00216 #   pragma implementation("fixedGradientFaPatchField.C")
00217 #   endif
00218 #endif
00219 
00220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00221 
00222 #endif
00223 
00224 // ************************************************************************* //
For further information go to www.openfoam.org