OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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