OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

directionMixedFvPatchField.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-2007 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     directionMixedFvPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     directionMixedFvPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef directionMixedFvPatchField_H
00036 #define directionMixedFvPatchField_H
00037 
00038 #include "transformFvPatchField.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                       Class directionMixedFvPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class Type>
00050 class directionMixedFvPatchField
00051 :
00052     public transformFvPatchField<Type>
00053 {
00054     // Private data
00055 
00056         //- Value field
00057         Field<Type> refValue_;
00058 
00059         //- Normal gradient field
00060         Field<Type> refGrad_;
00061 
00062         //- Fraction (0-1) of value used for boundary condition
00063         symmTensorField valueFraction_;
00064 
00065 
00066 public:
00067 
00068     //- Runtime type information
00069     TypeName("directionMixed");
00070 
00071 
00072     // Constructors
00073 
00074         //- Construct from patch and internal field
00075         directionMixedFvPatchField
00076         (
00077             const fvPatch&,
00078             const DimensionedField<Type, volMesh>&
00079         );
00080 
00081         //- Construct from patch, internal field and dictionary
00082         directionMixedFvPatchField
00083         (
00084             const fvPatch&,
00085             const DimensionedField<Type, volMesh>&,
00086             const dictionary&
00087         );
00088 
00089         //- Construct by mapping given directionMixedFvPatchField onto
00090         //  a new patch
00091         directionMixedFvPatchField
00092         (
00093             const directionMixedFvPatchField<Type>&,
00094             const fvPatch&,
00095             const DimensionedField<Type, volMesh>&,
00096             const fvPatchFieldMapper&
00097         );
00098 
00099         //- Construct and return a clone
00100         virtual tmp<fvPatchField<Type> > clone() const
00101         {
00102             return tmp<fvPatchField<Type> >
00103             (
00104                 new directionMixedFvPatchField<Type>(*this)
00105             );
00106         }
00107 
00108         //- Construct as copy setting internal field reference
00109         directionMixedFvPatchField
00110         (
00111             const directionMixedFvPatchField<Type>&,
00112             const DimensionedField<Type, volMesh>&
00113         );
00114 
00115         //- Construct and return a clone setting internal field reference
00116         virtual tmp<fvPatchField<Type> > clone
00117         (
00118             const DimensionedField<Type, volMesh>& iF
00119         ) const
00120         {
00121             return tmp<fvPatchField<Type> >
00122             (
00123                 new directionMixedFvPatchField<Type>(*this, iF)
00124             );
00125         }
00126 
00127 
00128     // Member functions
00129 
00130         // Access
00131 
00132             //- Return true if this patch field fixes a value.
00133             //  Needed to check if a level has to be specified while solving
00134             //  Poissons equations.
00135             virtual bool fixesValue() const
00136             {
00137                 return true;
00138             }
00139 
00140 
00141         // Mapping functions
00142 
00143             //- Map (and resize as needed) from self given a mapping object
00144             virtual void autoMap
00145             (
00146                 const fvPatchFieldMapper&
00147             );
00148 
00149             //- Reverse map the given fvPatchField onto this fvPatchField
00150             virtual void rmap
00151             (
00152                 const fvPatchField<Type>&,
00153                 const labelList&
00154             );
00155 
00156 
00157         // Return defining fields
00158 
00159             virtual Field<Type>& refValue()
00160             {
00161                 return refValue_;
00162             }
00163 
00164             virtual const Field<Type>& refValue() const
00165             {
00166                 return refValue_;
00167             }
00168 
00169             virtual Field<Type>& refGrad()
00170             {
00171                 return refGrad_;
00172             }
00173 
00174             virtual const Field<Type>& refGrad() const
00175             {
00176                 return refGrad_;
00177             }
00178 
00179             virtual symmTensorField& valueFraction()
00180             {
00181                 return valueFraction_;
00182             }
00183 
00184             virtual const symmTensorField& valueFraction() const
00185             {
00186                 return valueFraction_;
00187             }
00188 
00189 
00190         // Evaluation functions
00191 
00192             //- Return gradient at boundary
00193             virtual tmp<Field<Type> > snGrad() const;
00194 
00195             //- Evaluate the patch field
00196             virtual void evaluate();
00197 
00198             //- Return face-gradient transform diagonal
00199             virtual tmp<Field<Type> > snGradTransformDiag() const;
00200 
00201 
00202         //- Write
00203         virtual void write(Ostream&) const;
00204 
00205 
00206     // Member operators
00207 
00208         virtual void operator=(const fvPatchField<Type>&) {}
00209         virtual void operator+=(const fvPatchField<Type>&) {}
00210         virtual void operator-=(const fvPatchField<Type>&) {}
00211         virtual void operator*=(const fvPatchField<Type>&) {}
00212         virtual void operator/=(const fvPatchField<Type>&) {}
00213 
00214         virtual void operator=(const Field<Type>&) {}
00215         virtual void operator+=(const Field<Type>&) {}
00216         virtual void operator-=(const Field<Type>&) {}
00217         virtual void operator*=(const Field<scalar>&) {}
00218         virtual void operator/=(const Field<scalar>&) {}
00219 
00220         virtual void operator=(const Type&) {}
00221         virtual void operator+=(const Type&) {}
00222         virtual void operator-=(const Type&) {}
00223         virtual void operator*=(const scalar) {}
00224         virtual void operator/=(const scalar) {}
00225 };
00226 
00227 
00228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00229 
00230 } // End namespace Foam
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 #ifdef NoRepository
00235 #   include "directionMixedFvPatchField.C"
00236 #endif
00237 
00238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00239 
00240 #endif
00241 
00242 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd