Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Export_decl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TPETRA_EXPORT_DECL_HPP
11 #define TPETRA_EXPORT_DECL_HPP
12 
13 #include "Tpetra_Details_Transfer.hpp"
14 #include "Tpetra_Export_fwd.hpp"
15 #include "Tpetra_Import_fwd.hpp"
16 #include "Teuchos_ArrayView.hpp"
17 #include "Teuchos_RCP.hpp"
18 
19 #ifndef DOXYGEN_SHOULD_SKIP_THIS
20 namespace Teuchos {
21 template<class T> class Array; // forward declaration
22 class ParameterList; // forward declaration
23 } // namespace Teuchos
24 #endif // DOXYGEN_SHOULD_SKIP_THIS
25 
26 namespace Tpetra {
82  template<class LocalOrdinal,
83  class GlobalOrdinal,
84  class Node>
85  class Export:
86  public ::Tpetra::Details::Transfer<LocalOrdinal, GlobalOrdinal, Node>
87  {
88  private:
89  friend class Import<LocalOrdinal,GlobalOrdinal,Node>;
90  using base_type =
92  public:
95 
97 
98 
106  Export (const Teuchos::RCP<const map_type>& source,
107  const Teuchos::RCP<const map_type>& target);
108 
119  Export (const Teuchos::RCP<const map_type>& source,
120  const Teuchos::RCP<const map_type>& target,
121  const Teuchos::RCP<Teuchos::FancyOStream>& out);
122 
135  Export (const Teuchos::RCP<const map_type>& source,
136  const Teuchos::RCP<const map_type>& target,
137  const Teuchos::RCP<Teuchos::ParameterList>& plist);
138 
154  Export (const Teuchos::RCP<const map_type>& source,
155  const Teuchos::RCP<const map_type>& target,
156  const Teuchos::RCP<Teuchos::FancyOStream>& out,
157  const Teuchos::RCP<Teuchos::ParameterList>& plist);
158 
164 
172 
176 
178  virtual ~Export () = default;
179 
181 
183 
206  virtual void
207  describe (Teuchos::FancyOStream& out,
208  const Teuchos::EVerbosityLevel verbLevel =
209  Teuchos::Describable::verbLevel_default) const;
210 
226  virtual void print (std::ostream& os) const;
228  private:
230 
231  void setupSamePermuteExport(Teuchos::Array<GlobalOrdinal> & exportGIDs);
233 
235  void setupRemote(Teuchos::Array<GlobalOrdinal> & exportGIDs);
237  }; // class Export
238 
251  template <class LocalOrdinal, class GlobalOrdinal, class Node>
252  Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> >
253  createExport (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& src,
254  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& tgt)
255  {
256  if (src == tgt) {
257  return Teuchos::null;
258  }
259 #ifdef HAVE_TPETRA_DEBUG
260  TEUCHOS_TEST_FOR_EXCEPTION
261  (src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
262  "Tpetra::createExport: Neither source nor target map may be null.");
263 #endif // HAVE_TPETRA_DEBUG
264  using export_type = Export<LocalOrdinal, GlobalOrdinal, Node>;
265  return Teuchos::rcp (new export_type (src, tgt));
266  }
267 
268 } // namespace Tpetra
269 
270 #endif // TPETRA_EXPORT_DECL_HPP
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
Common base class of Import and Export.
virtual void print(std::ostream &os) const
Print the Export&#39;s data to the given output stream.
Export< LocalOrdinal, GlobalOrdinal, Node > & operator=(const Export< LocalOrdinal, GlobalOrdinal, Node > &rhs)=default
Assignment operator.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Describe this object in a human-readable way to the given output stream.
virtual ~Export()=default
Destructor.
Export(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct a Export object from the source and target Map.
Forward declaration of Tpetra::Export.
Forward declaration of Tpetra::Import.
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > createExport(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &src, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &tgt)
Nonmember &quot;constructor&quot; for Export objects.
A parallel distribution of indices over processes.