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

valuePointPatchField.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::valuePointPatchField
00026 
00027 Description
00028     Foam::valuePointPatchField
00029 
00030 SourceFiles
00031     valuePointPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef valuePointPatchField_H
00036 #define valuePointPatchField_H
00037 
00038 #include <OpenFOAM/pointPatchField.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                    Class valuePointPatchField Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class Type>
00050 class valuePointPatchField
00051 :
00052     public pointPatchField<Type>,
00053     public Field<Type>
00054 {
00055     // Private member functions
00056 
00057         void checkFieldSize() const;
00058 
00059 
00060 public:
00061 
00062     //- Runtime type information
00063     TypeName("value");
00064 
00065 
00066     // Constructors
00067 
00068         //- Construct from patch and internal field
00069         valuePointPatchField
00070         (
00071             const pointPatch&,
00072             const DimensionedField<Type, pointMesh>&
00073         );
00074 
00075         //- Construct from patch, internal field and dictionary
00076         valuePointPatchField
00077         (
00078             const pointPatch&,
00079             const DimensionedField<Type, pointMesh>&,
00080             const dictionary&,
00081             const bool valueRequired=true
00082         );
00083 
00084         //- Construct by mapping given patchField<Type> onto a new patch
00085         valuePointPatchField
00086         (
00087             const valuePointPatchField<Type>&,
00088             const pointPatch&,
00089             const DimensionedField<Type, pointMesh>&,
00090             const pointPatchFieldMapper&
00091         );
00092 
00093         //- Construct and return a clone
00094         virtual autoPtr<pointPatchField<Type> > clone() const
00095         {
00096             return autoPtr<pointPatchField<Type> >
00097             (
00098                 new valuePointPatchField<Type>
00099                 (
00100                     *this
00101                 )
00102             );
00103         }
00104 
00105         //- Construct as copy setting internal field reference
00106         valuePointPatchField
00107         (
00108             const valuePointPatchField<Type>&,
00109             const DimensionedField<Type, pointMesh>&
00110         );
00111 
00112         //- Construct and return a clone setting internal field reference
00113         virtual autoPtr<pointPatchField<Type> > clone
00114         (
00115             const DimensionedField<Type, pointMesh>& iF
00116         ) const
00117         {
00118             return autoPtr<pointPatchField<Type> >
00119             (
00120                 new valuePointPatchField<Type>
00121                 (
00122                     *this,
00123                     iF
00124                 )
00125             );
00126         }
00127 
00128 
00129     // Member functions
00130 
00131         // Access
00132 
00133             //- Return size
00134             label size() const
00135             {
00136                 return Field<Type>::size();
00137             }
00138 
00139 
00140         // Mapping functions
00141 
00142             //- Map (and resize as needed) from self given a mapping object
00143             virtual void autoMap
00144             (
00145                 const pointPatchFieldMapper&
00146             );
00147 
00148             //- Reverse map the given PointPatchField onto
00149             //  this PointPatchField
00150             virtual void rmap
00151             (
00152                 const pointPatchField<Type>&,
00153                 const labelList&
00154             );
00155 
00156 
00157         // Evaluation functions
00158 
00159             //- Update the coefficients associated with the patch field
00160             virtual void updateCoeffs();
00161 
00162             //- Evaluate the patch field
00163             virtual void evaluate
00164             (
00165                 const Pstream::commsTypes commsType=Pstream::blocking
00166             );
00167 
00168 
00169         //- Write
00170         virtual void write(Ostream&) const;
00171 
00172 
00173     // Member operators
00174 
00175         // Assignment operators
00176 
00177             virtual void operator=
00178             (
00179                 const valuePointPatchField<Type>&
00180             );
00181 
00182             virtual void operator=
00183             (
00184                 const pointPatchField<Type>&
00185             );
00186 
00187             virtual void operator=(const Field<Type>&);
00188             virtual void operator=(const Type&);
00189 
00190 
00191         // Force an assignment irrespective of form of patch
00192 
00193             virtual void operator==
00194             (
00195                 const valuePointPatchField<Type>&
00196             );
00197 
00198             virtual void operator==
00199             (
00200                 const pointPatchField<Type>&
00201             );
00202 
00203             virtual void operator==(const Field<Type>&);
00204             virtual void operator==(const Type&);
00205 };
00206 
00207 
00208 // This function is added to overide the hack in pointPatchField.H
00209 // which enables simple backward compatability with verions using
00210 // referenceLevel in GeometicField
00211 template<class Type>
00212 tmp<Field<Type> > operator+
00213 (
00214     const valuePointPatchField<Type>& vsppf,
00215     const Type& t
00216 )
00217 {
00218     return static_cast<const Field<Type>&>(vsppf) + t;
00219 }
00220 
00221 
00222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00223 
00224 } // End namespace Foam
00225 
00226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00227 
00228 #ifdef NoRepository
00229 #    include <OpenFOAM/valuePointPatchField.C>
00230 #endif
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 #endif
00235 
00236 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines