FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

processorLduInterface.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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::processorLduInterface
00026 
00027 Description
00028     An abstract base class for processor coupled interfaces.
00029 
00030 SourceFiles
00031     processorLduInterface.C
00032     processorLduInterfaceTemplates.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef processorLduInterface_H
00037 #define processorLduInterface_H
00038 
00039 #include "lduInterface.H"
00040 #include <OpenFOAM/primitiveFieldsFwd.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                   Class processorLduInterface Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class processorLduInterface
00052 {
00053     // Private data
00054 
00055         //- Send buffer.
00056         //  Only sized and used when compressed or non-blocking comms used.
00057         mutable List<char> sendBuf_;
00058 
00059         //- Receive buffer.
00060         //  Only sized and used when compressed or non-blocking comms used.
00061         mutable List<char> receiveBuf_;
00062 
00063         //- Resize the buffer if required
00064         void resizeBuf(List<char>& buf, const label size) const;
00065 
00066 
00067 public:
00068 
00069     //- Runtime type information
00070     TypeName("processorLduInterface");
00071 
00072 
00073     // Constructors
00074 
00075         //- Construct null
00076         processorLduInterface();
00077 
00078 
00079     // Destructor
00080 
00081         virtual ~processorLduInterface();
00082 
00083 
00084     // Member Functions
00085 
00086         // Access
00087 
00088             //- Return processor number
00089             virtual int myProcNo() const = 0;
00090 
00091             //- Return neigbour processor number
00092             virtual int neighbProcNo() const = 0;
00093 
00094             //- Return face transformation tensor
00095             virtual const tensorField& forwardT() const = 0;
00096 
00097 
00098         // Transfer functions
00099 
00100             //- Raw send function
00101             template<class Type>
00102             void send
00103             (
00104                 const Pstream::commsTypes commsType,
00105                 const UList<Type>&
00106             ) const;
00107 
00108             //- Raw field receive function
00109             template<class Type>
00110             void receive
00111             (
00112                 const Pstream::commsTypes commsType,
00113                 UList<Type>&
00114             ) const;
00115 
00116             //- Raw field receive function returning field
00117             template<class Type>
00118             tmp<Field<Type> > receive
00119             (
00120                 const Pstream::commsTypes commsType,
00121                 const label size
00122             ) const;
00123 
00124 
00125             //- Raw field send function with data compression
00126             template<class Type>
00127             void compressedSend
00128             (
00129                 const Pstream::commsTypes commsType,
00130                 const UList<Type>&
00131             ) const;
00132 
00133             //- Raw field receive function with data compression
00134             template<class Type>
00135             void compressedReceive
00136             (
00137                 const Pstream::commsTypes commsType,
00138                 UList<Type>&
00139             ) const;
00140 
00141             //- Raw field receive function with data compression returning field
00142             template<class Type>
00143             tmp<Field<Type> > compressedReceive
00144             (
00145                 const Pstream::commsTypes commsType,
00146                 const label size
00147             ) const;
00148 };
00149 
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 } // End namespace Foam
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #ifdef NoRepository
00158 #   include "processorLduInterfaceTemplates.C"
00159 #endif
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 #endif
00164 
00165 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines