OpenFOAM logo
Open Source CFD Toolkit

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