| 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 |
#ifndef MUELU_TWOLEVELFACTORY_HPP |
| 11 |
#define MUELU_TWOLEVELFACTORY_HPP |
| 12 |
|
| 13 |
#include "MueLu_ConfigDefs.hpp" |
| 14 |
|
| 15 |
#include "MueLu_Factory.hpp" |
| 16 |
#include "MueLu_Level.hpp" |
| 17 |
#include "MueLu_TimeMonitor.hpp" |
| 18 |
#include "MueLu_Utilities.hpp" |
| 19 |
|
| 20 |
namespace MueLu { |
| 21 |
|
| 22 |
/*! |
| 23 |
@class TwoLevelFactoryBase class. |
| 24 |
@brief Base class for factories that use two levels (fineLevel and coarseLevel). |
| 25 |
|
| 26 |
Examples of such factories are R, P, and A_coarse. |
| 27 |
|
| 28 |
@ingroup MueLuBaseClasses |
| 29 |
*/ |
| 30 |
|
| 31 |
class TwoLevelFactoryBase : public Factory { |
| 32 |
public: |
| 33 |
//! @name Constructors/Destructors. |
| 34 |
//@{ |
| 35 |
|
| 36 |
//! Constructor. |
| 37 |
TwoLevelFactoryBase(); |
| 38 |
|
| 39 |
//! Destructor. |
| 40 |
virtual ~TwoLevelFactoryBase(); |
| 41 |
|
| 42 |
//@} |
| 43 |
|
| 44 |
//! Input |
| 45 |
//@{ |
| 46 |
|
| 47 |
/*! @brief Specifies the data that this class needs, and the factories that generate that data. |
| 48 |
|
| 49 |
If the Build method of this class requires some data, but the generating factory is not specified in DeclareInput, then this class |
| 50 |
will fall back to the settings in FactoryManager. |
| 51 |
*/ |
| 52 |
virtual void DeclareInput(Level& fineLevel, Level& coarseLevel) const = 0; |
| 53 |
|
| 54 |
//! |
| 55 |
virtual void CallDeclareInput(Level& requestedLevel) const; |
| 56 |
|
| 57 |
//@} |
| 58 |
|
| 59 |
//! @name Build methods. |
| 60 |
//@{ |
| 61 |
|
| 62 |
//! Build an object with this factory. |
| 63 |
virtual void Build(Level& fineLevel, Level& coarseLevel) const = 0; |
| 64 |
|
| 65 |
//! |
| 66 |
virtual void CallBuild(Level& requestedLevel) const; |
| 67 |
|
| 68 |
//@} |
| 69 |
|
| 70 |
}; // class TwoLevelFactoryBase |
| 71 |
|
| 72 |
} // namespace MueLu |
| 73 |
|
| 74 |
#define MUELU_TWOLEVELFACTORY_SHORT |
| 75 |
#endif // ifndef MUELU_TWOLEVELFACTORY_HPP |