Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_ExportFactory.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Xpetra: A linear algebra interface package
4//
5// Copyright 2012 NTESS and the Xpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef XPETRA_EXPORTFACTORY_HPP
11#define XPETRA_EXPORTFACTORY_HPP
12
13#include "Xpetra_ConfigDefs.hpp"
14
15#include "Xpetra_Export.hpp"
16
17#include "Xpetra_TpetraExport.hpp"
18
19#include "Xpetra_Exceptions.hpp"
20
21namespace Xpetra {
22
23template <class LocalOrdinal,
24 class GlobalOrdinal,
25 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
27 private:
30
31 public:
34 XPETRA_MONITOR("ExportFactory::Build");
35 TEUCHOS_TEST_FOR_EXCEPTION(source->lib() != target->lib(), Xpetra::Exceptions::RuntimeError, "");
36
37 if (source->lib() == UseTpetra)
38 return rcp(new TpetraExport<LocalOrdinal, GlobalOrdinal, Node>(source, target));
39
41 }
42};
43
44} // namespace Xpetra
45
46#define XPETRA_EXPORTFACTORY_SHORT
47#endif
#define XPETRA_MONITOR(funcName)
#define XPETRA_FACTORY_END
Exception throws to report errors in the internal logical of the program.
static RCP< Export< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &source, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &target)
Constructor specifying the number of non-zeros for all rows.
ExportFactory()
Private constructor. This is a static class.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)