Forward compatibility: flex
[foam-extend-3.2.git] / src / foam / matrices / lduMatrix / solvers / GAMG / interfaceFields / processorGAMGInterfaceField / processorGAMGInterfaceField.H
blobd2ed8d49175d6e58d2f7a1f2b384d2c3dd6ca6cb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::processorGAMGInterfaceField
27 Description
28     GAMG agglomerated processor interface field.
30 SourceFiles
31     processorGAMGInterfaceField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef processorGAMGInterfaceField_H
36 #define processorGAMGInterfaceField_H
38 #include "GAMGInterfaceField.H"
39 #include "processorGAMGInterface.H"
40 #include "processorLduInterfaceField.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                   Class processorGAMGInterfaceField Declaration
49 \*---------------------------------------------------------------------------*/
51 class processorGAMGInterfaceField
53     public GAMGInterfaceField,
54     public processorLduInterfaceField
56     // Private data
58         //- Local reference cast into the processor interface
59         const processorGAMGInterface& procInterface_;
61         //- Is the transform required
62         bool doTransform_;
64         //- Rank of component for transformation
65         int rank_;
68     // Private Member Functions
70         //- Disallow default bitwise copy construct
71         processorGAMGInterfaceField(const processorGAMGInterfaceField&);
73         //- Disallow default bitwise assignment
74         void operator=(const processorGAMGInterfaceField&);
77 public:
79     //- Runtime type information
80     TypeName("processor");
83     // Constructors
85         //- Construct from GAMG interface and fine level interface field
86         processorGAMGInterfaceField
87         (
88             const GAMGInterface& GAMGCp,
89             const lduInterfaceField& fineInterfaceField
90         );
93     // Destructor
95         virtual ~processorGAMGInterfaceField();
98     // Member Functions
100         // Access
102             //- Return size
103             label size() const
104             {
105                 return procInterface_.size();
106             }
109         // Coupled interface matrix update
111             //- Transform neighbour field
112             virtual void transformCoupleField
113             (
114                 scalarField& pnf,
115                 const direction cmpt
116             ) const
117             {
118                 processorLduInterfaceField::transformCoupleField(pnf, cmpt);
119             }
121             //- Initialise neighbour matrix update
122             virtual void initInterfaceMatrixUpdate
123             (
124                 const scalarField& psiInternal,
125                 scalarField& result,
126                 const lduMatrix& m,
127                 const scalarField& coeffs,
128                 const direction cmpt,
129                 const Pstream::commsTypes commsType,
130                 const bool switchToLhs
131             ) const;
133             //- Update result field based on interface functionality
134             virtual void updateInterfaceMatrix
135             (
136                 const scalarField& psiInternal,
137                 scalarField& result,
138                 const lduMatrix&,
139                 const scalarField& coeffs,
140                 const direction cmpt,
141                 const Pstream::commsTypes commsType,
142                 const bool switchToLhs
143             ) const;
146         //- Processor interface functions
148             //- Return processor number
149             virtual int myProcNo() const
150             {
151                 return procInterface_.myProcNo();
152             }
154             //- Return neigbour processor number
155             virtual int neighbProcNo() const
156             {
157                 return procInterface_.neighbProcNo();
158             }
160             //- Does the interface field perform the transfromation
161             virtual bool doTransform() const
162             {
163                 return doTransform_;
164             }
166             //- Return face transformation tensor
167             virtual const tensorField& forwardT() const
168             {
169                 return procInterface_.forwardT();
170             }
172             //- Return rank of component for transform
173             virtual int rank() const
174             {
175                 return rank_;
176             }
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 } // End namespace Foam
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 #endif
188 // ************************************************************************* //