OpenFOAM logo
Open Source CFD Toolkit

processorAmgCoupledInterface.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     processorAmgCoupledInterface
00027 
00028 Description
00029 
00030 SourceFiles
00031     processorAmgCoupledInterface.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef processorAmgCoupledInterface_H
00036 #define processorAmgCoupledInterface_H
00037 
00038 #include "amgCoupledInterface.H"
00039 #include "processorLduCoupledInterface.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                   Class processorAmgCoupledInterface Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class processorAmgCoupledInterface
00051 :
00052     public amgCoupledInterface,
00053     virtual public processorLduCoupledInterface
00054 {
00055     // Private data
00056 
00057         //- Local processor number
00058         int myProcNo_;
00059 
00060         //- Neighbour processor number
00061         int neighbProcNo_;
00062 
00063         //- Is the transform required
00064         bool doTransform_;
00065 
00066         // Face transformation tensor
00067         tensorField forwardT_;
00068 
00069         //- Rank of component for transformation
00070         int rank_;
00071 
00072         //- Pointer to addressing
00073         mutable labelField* addrPtr_;
00074 
00075 
00076     // Private Member Functions
00077 
00078         //- Disallow default bitwise copy construct
00079         processorAmgCoupledInterface(const processorAmgCoupledInterface&);
00080 
00081         //- Disallow default bitwise assignment
00082         void operator=(const processorAmgCoupledInterface&);
00083 
00084         //- Assemble a patch internal field
00085         template<class Type>
00086         tmp<Field<Type> > patchInternalField(const Field<Type>& iF) const;
00087     
00088 
00089 public:
00090 
00091     //- Runtime type information
00092     TypeName("processor");
00093 
00094     // Constructors
00095 
00096         //- Construct from coupled interface
00097         processorAmgCoupledInterface
00098         (
00099             const lduCoupledInterface* fineInterfacePtr,
00100             const label index
00101         );
00102 
00103 
00104     // Destructor
00105 
00106         virtual ~processorAmgCoupledInterface();
00107 
00108 
00109     // Member Functions
00110 
00111         // Access
00112 
00113             //- Return true if this patch field is coupled
00114             virtual bool coupled() const
00115             {
00116                 return true;
00117             }
00118 
00119             //- Return size
00120             label size() const;
00121 
00122             //- Initialise neighbour colouring transfer
00123             virtual void initNbrColour(const labelField&, const bool) const;
00124 
00125             //- Return neighbour colouring
00126             virtual tmp<labelField> nbrColour
00127             (
00128                 const labelField&
00129             ) const;
00130 
00131             //- Given colouring for both sides, return coarse level coefficients
00132             //  Because of the algorithmic complexity, this also
00133             //  calculates the addressing.  
00134             virtual tmp<scalarField> coeffs
00135             (
00136                 const labelField& localColour,
00137                 const labelField& nbrColour,
00138                 const scalarField& fineCoeffs
00139             ) const;
00140 
00141             //- Return addressing
00142             virtual const labelField& addressing() const;
00143 
00144 
00145         // Interface matrix update
00146 
00147             //- Initialise neighbour matrix update
00148             virtual void initInterfaceMatrixUpdate
00149             (
00150                 const scalarField& psiInternal,
00151                 scalarField& result,
00152                 const lduMatrix& m,
00153                 const scalarField& coeffs,
00154                 const direction cmpt,
00155                 const bool bufferedTransfer
00156             ) const;
00157 
00158             //- Update result field based on interface functionality
00159             virtual void updateInterfaceMatrix
00160             (
00161                 const scalarField& psiInternal,
00162                 scalarField& result,
00163                 const lduMatrix&,
00164                 const scalarField& coeffs,
00165                 const direction cmpt
00166             ) const;
00167 
00168 
00169         //- Processor coupled interface functions
00170 
00171             //- Return processor number
00172             virtual int myProcNo() const
00173             {
00174                 return myProcNo_;
00175             }
00176 
00177             //- Return neigbour processor number
00178             virtual int neighbProcNo() const
00179             {
00180                 return neighbProcNo_;
00181             }
00182 
00183             //- Does the patch field perform the transfromation
00184             virtual bool doTransform() const
00185             {
00186                 return doTransform_;
00187             }
00188 
00189             //- Return face transformation tensor
00190             virtual const tensorField& forwardT() const
00191             {
00192                 return forwardT_;
00193             }
00194 
00195             //- Return rank of component for transform
00196             virtual int rank() const
00197             {
00198                 return rank_;
00199             }
00200 };
00201 
00202 
00203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00204 
00205 } // End namespace Foam
00206 
00207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00208 
00209 #endif
00210 
00211 // ************************************************************************* //
For further information go to www.openfoam.org