Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_ImportFactory.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_IMPORTFACTORY_HPP
11#define XPETRA_IMPORTFACTORY_HPP
12
13#include "Xpetra_ConfigDefs.hpp"
14
15#include "Xpetra_Import.hpp"
16
17#include "Xpetra_TpetraImport.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 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &target,
35 const Teuchos::RCP<Teuchos::ParameterList> &plist = Teuchos::null) {
36 XPETRA_MONITOR("ImportFactory::Build");
37
38 TEUCHOS_TEST_FOR_EXCEPTION(source->lib() != target->lib(), Xpetra::Exceptions::RuntimeError, "");
39
40 if (source->lib() == UseTpetra)
41 return rcp(new TpetraImport<LocalOrdinal, GlobalOrdinal, Node>(source, target, plist));
42
44 }
45};
46
47} // namespace Xpetra
48
49#define XPETRA_IMPORTFACTORY_SHORT
50#endif
#define XPETRA_MONITOR(funcName)
#define XPETRA_FACTORY_END
Exception throws to report errors in the internal logical of the program.
ImportFactory()
Private constructor. This is a static class.
static RCP< Import< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &source, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying the number of non-zeros for all rows.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)