MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_NullspaceFactory_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_NULLSPACEFACTORY_DECL_HPP
11 #define MUELU_NULLSPACEFACTORY_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
14 
16 
18 
19 #include "MueLu_Level_fwd.hpp"
21 
22 namespace MueLu {
23 
67 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
68 
70  public:
73  typedef typename Node::execution_space execution_space;
74  typedef Kokkos::RangePolicy<local_ordinal_type, execution_space> range_type;
75  typedef Node node_type;
76 
77  private:
78 #undef MUELU_NULLSPACEFACTORY_SHORT
79 #include "MueLu_UseShortNames.hpp"
80 
81  public:
83 
84 
86  NullspaceFactory(const std::string& nspName = "Nullspace") {
87  SetParameter("Fine level nullspace", ParameterEntry(nspName));
88  }
89 
91  virtual ~NullspaceFactory() {}
92 
94 
96 
98 
101 
108  void DeclareInput(Level& currentLevel) const;
109 
111 
113 
114 
116  void Build(Level& currentLevel) const;
117 
119 
120  private:
123  using CoordsType = typename RealValuedMultiVector::dual_view_type::t_dev_const_um;
124  using MeanCoordsType = Kokkos::View<typename RealValuedMultiVector::impl_scalar_type*, typename Node::memory_space>;
125 
126  void fillNullspaceVector(const RCP<MultiVector>& nullspace, LocalOrdinal numPDEs, LocalOrdinal nullspaceDim, CoordsType coordsView, MeanCoordsType meanView) const;
127 
128  mutable bool calculateRotations_ = false;
129 };
130 
131 } // namespace MueLu
132 
133 #define MUELU_NULLSPACEFACTORY_SHORT
134 #endif // MUELU_NULLSPACEFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
RCP< const ParameterList > GetValidParameterList() const
Define valid parameters for internal factory parameters.
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
typename RealValuedMultiVector::dual_view_type::t_dev_const_um CoordsType
MueLu::DefaultNode Node
void fillNullspaceVector(const RCP< MultiVector > &nullspace, LocalOrdinal numPDEs, LocalOrdinal nullspaceDim, CoordsType coordsView, MeanCoordsType meanView) const
void DeclareInput(Level &currentLevel) const
Specifies the data that this class needs, and the factories that generate that data.
Kokkos::View< typename RealValuedMultiVector::impl_scalar_type *, typename Node::memory_space > MeanCoordsType
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
typename Teuchos::ScalarTraits< Scalar >::coordinateType coordinate_type
void SetParameter(const std::string &name, const ParameterEntry &entry)
Set a parameter directly as a ParameterEntry.
NullspaceFactory(const std::string &nspName="Nullspace")
Constructor.
virtual ~NullspaceFactory()
Destructor.
Base class for factories that use one level (currentLevel).
Factory for generating nullspace.
void Build(Level &currentLevel) const
Build an object with this factory.