Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
- use ParILU
- documentation

Co-authored-by: Marcel Koch <[email protected]>
Co-authored-by: Yuhsiang M. Tsai <[email protected]>
Co-authored-by: Pratik Nayak <[email protected]>
  • Loading branch information
4 people committed Dec 2, 2023
1 parent ca1aa2e commit abe1701
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 2 additions & 0 deletions examples/reordered-preconditioned-solver/doc/intro.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

<h3> About the example </h3>

This uses an RCM reordering on an input matrix to construct
a ParILU preconditioned solver and solve a linear system.
2 changes: 0 additions & 2 deletions examples/reordered-preconditioned-solver/doc/results.dox
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ Residual norm sqrt(r^T r):
4.82005e-08

@endcode

<h3> Comments about programming and debugging </h3>
2 changes: 1 addition & 1 deletion examples/reordered-preconditioned-solver/doc/tooltip
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Use a reordering in Ginkgo. Solve a linear system with a preconditioner.
Use a reordering in Ginkgo. Solve a reordered linear system with a preconditioner.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
//
// SPDX-License-Identifier: BSD-3-Clause


#include <ginkgo/ginkgo.hpp>


#include <fstream>
#include <iostream>
#include <map>
#include <string>
#include "ginkgo/core/matrix/permutation.hpp"


#include <ginkgo/ginkgo.hpp>


int main(int argc, char* argv[])
Expand All @@ -24,7 +22,10 @@ int main(int argc, char* argv[])
using real_vec = gko::matrix::Dense<RealValueType>;
using mtx = gko::matrix::Csr<ValueType, IndexType>;
using cg = gko::solver::Cg<ValueType>;
using bj = gko::preconditioner::Jacobi<ValueType, IndexType>;
using ilu =
gko::preconditioner::Ilu<gko::solver::LowerTrs<ValueType, IndexType>,
gko::solver::UpperTrs<ValueType, IndexType>,
false, IndexType>;

// Print version information
std::cout << gko::version_info::get() << std::endl;
Expand Down Expand Up @@ -81,9 +82,7 @@ int main(int argc, char* argv[])
.with_criteria(gko::stop::Iteration::build().with_max_iters(20u),
gko::stop::ResidualNorm<ValueType>::build()
.with_reduction_factor(reduction_factor))
// Add preconditioner, these 2 lines are the only
// difference from the simple solver example
.with_preconditioner(bj::build().with_max_block_size(8u))
.with_preconditioner(ilu::build())
.on(exec);
// Create solver
auto solver = solver_gen->generate(A_reordered);
Expand Down

0 comments on commit abe1701

Please sign in to comment.