1#ifndef SRC_SOLVERS_NATIVE_PETSC_SOLVER_HPP_
2#define SRC_SOLVERS_NATIVE_PETSC_SOLVER_HPP_
33 template <
typename NumericT,
typename VectorType>
46 PETSC_HANDLER &ref = PETSC_HANDLER::get_handler (
config.getArgc (),
56 PETSC_VECTOR Bp (b, Ap);
62 KSPConvergedReason reason = Ap.get_Creason ();
65 log::info<log_linear_solver> () <<
"Divergence.\n";
69 log::info<log_linear_solver> () <<
"Convergence in"
70 << Ap.get_Citer () <<
"iterations." << std::endl;
73 VectorType newVector(Bp);
74 printf (
"\n [%d]Solver Time (%d): %f Reason %d\n",ref.getRankW(),Ap.get_Citer() ,stopwatch.
get (),reason);
Defines a set of checker functors for micro-tests within ViennaSHE.
The main SHE configuration class. To be adjusted by the user for his/her needs.
Sparse matrix class based on a vector of binary trees for holding the entries.
Wrapper class to the PETSC matrix.
Class Encapsulate The PETSc COMM WORLD -Should be singleton.
A configuration class holding options for use within the different linear solvers.
Internal tag used for the specification of a CPU-based PETSC solver.
void start()
Starts the timer.
double get() const
Returns the number of seconds elapsed.
Implementation of various utilities related to linear algebra.
A logging facility providing fine-grained control over logging in ViennaSHE.
std::vector< double > solve(viennashe::math::sparse_matrix< double > &A, std::vector< double > const &b, linear_solver_config const &config)
Public interface for solving a system of linear equations represented using a sparse matrix.
The main ViennaSHE namespace. All functionality resides inside this namespace.
The SHE configuration class is defined here.
Defines all the log keys used within the viennashe::solvers namespace.
Contains a timer class. Contains one windows implementation and one *NIX implementation.