MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_SemiCoarsenPFactory_decl.hpp
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 #ifndef MUELU_SEMICOARSENPFACTORY_DECL_HPP
11 #define MUELU_SEMICOARSENPFACTORY_DECL_HPP
12 
13 #include <Xpetra_Matrix_fwd.hpp>
14 
15 #include "MueLu_ConfigDefs.hpp"
16 #include "MueLu_PFactory.hpp"
18 
19 #include "MueLu_Level_fwd.hpp"
20 
21 #define VERTICAL 1
22 #define HORIZONTAL 2
23 #define GRID_SUPPLIED -1
24 #define NUM_ZPTS 0
25 #define ORIENTATION 1
26 
27 namespace MueLu {
28 
70 template <class Scalar = DefaultScalar,
73  class Node = DefaultNode>
74 class SemiCoarsenPFactory : public PFactory {
75 #undef MUELU_SEMICOARSENPFACTORY_SHORT
76 #include "MueLu_UseShortNames.hpp"
77 
78  public:
80 
81 
84  : bTransferCoordinates_(false) {}
85 
87  virtual ~SemiCoarsenPFactory() {}
89 
91 
93 
94 
95  void DeclareInput(Level& fineLevel, Level& coarseLevel) const;
96 
98 
100 
101 
102  void Build(Level& fineLevel, Level& coarseLevel) const;
103  void BuildP(Level& fineLevel, Level& coarseLevel) const;
104 
106 
107  private:
108  LO FindCpts(LO const PtsPerLine, LO const CoarsenRate, LO const Thin, LO** LayerCpts) const;
109  LO MakeSemiCoarsenP(LO const Ntotal, LO const nz, LO const CoarsenRate, LO const LayerId[],
110  LO const VertLineId[], LO const DofsPerNode, RCP<Matrix>& Amat,
111  RCP<Matrix>& P, RCP<const Map>& coarseMap,
112  const RCP<MultiVector> fineNullspace, RCP<MultiVector>& coarseNullspace, RCP<Matrix>& R, bool buildRestriction, bool doLinear) const;
113  void RevertToPieceWiseConstant(RCP<Matrix>& P, LO BlkSize) const;
114 
115  mutable bool bTransferCoordinates_; //< boolean which is true if coordinate information is available to be transferred to coarse coordinate information
116 }; // class SemiCoarsenPFactory
117 
118 } // namespace MueLu
119 
120 #define MUELU_SEMICOARSENPFACTORY_SHORT
121 #endif // MUELU_SEMICOARSENPFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
LocalOrdinal LO
LO MakeSemiCoarsenP(LO const Ntotal, LO const nz, LO const CoarsenRate, LO const LayerId[], LO const VertLineId[], LO const DofsPerNode, RCP< Matrix > &Amat, RCP< Matrix > &P, RCP< const Map > &coarseMap, const RCP< MultiVector > fineNullspace, RCP< MultiVector > &coarseNullspace, RCP< Matrix > &R, bool buildRestriction, bool doLinear) const
MueLu::DefaultNode Node
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
Prolongator factory performing semi-coarsening.
void RevertToPieceWiseConstant(RCP< Matrix > &P, LO BlkSize) const
MueLu::DefaultScalar Scalar
void BuildP(Level &fineLevel, Level &coarseLevel) const
Abstract Build method.
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
LO FindCpts(LO const PtsPerLine, LO const CoarsenRate, LO const Thin, LO **LayerCpts) const
Factory that provides an interface for a concrete implementation of a prolongation operator...