Debian Codegraph @

packages/muelu/test/unit_tests/Smoothers/Amesos2Smoother.cpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #include <Teuchos_UnitTestHarness.hpp>
11 #include <Amesos2_config.h>
12
13 #include "MueLu_TestHelpers.hpp"
14 #include "MueLu_Version.hpp"
15
16 #include "MueLu_Amesos2Smoother.hpp"
17 #include "MueLu_TestHelpersSmoothers.hpp"
18
19 namespace MueLuTests {
20
21 // this namespace already has: #include "MueLu_UseShortNames.hpp"
22 using namespace TestHelpers::Smoothers;
23
24 TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Amesos2Smoother, NotSetup, Scalar, LocalOrdinal, GlobalOrdinal, Node) {
25 #include "MueLu_UseShortNames.hpp"
26 MUELU_TESTING_SET_OSTREAM;
27 MUELU_TESTING_LIMIT_SCOPE(Scalar, GlobalOrdinal, NO);
28 out << "version: " << MueLu::Version() << std::endl;
29
30 MUELU_TEST_ONLY_FOR(Xpetra::UseTpetra) {
31 #if defined HAVE_AMESOS2_KLU2 || defined HAVE_AMESOS2_SUPERLU
32 testApplyNoSetup(Amesos2Smoother(), out, success);
33 #endif
34 }
35 }
36
37 TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Amesos2Smoother, Apply_Correctness, Scalar, LocalOrdinal, GlobalOrdinal, Node) {
38 #include "MueLu_UseShortNames.hpp"
39 MUELU_TESTING_SET_OSTREAM;
40 MUELU_TESTING_LIMIT_SCOPE(Scalar, GlobalOrdinal, NO);
41 out << "version: " << MueLu::Version() << std::endl;
42
43 MUELU_TEST_ONLY_FOR(Xpetra::UseTpetra) {
44 Teuchos::RCP<Amesos2Smoother> smoother;
45 #ifdef HAVE_AMESOS2_KLU2
46 smoother = Teuchos::rcp(new Amesos2Smoother("Klu"));
47 testDirectSolver(*smoother, out, success);
48 #endif
49
50 #ifdef HAVE_AMESOS2_SUPERLU
51 smoother = Teuchos::rcp(new Amesos2Smoother("Superlu"));
52 testDirectSolver(*smoother, out, success);
53 #endif
54 }
55 }
56
57 #define MUELU_ETI_GROUP(SC, LO, GO, Node) \
58 TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(Amesos2Smoother, NotSetup, SC, LO, GO, Node) \
59 TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(Amesos2Smoother, Apply_Correctness, SC, LO, GO, Node)
60
61 #include <MueLu_ETI_4arg.hpp>
62
63 } // namespace MueLuTests