Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / OpenFOAM / matrices / lduMatrix / solvers / GAMG / interfaces / cyclicGAMGInterface / cyclicGAMGInterface.H
bloba20f5671fa24ec05f8fef3523244515acf8dbfab
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::cyclicGAMGInterface
27 Description
28     GAMG agglomerated cyclic interface.
30 SourceFiles
31     cyclicGAMGInterface.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef cyclicGAMGInterface_H
36 #define cyclicGAMGInterface_H
38 #include "GAMGInterface.H"
39 #include "cyclicLduInterface.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                   Class cyclicGAMGInterface Declaration
48 \*---------------------------------------------------------------------------*/
50 class cyclicGAMGInterface
52     public GAMGInterface,
53     virtual public cyclicLduInterface
55     // Private data
57         //- Reference tor the cyclicLduInterface from which this is
58         //  agglomerated
59         const cyclicLduInterface& fineCyclicInterface_;
62     // Private Member Functions
64         //- Disallow default bitwise copy construct
65         cyclicGAMGInterface(const cyclicGAMGInterface&);
67         //- Disallow default bitwise assignment
68         void operator=(const cyclicGAMGInterface&);
71 public:
73     //- Runtime type information
74     TypeName("cyclic");
77     // Constructors
79         //- Construct from fine level interface,
80         //  local and neighbour restrict addressing
81         cyclicGAMGInterface
82         (
83             const label index,
84             const lduInterfacePtrsList& coarseInterfaces,
85             const lduInterface& fineInterface,
86             const labelField& restrictAddressing,
87             const labelField& neighbourRestrictAddressing
88         );
91     //- Destructor
92     virtual ~cyclicGAMGInterface();
95     // Member Functions
97         // Interface transfer functions
99             //- Transfer and return internal field adjacent to the interface
100             virtual tmp<labelField> internalFieldTransfer
101             (
102                 const Pstream::commsTypes commsType,
103                 const labelUList& iF
104             ) const;
107         //- Cyclic interface functions
109             //- Return neigbour processor number
110             virtual label neighbPatchID() const
111             {
112                 return fineCyclicInterface_.neighbPatchID();
113             }
115             virtual bool owner() const
116             {
117                 return fineCyclicInterface_.owner();
118             }
120             virtual const cyclicGAMGInterface& neighbPatch() const
121             {
122                 return dynamic_cast<const cyclicGAMGInterface&>
123                 (
124                     coarseInterfaces_[neighbPatchID()]
125                 );
126             }
128             //- Return face transformation tensor
129             virtual const tensorField& forwardT() const
130             {
131                 return fineCyclicInterface_.forwardT();
132             }
134             //- Return neighbour-cell transformation tensor
135             virtual const tensorField& reverseT() const
136             {
137                 return fineCyclicInterface_.reverseT();
138             }
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 } // End namespace Foam
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 #endif
150 // ************************************************************************* //