OpenFOAM logo
Open Source CFD Toolkit

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