Debian Codegraph @

packages/muelu/src/Transfers/BlockedTransfers/MueLu_ZeroSubBlockAFactory_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_ZEROSUBBLOCKAFACTORY_DECL_HPP_
11 #define MUELU_ZEROSUBBLOCKAFACTORY_DECL_HPP_
12
13 #include <Xpetra_Map_fwd.hpp>
14
15 #include "MueLu_ConfigDefs.hpp"
16 #include "MueLu_SingleLevelFactoryBase.hpp"
17 #include "MueLu_ZeroSubBlockAFactory_fwd.hpp"
18
19 namespace MueLu {
20
21 /*!
22 @class ZeroSubBlockAFactory class.
23 @brief Factory for extracting a zero block from a BlockedCrsMatrix.
24
25 This is a very simple class to access a single matrix block in a blocked operator A,
26 where the matrix block of interest is an actual zero block (as e.g. in saddle point systems).
27
28 */
29
30 template <class Scalar = DefaultScalar,
31 class LocalOrdinal = DefaultLocalOrdinal,
32 class GlobalOrdinal = DefaultGlobalOrdinal,
33 class Node = DefaultNode>
34 class ZeroSubBlockAFactory : public SingleLevelFactoryBase {
35 #undef MUELU_ZEROSUBBLOCKAFACTORY_SHORT
36 #include "MueLu_UseShortNames.hpp"
37
38 public:
39 //! Input
40 //@{
41
42 RCP<const ParameterList> GetValidParameterList() const override;
43
44 void DeclareInput(Level &currentLevel) const override;
45
46 //@}
47
48 //@{
49 //! @name Build methods
50
51 /*!
52 @brief Build a zero sub-block object with this factory
53
54 Create a zero sub block matrix, that fits into a given blocked crs operator.
55
56 Strided or block information is extracted in the following way:
57 1) first check whether the corresponding sub maps are strided
58 If yes, use the fixed block size and strided block id
59 2) If no, get the full map of the map extractors.
60 Check whether the full map is strided.
61 If yes, use the strided information of the full map and build
62 partial (strided) maps with it
63 If no, throw an exception
64
65 For blocked operators with block maps one should use the striding
66 information from the sub maps. For strided operators, the striding
67 information of the full map is the best choice.
68 */
69 void Build(Level &currentLevel) const override;
70
71 //@}
72
73 }; // class ZeroSubBlockAFactory
74
75 } // namespace MueLu
76
77 #define MUELU_ZEROSUBBLOCKAFACTORY_SHORT
78 #endif /* MUELU_ZEROSUBBLOCKAFACTORY_DECL_HPP_ */