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