Class PETScLinearSolver

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class PETScLinearSolver : public opensn::LinearSystemSolver

Subclassed by opensn::WGSLinearSolver

Public Functions

PETScLinearSolver(IterativeMethod method, std::shared_ptr<LinearSystemContext> context_ptr)
~PETScLinearSolver() override
inline ToleranceOptions &GetToleranceOptions()
void ApplyToleranceOptions()
inline void SetKSPSolveSuppressionFlag(bool flag)

Sets a flag to suppress the KSPSolve() method from being called.

inline bool GetKSPSolveSuppressionFlag() const
virtual void Setup() override

Set up the linaer solver.

virtual void Solve() override

Solve the system.

Public Members

struct opensn::PETScLinearSolver::ToleranceOptions tolerance_options

Protected Functions

inline bool IsSystemSet() const
virtual void PreSetupCallback()
virtual void SetOptions()
virtual void SetSolverContext()
virtual void SetConvergenceTest()
virtual void SetMonitor()
virtual void SetPreconditioner()
virtual void SetSystemSize() = 0
virtual void SetSystem() = 0
virtual void PostSetupCallback()
virtual void PreSolveCallback()
virtual void SetInitialGuess() = 0
virtual void SetRHS() = 0
virtual void PostSolveCallback()

Protected Attributes

Mat A_
Vec b_
Vec x_
KSP ksp_
int64_t num_local_dofs_
int64_t num_global_dofs_

Protected Static Functions

static int LinearSolverMatrixAction(Mat matrix, Vec vector, Vec action)
struct ToleranceOptions

Public Members

double residual_relative = 1.0e-50
double residual_absolute = 1.0e-6
double residual_divergence = 1.0e6
int maximum_iterations = 100
int gmres_restart_interval = 100
double gmres_breakdown_tolerance = 1.0e6