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_Map_decl.hpp"
00036 
00037 namespace Tpetra {
00038 
00040   
00053   template<class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
00054   class Directory : public Teuchos::Describable {
00055   public:
00056 
00058 
00059 
00061     explicit Directory(const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &map);
00062 
00064     ~Directory();
00065 
00067 
00069 
00070 
00072 
00085     LookupStatus getDirectoryEntries(const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs, 
00086                                      const Teuchos::ArrayView<int> &nodeIDs) const;
00087     
00089 
00106     LookupStatus getDirectoryEntries(const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs, 
00107                                      const Teuchos::ArrayView<int> &nodeIDs, 
00108                                      const Teuchos::ArrayView<LocalOrdinal> &localIDs) const;
00110     
00111   private:
00112     Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > map_, directoryMap_;
00113     Teuchos::RCP<const Teuchos::Comm<int> > comm_;
00114     std::vector<GlobalOrdinal> allMinGIDs_; // size comm_->getSize()+1; entry i contains minGID for ith node, except last entry contains maxGID in the directory
00115     std::vector<int> nodeIDs_;
00116     std::vector<LocalOrdinal> LIDs_;
00117 
00118     Directory(const Directory<LocalOrdinal,GlobalOrdinal,Node> &directory);
00119 
00121     Directory<LocalOrdinal,GlobalOrdinal,Node> & operator = (const Directory<LocalOrdinal,GlobalOrdinal,Node> &source);
00122 
00123     // common code for both versions of getDirectoryEntries
00124     LookupStatus getEntries(const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs, 
00125                             const Teuchos::ArrayView<int> &nodeIDs, 
00126                             const Teuchos::ArrayView<LocalOrdinal> &localIDs, 
00127                             bool computeLIDs) const;
00128 
00129     // directory setup for non-contiguous ES
00130     void generateDirectory();
00131 
00132   }; // class Directory
00133 
00134 } // namespace Tpetra
00135 
00136 #endif // TPETRA_DIRECTORY_DECL_HPP
00137 

Generated on Tue Jul 13 09:39:06 2010 for Tpetra Matrix/Vector Services by  doxygen 1.4.7