OpenFOAM logo
Open Source CFD Toolkit

GlobalProcessorTetPointPatchField.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     GlobalProcessorTetPointPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     GlobalProcessorTetPointPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef GlobalProcessorTetPointPatchField_H
00036 #define GlobalProcessorTetPointPatchField_H
00037 
00038 #include "CoupledTetPointPatchField.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                 Class GlobalProcessorTetPointPatchField Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template
00050 <
00051     template<class> class PatchField,
00052     class PointPatch,
00053     class GlobalProcessorPointPatch,
00054     class Type
00055 >
00056 class GlobalProcessorTetPointPatchField
00057 :
00058     public CoupledTetPointPatchField<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         GlobalProcessorTetPointPatchField
00089         (
00090             const PointPatch&,
00091             const Field<Type>&
00092         );
00093 
00094         //- Construct from patch, internal field and dictionary
00095         GlobalProcessorTetPointPatchField
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         GlobalProcessorTetPointPatchField
00104         (
00105             const GlobalProcessorTetPointPatchField
00106                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>&,
00107             const PointPatch&,
00108             const Field<Type>&,
00109             const TetPointPatchFieldMapper&
00110         );
00111 
00112         //- Construct and return a clone
00113         virtual autoPtr<PatchField<Type> > clone() const
00114         {
00115             return autoPtr<PatchField<Type> >
00116             (
00117                 new GlobalProcessorTetPointPatchField
00118                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>
00119                 (
00120                     *this
00121                 )
00122             );
00123         }
00124 
00125         //- Construct as copy setting internal field reference
00126         GlobalProcessorTetPointPatchField
00127         (
00128             const GlobalProcessorTetPointPatchField
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 GlobalProcessorTetPointPatchField
00139                 <PatchField, PointPatch, GlobalProcessorPointPatch, Type>
00140                 (
00141                     *this,
00142                     iF
00143                 )
00144             );
00145         }
00146 
00147 
00148     // Destructor
00149 
00150         ~GlobalProcessorTetPointPatchField();
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             //- Set boundary condition to matrix.  Used to save the processor
00165             //  patch off-diagonal coefficients
00166             virtual void setBoundaryCondition
00167             (
00168                 Map<constraint<Type> > &
00169             ) const;
00170 
00171         // Matrix construction (completion) functionality
00172 
00173             virtual void addDiag(scalarField&) const;
00174             virtual void addSource(scalarField&) const;
00175 
00176             //- Add upper/lower contributions
00177             virtual void addUpperLower(scalarField&) const;
00178 
00179             virtual void eliminateUpperLower(scalarField&) const;
00180 
00181             //- Get the cut edge coefficients in Amul order
00182             virtual tmp<scalarField> cutBouCoeffs(const lduMatrix&) const;
00183 
00184             //- Get the cut edge coefficients in Tmul order
00185             virtual tmp<scalarField> cutIntCoeffs(const lduMatrix&) const;
00186 
00187 
00188         // Coupled interface functionality
00189 
00190             //- Return neighbour colouring
00191             virtual tmp<labelField> nbrColour
00192             (
00193                 const labelField&
00194             ) const;
00195 
00196             //- Update result field based on interface functionality
00197             virtual void updateInterfaceMatrix
00198             (
00199                 const scalarField& psiInternal,
00200                 scalarField& result,
00201                 const lduMatrix& m,
00202                 const scalarField& coeffs,
00203                 const direction cmpt
00204             ) const;
00205 
00206 };
00207 
00208 
00209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00210 
00211 } // End namespace Foam
00212 
00213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00214 
00215 #ifdef NoRepository
00216 #    include "GlobalProcessorTetPointPatchField.C"
00217 #endif
00218 
00219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00220 
00221 #endif
00222 
00223 // ************************************************************************* //
For further information go to www.openfoam.org