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

mixedPointPatchField.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::mixedPointPatchField
00026 
00027 Description
00028     A mixed FixedValue / ZeroGradient boundary condition for pointField.
00029 
00030     I am still not sure how to do the FixedValue-fixedGradient combination.
00031 
00032 SourceFiles
00033     mixedPointPatchField.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef mixedPointPatchField_H
00038 #define mixedPointPatchField_H
00039 
00040 #include <OpenFOAM/valuePointPatchField.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                       Class mixedPointPatchField Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class mixedPointPatchField
00053 :
00054     public valuePointPatchField<Type>
00055 {
00056     // Private data
00057 
00058         //- Value field
00059         Field<Type> refValue_;
00060 
00061         //- Fraction (0-1) of value used for boundary condition
00062         scalarField valueFraction_;
00063 
00064 
00065     // Private member functions
00066 
00067         void checkFieldSize() const;
00068 
00069 
00070 public:
00071 
00072     //- Runtime type information
00073     TypeName("mixed");
00074 
00075 
00076     // Constructors
00077 
00078         //- Construct from patch and internal field
00079         mixedPointPatchField
00080         (
00081             const pointPatch&,
00082             const DimensionedField<Type, pointMesh>&
00083         );
00084 
00085         //- Construct from patch, internal field and dictionary
00086         mixedPointPatchField
00087         (
00088             const pointPatch&,
00089             const DimensionedField<Type, pointMesh>&,
00090             const dictionary&
00091         );
00092 
00093         //- Construct by mapping given patchField<Type> onto a new patch
00094         mixedPointPatchField
00095         (
00096             const mixedPointPatchField<Type>&,
00097             const pointPatch&,
00098             const DimensionedField<Type, pointMesh>&,
00099             const pointPatchFieldMapper&
00100         );
00101 
00102         //- Construct and return a clone
00103         virtual autoPtr<pointPatchField<Type> > clone() const
00104         {
00105             return autoPtr<pointPatchField<Type> >
00106             (
00107                 new mixedPointPatchField<Type>
00108                 (
00109                     *this
00110                 )
00111             );
00112         }
00113 
00114         //- Construct as copy setting internal field reference
00115         mixedPointPatchField
00116         (
00117             const mixedPointPatchField<Type>&,
00118             const DimensionedField<Type, pointMesh>&
00119         );
00120 
00121         //- Construct and return a clone setting internal field reference
00122         virtual autoPtr<pointPatchField<Type> > clone
00123         (
00124             const DimensionedField<Type, pointMesh>& iF
00125         ) const
00126         {
00127             return autoPtr<pointPatchField<Type> >
00128             (
00129                 new mixedPointPatchField<Type>
00130                 (
00131                     *this,
00132                     iF
00133                 )
00134             );
00135         }
00136 
00137 
00138     // Member functions
00139 
00140         // Return defining fields
00141 
00142             virtual Field<Type>& refValue()
00143             {
00144                 return refValue_;
00145             }
00146 
00147             virtual const Field<Type>& refValue() const
00148             {
00149                 return refValue_;
00150             }
00151 
00152             virtual scalarField& valueFraction()
00153             {
00154                 return valueFraction_;
00155             }
00156 
00157             virtual const scalarField& valueFraction() const
00158             {
00159                 return valueFraction_;
00160             }
00161 
00162 
00163         // Mapping functions
00164 
00165             //- Map (and resize as needed) from self given a mapping object
00166             virtual void autoMap
00167             (
00168                 const pointPatchFieldMapper&
00169             );
00170 
00171             //- Reverse map the given PointPatchField onto
00172             //  this PointPatchField
00173             virtual void rmap
00174             (
00175                 const pointPatchField<Type>&,
00176                 const labelList&
00177             );
00178 
00179 
00180         // Evaluation functions
00181 
00182             //- Update the patch field
00183             virtual void evaluate
00184             (
00185                 const Pstream::commsTypes commsType=Pstream::blocking
00186             );
00187 
00188 
00189         //- Write
00190         virtual void write(Ostream&) const;
00191 };
00192 
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 } // End namespace Foam
00197 
00198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00199 
00200 #ifdef NoRepository
00201 #    include <OpenFOAM/mixedPointPatchField.C>
00202 #endif
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 #endif
00207 
00208 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines