OpenFOAM logo
Open Source CFD Toolkit

ProcessorTetPointPatchField.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     ProcessorTetPointPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     ProcessorTetPointPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef ProcessorTetPointPatchField_H
00036 #define ProcessorTetPointPatchField_H
00037 
00038 #include "CoupledTetPointPatchField.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                  Class ProcessorTetPointPatchField Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template
00050 <
00051     template<class> class PatchField,
00052     class PointPatch,
00053     class ProcessorPointPatch,
00054     class Type
00055 >
00056 class ProcessorTetPointPatchField
00057 :
00058     public CoupledTetPointPatchField<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         ProcessorTetPointPatchField
00102         (
00103             const PointPatch&,
00104             const Field<Type>&
00105         );
00106 
00107         //- Construct from patch, internal field and dictionary
00108         ProcessorTetPointPatchField
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         ProcessorTetPointPatchField
00117         (
00118             const ProcessorTetPointPatchField
00119                 <PatchField, PointPatch, ProcessorPointPatch, Type>&,
00120             const PointPatch&,
00121             const Field<Type>&,
00122             const TetPointPatchFieldMapper&
00123         );
00124 
00125         //- Construct and return a clone
00126         virtual autoPtr<PatchField<Type> > clone() const
00127         {
00128             return autoPtr<PatchField<Type> >
00129             (
00130                 new ProcessorTetPointPatchField
00131                 <PatchField, PointPatch, ProcessorPointPatch, Type>
00132                 (
00133                     *this
00134                 )
00135             );
00136         }
00137 
00138         //- Construct as copy setting internal field reference
00139         ProcessorTetPointPatchField
00140         (
00141             const ProcessorTetPointPatchField
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 ProcessorTetPointPatchField
00152                 <PatchField, PointPatch, ProcessorPointPatch, Type>
00153                 (
00154                     *this,
00155                     iF
00156                 )
00157             );
00158         }
00159 
00160 
00161     // Destructor
00162 
00163         ~ProcessorTetPointPatchField();
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             //- Set boundary condition to matrix.  Used to save the processor
00181             //  patch off-diagonal coefficients
00182             virtual void setBoundaryCondition
00183             (
00184                 Map<constraint<Type> > &
00185             ) const;
00186 
00187 
00188         // Matrix construction (completion) functionality
00189 
00190             //- Add diagonal/source contributions
00191             virtual void initAddDiag(const scalarField&) const;
00192             virtual void initAddSource(const scalarField&) const;
00193 
00194             virtual void addDiag(scalarField&) const;
00195             virtual void addSource(scalarField&) const;
00196 
00197             //- Add upper/lower contributions
00198             virtual void initAddUpperLower(const scalarField&) const;
00199 
00200             virtual void addUpperLower(scalarField&) const;
00201 
00202             virtual void eliminateUpperLower(scalarField&) const;
00203 
00204             //- Get the cut edge coefficients in Amul order
00205             virtual tmp<scalarField> cutBouCoeffs(const lduMatrix&) const;
00206 
00207             //- Get the cut edge coefficients in Tmul order
00208             virtual tmp<scalarField> cutIntCoeffs(const lduMatrix&) const;
00209 
00210 
00211         // Coupled interface functionality
00212 
00213             //- Initialise neighbour colouring transfer
00214             virtual void initNbrColour
00215             (
00216                 const labelField&,
00217                 const bool bufferdTransfer
00218             ) const;
00219 
00220             //- Return neighbour colouring
00221             virtual tmp<labelField> nbrColour
00222             (
00223                 const labelField&
00224             ) const;
00225 
00226             //- Initialise neighbour matrix update
00227             virtual void initInterfaceMatrixUpdate
00228             (
00229                 const scalarField& psiInternal,
00230                 scalarField& result,
00231                 const lduMatrix& m,
00232                 const scalarField& coeffs,
00233                 const direction cmpt,
00234                 const bool bufferdTransfer
00235             ) const;
00236 
00237             //- Update result field based on interface functionality
00238             virtual void updateInterfaceMatrix
00239             (
00240                 const scalarField& psiInternal,
00241                 scalarField& result,
00242                 const lduMatrix& m,
00243                 const scalarField& coeffs,
00244                 const direction cmpt
00245             ) const;
00246 };
00247 
00248 
00249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00250 
00251 } // End namespace Foam
00252 
00253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00254 
00255 #ifdef NoRepository
00256 #    include "ProcessorTetPointPatchField.C"
00257 #endif
00258 
00259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00260 
00261 #endif
00262 
00263 // ************************************************************************* //
For further information go to www.openfoam.org