OpenFOAM logo
Open Source CFD Toolkit

GlobalProcessorPointPatchField.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-2005 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     GlobalProcessorPointPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     GlobalProcessorPointPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef GlobalProcessorPointPatchField_H
00036 #define GlobalProcessorPointPatchField_H
00037 
00038 #include "CoupledPointPatchField.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                 Class GlobalProcessorPointPatchField Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template
00050 <
00051     template<class> class PatchField,
00052     class PointPatch,
00053     class GlobalProcessorPointPatch,
00054     class Type
00055 >
00056 class GlobalProcessorPointPatchField
00057 :
00058     public CoupledPointPatchField<PatchField, PointPatch, Type>
00059 {
00060     // Private data
00061 
00062         //- Local reference to processorPoint patch
00063         const GlobalProcessorPointPatch& procPatch_;
00064 
00065 
00066     // Private member functions
00067 
00068         //- Reduce the field and extract the local values
00069         template<class Type2>
00070         tmp<Field<Type2> > reduceExtractPoint(const tmp<Field<Type2> >&) const;
00071 
00072         template<class Type2>
00073         tmp<Field<Type2> > reduceExtractEdge(const tmp<Field<Type2> >&) const;
00074 
00075         template<class Type2>
00076         void addFieldTempl(Field<Type2>&) const;
00077 
00078 
00079 public:
00080 
00081     //- Runtime type information
00082     TypeName("globalProcessor");
00083 
00084 
00085     // Constructors
00086 
00087         //- Construct from patch and internal field
00088         GlobalProcessorPointPatchField
00089         (
00090             const PointPatch&,
00091             const Field<Type>&
00092         );
00093 
00094         //- Construct from patch, internal field and dictionary
00095         GlobalProcessorPointPatchField
00096         (
00097             const PointPatch&,
00098             const Field<Type>&,
00099             const dictionary&
00100         );
00101 
00102         //- Construct by mapping given patchField<Type> onto a new patch
00103         GlobalProcessorPointPatchField
00104         (
00105             const GlobalProcessorPointPatchField
00106                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>&,
00107             const PointPatch&,
00108             const Field<Type>&,
00109             const PointPatchFieldMapper&
00110         );
00111 
00112         //- Construct and return a clone
00113         virtual autoPtr<PatchField<Type> > clone() const
00114         {
00115             return autoPtr<PatchField<Type> >
00116             (
00117                 new GlobalProcessorPointPatchField
00118                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>
00119                 (
00120                     *this
00121                 )
00122             );
00123         }
00124 
00125         //- Construct as copy setting internal field reference
00126         GlobalProcessorPointPatchField
00127         (
00128             const GlobalProcessorPointPatchField
00129                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>&,
00130             const Field<Type>&
00131         );
00132 
00133         //- Construct and return a clone setting internal field reference
00134         virtual autoPtr<PatchField<Type> > clone(const Field<Type>& iF) const
00135         {
00136             return autoPtr<PatchField<Type> >
00137             (
00138                 new GlobalProcessorPointPatchField
00139                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>
00140                 (
00141                     *this,
00142                     iF
00143                 )
00144             );
00145         }
00146 
00147 
00148     // Destructor
00149 
00150         ~GlobalProcessorPointPatchField();
00151 
00152 
00153     // Member functions
00154 
00155         // Access
00156 
00157             //- Evaluate the patch field
00158             virtual void evaluate()
00159             {}
00160 
00161             //- Add field to internal field
00162             virtual void addField(Field<Type>&) const;
00163 };
00164 
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 } // End namespace Foam
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #ifdef NoRepository
00173 #    include "GlobalProcessorPointPatchField.C"
00174 #endif
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 #endif
00179 
00180 // ************************************************************************* //
For further information go to www.openfoam.org