Tpetra_Directory_decl.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //          Tpetra: Templated Linear Algebra Services Package
00005 //                 Copyright (2008) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef TPETRA_DIRECTORY_DECL_HPP
00030 #define TPETRA_DIRECTORY_DECL_HPP
00031 
00032 #include <Kokkos_DefaultNode.hpp>
00033 #include <Teuchos_RCP.hpp>
00034 #include <Teuchos_Describable.hpp>
00035 #include "Tpetra_ConfigDefs.hpp"
00036 #include "Tpetra_Map_decl.hpp"
00037 
00038 namespace Tpetra {
00039 
00041   
00054   template<class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
00055   class Directory : public Teuchos::Describable {
00056   public:
00057 
00059 
00060 
00062     explicit Directory(const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &map);
00063 
00065     ~Directory();
00066 
00068 
00070 
00071 
00073 
00086     LookupStatus getDirectoryEntries(const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs, 
00087                                      const Teuchos::ArrayView<int> &nodeIDs) const;
00088     
00090 
00107     LookupStatus getDirectoryEntries(const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs, 
00108                                      const Teuchos::ArrayView<int> &nodeIDs, 
00109                                      const Teuchos::ArrayView<LocalOrdinal> &localIDs) const;
00111     
00112   private:
00113     Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > map_, directoryMap_;
00114     Teuchos::RCP<const Teuchos::Comm<int> > comm_;
00115     std::vector<GlobalOrdinal> allMinGIDs_; // size comm_->getSize()+1; entry i contains minGID for ith node, except last entry contains maxGID in the directory
00116     std::vector<int> nodeIDs_;
00117     std::vector<LocalOrdinal> LIDs_;
00118 
00119     Directory(const Directory<LocalOrdinal,GlobalOrdinal,Node> &directory);
00120 
00122     Directory<LocalOrdinal,GlobalOrdinal,Node> & operator = (const Directory<LocalOrdinal,GlobalOrdinal,Node> &source);
00123 
00124     // common code for both versions of getDirectoryEntries
00125     LookupStatus getEntries(const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs, 
00126                             const Teuchos::ArrayView<int> &nodeIDs, 
00127                             const Teuchos::ArrayView<LocalOrdinal> &localIDs, 
00128                             bool computeLIDs) const;
00129 
00130     // directory setup for non-contiguous ES
00131     void generateDirectory();
00132 
00133   }; // class Directory
00134 
00135 } // namespace Tpetra
00136 
00137 #endif // TPETRA_DIRECTORY_DECL_HPP
00138 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:21:41 2011 for Tpetra Matrix/Vector Services by  doxygen 1.6.3