OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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