fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / OpenFOAM / matrices / lduMatrix / lduAddressing / lduInterface / processorLduInterface.H
blobb5083cd5630843315f71a7a281300517938096e7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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::processorLduInterface
28 Description
29     An abstract base class for processor coupled interfaces.
31 SourceFiles
32     processorLduInterface.C
33     processorLduInterfaceTemplates.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef processorLduInterface_H
38 #define processorLduInterface_H
40 #include "lduInterface.H"
41 #include "primitiveFieldsFwd.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                   Class processorLduInterface Declaration
50 \*---------------------------------------------------------------------------*/
52 class processorLduInterface
54     // Private data
56         //- Send buffer.
57         //  Only sized and used when compressed or non-blocking comms used.
58         mutable List<char> sendBuf_;
60         //- Receive buffer.
61         //  Only sized and used when compressed or non-blocking comms used.
62         mutable List<char> receiveBuf_;
64         //- Resize the buffer if required
65         void resizeBuf(List<char>& buf, const label size) const;
68 public:
70     //- Runtime type information
71     TypeName("processorLduInterface");
74     // Constructors
76         //- Construct null
77         processorLduInterface();
80     // Destructor
82         virtual ~processorLduInterface();
85     // Member Functions
87         // Access
89             //- Return processor number
90             virtual int myProcNo() const = 0;
92             //- Return neigbour processor number
93             virtual int neighbProcNo() const = 0;
95             //- Return face transformation tensor
96             virtual const tensorField& forwardT() const = 0;
99         // Transfer functions
101             //- Raw send function
102             template<class Type>
103             void send
104             (
105                 const Pstream::commsTypes commsType,
106                 const UList<Type>&
107             ) const;
109             //- Raw field receive function
110             template<class Type>
111             void receive
112             (
113                 const Pstream::commsTypes commsType,
114                 UList<Type>&
115             ) const;
117             //- Raw field receive function returning field
118             template<class Type>
119             tmp<Field<Type> > receive
120             (
121                 const Pstream::commsTypes commsType,
122                 const label size
123             ) const;
126             //- Raw field send function with data compression
127             template<class Type>
128             void compressedSend
129             (
130                 const Pstream::commsTypes commsType,
131                 const UList<Type>&
132             ) const;
134             //- Raw field receive function with data compression
135             template<class Type>
136             void compressedReceive
137             (
138                 const Pstream::commsTypes commsType,
139                 UList<Type>&
140             ) const;
142             //- Raw field receive function with data compression returning field
143             template<class Type>
144             tmp<Field<Type> > compressedReceive
145             (
146                 const Pstream::commsTypes commsType,
147                 const label size
148             ) const;
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 #ifdef NoRepository
159 #   include "processorLduInterfaceTemplates.C"
160 #endif
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #endif
166 // ************************************************************************* //