MueLu Version of the Day
Loading...
Searching...
No Matches
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
15#include "Xpetra_MultiVector_fwd.hpp"
16
18
19#include "MueLu_Level_fwd.hpp"
21
22namespace MueLu {
23
67template <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
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
100 RCP<const ParameterList> GetValidParameterList() const;
101
108 void DeclareInput(Level& currentLevel) const;
109
111
113
114
116 void Build(Level& currentLevel) const;
117
119
120 private:
121 using coordinate_type = typename Teuchos::ScalarTraits<Scalar>::coordinateType;
122 using RealValuedMultiVector = Xpetra::MultiVector<coordinate_type, LO, GO, NO>;
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
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
Factory for generating nullspace.
void fillNullspaceVector(const RCP< MultiVector > &nullspace, LocalOrdinal numPDEs, LocalOrdinal nullspaceDim, CoordsType coordsView, MeanCoordsType meanView) const
void Build(Level &currentLevel) const
Build an object with this factory.
typename Teuchos::ScalarTraits< Scalar >::coordinateType coordinate_type
Kokkos::View< typename RealValuedMultiVector::impl_scalar_type *, typename Node::memory_space > MeanCoordsType
Xpetra::MultiVector< coordinate_type, LO, GO, NO > RealValuedMultiVector
typename RealValuedMultiVector::dual_view_type::t_dev_const_um CoordsType
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
NullspaceFactory(const std::string &nspName="Nullspace")
Constructor.
RCP< const ParameterList > GetValidParameterList() const
Define valid parameters for internal factory parameters.
void DeclareInput(Level &currentLevel) const
Specifies the data that this class needs, and the factories that generate that data.
void SetParameter(const std::string &name, const ParameterEntry &entry)
Set a parameter directly as a ParameterEntry.
Base class for factories that use one level (currentLevel).
Namespace for MueLu classes and methods.