// @HEADER // ***************************************************************************** // MueLu: A package for multigrid based preconditioning // // Copyright 2012 NTESS and the MueLu contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #include #include #include #include #include #include // Galeri #include #include #include #include // #include #include #include #include #include // TODO: move into MueLu.hpp #include #ifdef HAVE_MUELU_BELOS #include #include #include #include // => This header defines Belos::XpetraOp #include // => This header defines Belos::MueLuOp #endif //- -- -------------------------------------------------------- template int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int argc, char *argv[]) { #include using Teuchos::Array; using Teuchos::ArrayRCP; using Teuchos::RCP; // reference count pointers using Teuchos::rcp; using Teuchos::Time; using Teuchos::TimeMonitor; typedef Teuchos::ScalarTraits STS; bool success = false; bool verbose = true; try { RCP > comm = Teuchos::DefaultComm::getComm(); int mypid = comm->getRank(); RCP fancy = Teuchos::fancyOStream(Teuchos::rcpFromRef(cout)); Teuchos::FancyOStream &out = *fancy; out.setOutputToRootOnly(0); SC zero = STS::zero(), one = STS::one(); // // Parameters // Xpetra::Parameters xpetraParameters(clp); // manage parameters of Xpetra std::string xmlFileName = "reuse.xml"; clp.setOption("xml", &xmlFileName, "read parameters from a file. Otherwise, this example uses by default 'reuse.xml'"); std::string matrixPrefix = "jac"; clp.setOption("matrix", &matrixPrefix, "prefix for matrix file names. Default = 'jac'"); bool binary = false; clp.setOption("binary", "nobinary", &binary, "matrix files are binary. Default = false"); std::string rhsPrefix = "rhs"; clp.setOption("rhs", &rhsPrefix, "prefix for rhs file names. Default = 'rhs'"); bool printTimings = true; clp.setOption("timings", "notimings", &printTimings, "print timings to screen"); int first_matrix = 0; clp.setOption("firstMatrix", &first_matrix, "first matrix in the sequence to use"); int last_matrix = 1; clp.setOption("lastMatrix", &last_matrix, "last matrix in the sequence to use"); bool inMemory = false; clp.setOption("inmemory", "noinmemory", &inMemory, "load all matrices in memory"); bool doReuse = true; clp.setOption("reuse", "noreuse", &doReuse, "if you want to try reuse"); const int numPDEs = 2; switch (clp.parse(argc, argv)) { case Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED: return EXIT_SUCCESS; case Teuchos::CommandLineProcessor::PARSE_ERROR: case Teuchos::CommandLineProcessor::PARSE_UNRECOGNIZED_OPTION: return EXIT_FAILURE; case Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL: break; } RCP globalTimeMonitor = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("Global Time"))), tm; RCP