FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::directionMixedFvPatchField
00026 
00027 Description
00028     Foam::directionMixedFvPatchField
00029 
00030 SourceFiles
00031     directionMixedFvPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef directionMixedFvPatchField_H
00036 #define directionMixedFvPatchField_H
00037 
00038 #include <finiteVolume/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                 const Pstream::commsTypes commsType=Pstream::blocking
00199             );
00200 
00201             //- Return face-gradient transform diagonal
00202             virtual tmp<Field<Type> > snGradTransformDiag() const;
00203 
00204 
00205         //- Write
00206         virtual void write(Ostream&) const;
00207 
00208 
00209     // Member operators
00210 
00211         virtual void operator=(const fvPatchField<Type>&) {}
00212         virtual void operator+=(const fvPatchField<Type>&) {}
00213         virtual void operator-=(const fvPatchField<Type>&) {}
00214         virtual void operator*=(const fvPatchField<Type>&) {}
00215         virtual void operator/=(const fvPatchField<Type>&) {}
00216 
00217         virtual void operator=(const Field<Type>&) {}
00218         virtual void operator+=(const Field<Type>&) {}
00219         virtual void operator-=(const Field<Type>&) {}
00220         virtual void operator*=(const Field<scalar>&) {}
00221         virtual void operator/=(const Field<scalar>&) {}
00222 
00223         virtual void operator=(const Type&) {}
00224         virtual void operator+=(const Type&) {}
00225         virtual void operator-=(const Type&) {}
00226         virtual void operator*=(const scalar) {}
00227         virtual void operator/=(const scalar) {}
00228 };
00229 
00230 
00231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00232 
00233 } // End namespace Foam
00234 
00235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00236 
00237 #ifdef NoRepository
00238 #   include <finiteVolume/directionMixedFvPatchField.C>
00239 #endif
00240 
00241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00242 
00243 #endif
00244 
00245 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines