initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / matrices / lduMatrix / solvers / GAMG / interfaceFields / processorGAMGInterfaceField / processorGAMGInterfaceField.H
bloba39de1c764b1312e94fae5ba59f00d1f58f49d4d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::processorGAMGInterfaceField
28 Description
29     GAMG agglomerated processor interface field.
31 SourceFiles
32     processorGAMGInterfaceField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef processorGAMGInterfaceField_H
37 #define processorGAMGInterfaceField_H
39 #include "GAMGInterfaceField.H"
40 #include "processorGAMGInterface.H"
41 #include "processorLduInterfaceField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                   Class processorGAMGInterfaceField Declaration
50 \*---------------------------------------------------------------------------*/
52 class processorGAMGInterfaceField
54     public GAMGInterfaceField,
55     public processorLduInterfaceField
57     // Private data
59         //- Local reference cast into the processor interface
60         const processorGAMGInterface& procInterface_;
62         //- Is the transform required
63         bool doTransform_;
65         //- Rank of component for transformation
66         int rank_;
69     // Private Member Functions
71         //- Disallow default bitwise copy construct
72         processorGAMGInterfaceField(const processorGAMGInterfaceField&);
74         //- Disallow default bitwise assignment
75         void operator=(const processorGAMGInterfaceField&);
78 public:
80     //- Runtime type information
81     TypeName("processor");
84     // Constructors
86         //- Construct from GAMG interface and fine level interface field
87         processorGAMGInterfaceField
88         (
89             const GAMGInterface& GAMGCp,
90             const lduInterfaceField& fineInterface
91         );
94     // Destructor
96         virtual ~processorGAMGInterfaceField();
99     // Member Functions
101         // Access
103             //- Return size
104             label size() const
105             {
106                 return procInterface_.size();
107             }
110         // Interface matrix update
112             //- Initialise neighbour matrix update
113             virtual void initInterfaceMatrixUpdate
114             (
115                 const scalarField& psiInternal,
116                 scalarField& result,
117                 const lduMatrix& m,
118                 const scalarField& coeffs,
119                 const direction cmpt,
120                 const Pstream::commsTypes commsType
121             ) const;
123             //- Update result field based on interface functionality
124             virtual void updateInterfaceMatrix
125             (
126                 const scalarField& psiInternal,
127                 scalarField& result,
128                 const lduMatrix&,
129                 const scalarField& coeffs,
130                 const direction cmpt,
131                 const Pstream::commsTypes commsType
132             ) const;
135         //- Processor interface functions
137             //- Return processor number
138             virtual int myProcNo() const
139             {
140                 return procInterface_.myProcNo();
141             }
143             //- Return neigbour processor number
144             virtual int neighbProcNo() const
145             {
146                 return procInterface_.neighbProcNo();
147             }
149             //- Does the interface field perform the transfromation
150             virtual bool doTransform() const
151             {
152                 return doTransform_;
153             }
155             //- Return face transformation tensor
156             virtual const tensorField& forwardT() const
157             {
158                 return procInterface_.forwardT();
159             }
161             //- Return rank of component for transform
162             virtual int rank() const
163             {
164                 return rank_;
165             }
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #endif
177 // ************************************************************************* //