MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_GeometricInterpolationPFactory_kokkos_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_GEOMETRICINTERPOLATIONPFACTORY_KOKKOS_DECL_HPP
11#define MUELU_GEOMETRICINTERPOLATIONPFACTORY_KOKKOS_DECL_HPP
12
13// Teuchos includes for dense linear algebra
14#include <Teuchos_SerialDenseMatrix.hpp>
15#include <Teuchos_SerialDenseVector.hpp>
16#include <Teuchos_SerialDenseSolver.hpp>
17
18#include "Xpetra_CrsGraph_fwd.hpp"
19
20#include "MueLu_PFactory.hpp"
21#include "MueLu_Level_fwd.hpp"
23
24namespace MueLu {
25
26template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
28#undef MUELU_GEOMETRICINTERPOLATIONPFACTORY_KOKKOS_SHORT
30
31 public:
32 // Declare useful types
33 using real_type = typename Teuchos::ScalarTraits<SC>::coordinateType;
34 using realvaluedmultivector_type = Xpetra::MultiVector<real_type, LO, GO, Node>;
35 using device_type = typename Node::device_type;
36 using execution_space = typename Node::execution_space;
37 using impl_scalar_type = typename KokkosKernels::ArithTraits<real_type>::val_type;
38 using coord_view_type = typename Kokkos::View<impl_scalar_type**,
39 Kokkos::LayoutLeft,
41
43
44
47
51
52 RCP<const ParameterList> GetValidParameterList() const;
53
55
56
57 void DeclareInput(Level& fineLevel, Level& coarseLevel) const;
58
60
62
63
64 void Build(Level& fineLevel, Level& coarseLevel) const;
65 void BuildP(Level& fineLevel, Level& coarseLevel) const;
66
68
70
71
76
77 coarseCoordinatesBuilderFunctor(RCP<IndexManager_kokkos> geoData,
78 coord_view_type fineCoordView,
79 coord_view_type coarseCoordView);
80
81 KOKKOS_INLINE_FUNCTION
82 void operator()(const LO nodeIdx) const;
83
84 }; // struct coarseCoordinatesBuilderFunctor
85
87
88 void BuildConstantP(RCP<Matrix>& P, RCP<const CrsGraph>& prolongatorGraph, RCP<Matrix>& A) const;
89
90 private:
91 void BuildLinearP(RCP<Matrix>& A, RCP<const CrsGraph>& prolongatorGraph,
92 RCP<realvaluedmultivector_type>& fineCoordinates,
93 RCP<realvaluedmultivector_type>& ghostCoordinates,
94 const int numDimensions, RCP<Matrix>& P) const;
95 void ComputeLinearInterpolationStencil(const int numDimensions, const int numInterpolationPoints,
96 const Array<Array<real_type> > coord,
97 Array<real_type>& stencil) const;
98 void GetInterpolationFunctions(const LO numDimensions,
99 const Teuchos::SerialDenseVector<LO, real_type> parametricCoordinates,
100 real_type functions[4][8]) const;
101
102}; // class GeometricInterpolationPFactory_kokkos
103
104} // namespace MueLu
105
106#define MUELU_GEOMETRICINTERPOLATIONPFACTORY_KOKKOS_SHORT
107#endif // MUELU_GEOMETRICINTERPOLATIONPFACTORY_KOKKOS_DECL_HPP
typename KokkosKernels::ArithTraits< real_type >::val_type impl_scalar_type
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void ComputeLinearInterpolationStencil(const int numDimensions, const int numInterpolationPoints, const Array< Array< real_type > > coord, Array< real_type > &stencil) const
void GetInterpolationFunctions(const LO numDimensions, const Teuchos::SerialDenseVector< LO, real_type > parametricCoordinates, real_type functions[4][8]) const
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
void BuildP(Level &fineLevel, Level &coarseLevel) const
Abstract Build method.
typename Kokkos::View< impl_scalar_type **, Kokkos::LayoutLeft, device_type > coord_view_type
void BuildConstantP(RCP< Matrix > &P, RCP< const CrsGraph > &prolongatorGraph, RCP< Matrix > &A) const
void BuildLinearP(RCP< Matrix > &A, RCP< const CrsGraph > &prolongatorGraph, RCP< realvaluedmultivector_type > &fineCoordinates, RCP< realvaluedmultivector_type > &ghostCoordinates, const int numDimensions, RCP< Matrix > &P) const
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Container class for mesh layout and indices calculation.
Class that holds all level-specific information.
Factory that provides an interface for a concrete implementation of a prolongation operator.
Namespace for MueLu classes and methods.