Epetra_DistObject.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_DISTOBJECT_H
00033 #define EPETRA_DISTOBJECT_H
00034 #include "Epetra_Object.h"
00035 #include "Epetra_SrcDistObject.h"
00036 #include "Epetra_BlockMap.h"
00037 class Epetra_Comm;
00038 class Epetra_Import;
00039 class Epetra_Export;
00040 class Epetra_Distributor;
00041 class Epetra_OffsetIndex;
00042 
00044 
00066 //==========================================================================
00067 class Epetra_DistObject: public Epetra_Object, public virtual Epetra_SrcDistObject {
00068 
00069   public:
00071 
00072 
00073 
00085   Epetra_DistObject(const Epetra_BlockMap& Map);
00086 
00101   Epetra_DistObject(const Epetra_BlockMap& Map, const char* const Label);
00102 
00104   
00105   Epetra_DistObject(const Epetra_DistObject& Source);
00106   
00107   
00109   virtual ~Epetra_DistObject();
00111 
00113 
00114 
00116 
00128   int Import(const Epetra_SrcDistObject& A, const Epetra_Import& Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex * Indexor = 0);
00129 
00131 
00143   int Import(const Epetra_SrcDistObject& A, const Epetra_Export& Exporter, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex * Indexor = 0);
00144 
00146 
00158   int Export(const Epetra_SrcDistObject& A, const Epetra_Import & Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex * Indexor = 0);
00159 
00161 
00173   int Export(const Epetra_SrcDistObject& A, const Epetra_Export& Exporter, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex * Indexor = 0);
00175   
00177 
00178 
00179   const Epetra_BlockMap& Map() const {return(Map_);};
00180 
00182   const Epetra_Comm& Comm() const {return(*Comm_);};
00183 
00185   bool DistributedGlobal() const {return(DistributedGlobal_);};
00187 
00189 
00190 
00191   virtual void Print(ostream& os) const;
00193 
00194  protected:
00195 
00196 
00198 
00199 
00200   virtual int DoTransfer(const Epetra_SrcDistObject& A,
00201                          Epetra_CombineMode CombineMode,
00202                          int NumSameIDs,
00203                          int NumPermuteIDs,
00204                          int NumRemoteIDs,
00205                          int NumExportIDs, 
00206                          int* PermuteToLIDs,
00207                          int* PermuteFromLIDs,
00208                          int* RemoteLIDs,
00209                          int* ExportLIDs,
00210                          int& LenExports,
00211                          char*& Exports,
00212                          int& LenImports, 
00213                          char*& Imports,
00214                          Epetra_Distributor& Distor,
00215                          bool DoReverse,
00216                          const Epetra_OffsetIndex * Indexor );
00218 
00219   // These methods must be implemented by derived class
00220 
00222 
00223 
00224   virtual int CheckSizes(const Epetra_SrcDistObject& Source) = 0;
00226   virtual int CopyAndPermute(const Epetra_SrcDistObject& Source,
00227                              int NumSameIDs, 
00228                              int NumPermuteIDs,
00229                              int * PermuteToLIDs,
00230                              int * PermuteFromLIDs,
00231                              const Epetra_OffsetIndex * Indexor) = 0;
00232 
00234   virtual int PackAndPrepare(const Epetra_SrcDistObject& Source,
00235                              int NumExportIDs,
00236                              int* ExportLIDs,
00237                              int& LenExports,
00238                              char*& Exports,
00239                              int& SizeOfPacket,
00240                              int* Sizes,
00241                              bool & VarSizes,
00242                              Epetra_Distributor& Distor) = 0;
00243   
00245   virtual int UnpackAndCombine(const Epetra_SrcDistObject& Source, 
00246                                int NumImportIDs,
00247                                int* ImportLIDs, 
00248                                int LenImports,
00249                                char* Imports,
00250                                int& SizeOfPacket, 
00251                                Epetra_Distributor& Distor,
00252                                Epetra_CombineMode CombineMode,
00253                                const Epetra_OffsetIndex * Indexor) = 0;
00254 
00256   Epetra_BlockMap Map_;
00257   const Epetra_Comm* Comm_;
00258   bool DistributedGlobal_;
00259   char* Exports_;
00260   char* Imports_;
00261   int LenExports_;
00262   int LenImports_;
00263   int *Sizes_;
00264 
00265  private:
00266   Epetra_DistObject& operator=(const Epetra_DistObject& src);
00267 
00268 };
00269 
00270 #endif /* EPETRA_DISTOBJECT_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7