Ifpack2 Templated Preconditioning Package Version 1.0
Loading...
Searching...
No Matches
Ifpack2_Details_Fildl_def.hpp
1// @HEADER
2// *****************************************************************************
3// Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4//
5// Copyright 2009 NTESS and the Ifpack2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
11
12#ifndef __IFPACK2_FILDL_DEF_HPP__
13#define __IFPACK2_FILDL_DEF_HPP__
14
15#include "Ifpack2_Details_Fildl_decl.hpp"
17#include <Kokkos_Timer.hpp>
18#include <shylu_fastildl.hpp>
19
20namespace Ifpack2
21{
22namespace Details
23{
24
25template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
27Fildl(Teuchos::RCP<const TRowMatrix> A) :
28 FastILU_Base<Scalar, LocalOrdinal, GlobalOrdinal, Node>(A) {}
29
30template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
32getSweeps() const
33{
34 return localPrec_->getNFact();
35}
36
37template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
39getSpTrsvType() const
40{
41 return localPrec_->getSpTrsvType();
42}
43
44template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
46getNTrisol() const
47{
48 return localPrec_->getNTrisol();
49}
50
51template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
53checkLocalIC() const
54{
55 localPrec_->checkIC();
56}
57
58template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
61{
62 auto nRows = this->mat_->getLocalNumRows();
63 auto& p = this->params_;
64 localPrec_ = Teuchos::rcp(new LocalFILDL(this->localRowPtrs_, this->localColInds_, this->localValues_, nRows, (p.sptrsv_algo != FastILU::SpTRSV::Fast),
65 p.nFact, p.nTrisol, p.level, p.omega, p.shift, p.guessFlag ? 1 : 0, p.blockSizeILU, p.blockSize));
66 localPrec_->initialize();
67 this->initTime_ = localPrec_->getInitializeTime();
68}
69
70template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
73{
74 //update values in local prec (until compute(), values aren't needed)
75 localPrec_->setValues(this->localValues_);
76 localPrec_->compute();
77 this->computeTime_ = localPrec_->getComputeTime();
78}
79
80template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
82applyLocalPrec(ImplScalarArray x, ImplScalarArray y) const
83{
84 localPrec_->apply(x, y);
85 //since this may be applied to multiple vectors, add to applyTime_ instead of setting it
86 this->applyTime_ += localPrec_->getApplyTime();
87}
88
89template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
91getName() const
92{
93 return "Fildl";
94}
95
96#define IFPACK2_DETAILS_FILDL_INSTANT(S, L, G, N) \
97template class Ifpack2::Details::Fildl<S, L, G, N>;
98
99} //namespace Details
100} //namespace Ifpack2
101
102#endif
103
Provides functions for retrieving local CRS arrays (row pointers, column indices, and values) from Tp...
FastILU_Base(Teuchos::RCP< const TRowMatrix > mat_)
Constructor.
Definition Ifpack2_Details_FastILU_Base_def.hpp:31
void applyLocalPrec(ImplScalarArray x, ImplScalarArray y) const
Apply the local preconditioner with 1-D views of the local parts of X and Y (one vector only).
Definition Ifpack2_Details_Fildl_def.hpp:82
void computeLocalPrec()
Get values array from the matrix and then call compute() on the underlying preconditioner.
Definition Ifpack2_Details_Fildl_def.hpp:72
int getSweeps() const
Get the sweeps ("nFact") from localPrec_.
Definition Ifpack2_Details_Fildl_def.hpp:32
Fildl(Teuchos::RCP< const TRowMatrix > mat_)
Constructor.
Definition Ifpack2_Details_Fildl_def.hpp:27
std::string getName() const
Get the name of the underlying preconditioner ("Filu", "Fildl" or "Fic").
Definition Ifpack2_Details_Fildl_def.hpp:91
std::string getSpTrsvType() const
Get the name of triangular solve algorithm.
Definition Ifpack2_Details_Fildl_def.hpp:39
int getNTrisol() const
Get the number of triangular solves ("nTrisol") from localPrec_.
Definition Ifpack2_Details_Fildl_def.hpp:46
void checkLocalIC() const
Verify and print debug info about the internal IC preconditioner.
Definition Ifpack2_Details_Fildl_def.hpp:53
void initLocalPrec()
Construct the underlying preconditioner (localPrec_) using given params and then call localPrec_->ini...
Definition Ifpack2_Details_Fildl_def.hpp:60
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41