Debian Codegraph @

packages/muelu/src/MueCentral/MueLu_NoFactory.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 /*
11 * MueLu_NoFactory.cpp
12 *
13 * Created on: Sep 13, 2011
14 * Author: wiesner
15 */
16
17 #include "MueLu_Level.hpp"
18
19 #include "MueLu_NoFactory.hpp"
20
21 namespace MueLu {
22
23 NoFactory::NoFactory() = default;
24
25 NoFactory::~NoFactory() = default;
26
27 const RCP<const NoFactory> NoFactory::getRCP() {
28 if (noFactory_.is_null())
29 noFactory_ = rcp(new NoFactory());
30
31 return noFactory_;
32 }
33
34 const NoFactory* NoFactory::get() {
35 return getRCP().get();
36 }
37
38 void NoFactory::CallDeclareInput(Level& /* requestedLevel */) const {}
39
40 RCP<const NoFactory> NoFactory::noFactory_ = Teuchos::null;
41
42 void NoFactory::CallBuild(Level& requestedLevel) const {
43 GetOStream(Errors) << "MueLu::NoFactory::Build(): this method cannot be called." << std::endl
44 << std::endl;
45 GetOStream(Errors) << "Maybe, the required variable has been generated by another factory?" << std::endl;
46 GetOStream(Errors) << "Here is a list of all available data on the current level:" << std::endl;
47 requestedLevel.print(GetOStream(Errors), MueLu::Debug);
48 throw Exceptions::RuntimeError("MueLu::NoFactory::Build(): this method cannot be called.");
49 }
50
51 } // namespace MueLu