MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_NoFactory.cpp
Go to the documentation of this file.
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
21namespace MueLu {
22
23NoFactory::NoFactory() = default;
24
25NoFactory::~NoFactory() = default;
26
27const RCP<const NoFactory> NoFactory::getRCP() {
28 if (noFactory_.is_null())
29 noFactory_ = rcp(new NoFactory());
30
31 return noFactory_;
32}
33
35 return getRCP().get();
36}
37
38void NoFactory::CallDeclareInput(Level& /* requestedLevel */) const {}
39
40RCP<const NoFactory> NoFactory::noFactory_ = Teuchos::null;
41
42void 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
Exception throws to report errors in the internal logical of the program.
Class that holds all level-specific information.
void print(std::ostream &out, const VerbLevel verbLevel=Default) const
Printing method.
NoFactory that is used for data stored in level class for that no generating factory is available/nec...
static RCP< const NoFactory > noFactory_
NoFactory()
Constructor.
static const RCP< const NoFactory > getRCP()
Static Get() functions.
void CallBuild(Level &requestedLevel) const
Implementation of FactoryBase interface.
void CallDeclareInput(Level &) const
static const NoFactory * get()
virtual ~NoFactory()
Destructor.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
Namespace for MueLu classes and methods.
@ Debug
Print additional debugging information.