Debian Codegraph @

packages/muelu/src/Transfers/SemiCoarsen/MueLu_ToggleCoordinatesTransferFactory_decl.hpp

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 #ifndef MUELU_TOGGLECOORDINATESTRANSFER_FACTORY_DECL_HPP
11 #define MUELU_TOGGLECOORDINATESTRANSFER_FACTORY_DECL_HPP
12
13 #include "MueLu_ConfigDefs.hpp"
14 #include "MueLu_TwoLevelFactoryBase.hpp"
15
16 #include "MueLu_ToggleCoordinatesTransferFactory_fwd.hpp"
17
18 namespace MueLu {
19
20 /*!
21 @class ToggleCoordinatesTransferFactory class.
22 @brief Class for transferring coordinates from a finer level to a coarser one
23
24 */
25 template <class Scalar = DefaultScalar,
26 class LocalOrdinal = DefaultLocalOrdinal,
27 class GlobalOrdinal = DefaultGlobalOrdinal,
28 class Node = DefaultNode>
29 class ToggleCoordinatesTransferFactory : public TwoLevelFactoryBase {
30 #undef MUELU_TOGGLECOORDINATESTRANSFERFACTORY_SHORT
31 #include "MueLu_UseShortNames.hpp"
32
33 public:
34 //! @name Constructors/Destructors.
35 //@{
36
37 /*! @brief Constructor.
38
39 @param vectorName The name of the quantity to be restricted.
40 @param restrictionName The name of the restriction Matrix.
41
42 The operator associated with <tt>projectionName</tt> will be applied to the MultiVector associated with
43 <tt>vectorName</tt>.
44 */
45 ToggleCoordinatesTransferFactory()
46 : hasDeclaredInput_(false) {}
47
48 //! Destructor.
49 virtual ~ToggleCoordinatesTransferFactory() {}
50
51 RCP<const ParameterList> GetValidParameterList() const;
52
53 //@}
54
55 //! @name Input
56 //@{
57
58 /*! @brief Specifies the data that this class needs, and the factories that generate that data.
59
60 If the Build method of this class requires some data, but the generating factory is not specified in DeclareInput, then this class
61 will fall back to the settings in FactoryManager.
62 */
63 void DeclareInput(Level &finelevel, Level &coarseLevel) const;
64
65 //@}
66
67 //! @name Build methods.
68 //@{
69
70 //! Build an object with this factory.
71 void Build(Level &fineLevel, Level &coarseLevel) const;
72
73 //@}
74
75 //! @name Get/Set functions
76 //@{
77
78 /*! @brief Add a coordinate transfer factory in the end of list of coordinate transfer factories */
79 void AddCoordTransferFactory(const RCP<const FactoryBase> &factory);
80
81 //! Returns number of coordinate transfer factories.
82 size_t NumCoordTransferFactories() const { return coordFacts_.size(); }
83 //@}
84
85 private:
86 //! list of user-defined transfer coordinate factories which provide coordinates on the coarse level!
87 mutable std::vector<RCP<const FactoryBase> > coordFacts_;
88
89 mutable bool hasDeclaredInput_;
90 }; // class ToggleCoordinatesTransferFactory
91
92 } // namespace MueLu
93
94 #define MUELU_TOGGLECOORDINATESTRANSFERFACTORY_SHORT
95 #endif // MUELU_TOGGLECOORDINATESTRANSFER_FACTORY_DECL_HPP