chrono::fsi::ChFsiLinearSolver Class Referenceabstract


Base class of the FSI GPU-based linear solvers.

This is an abstract class and specific solvers must implement the solve procedure

#include <ChFsiLinearSolver.h>

Inheritance diagram for chrono::fsi::ChFsiLinearSolver:

Public Types

enum  SolverType {

Public Member Functions

 ChFsiLinearSolver (double mrel_res=1e-8, double mabs_res=1e-4, int mmax_iter=1000, bool mverbose=false)
 Constructor of the ChFsiLinearSolver. More...
virtual SolverType GetType ()=0
 Return type of the solver. Derived classes should override this function.
void SetVerbose (bool mv)
 Set verbose output from solver.
bool GetVerbose () const
 Return whether or not verbose output is enabled.
double GetResidual ()
 Return the current residual.
int GetNumIterations ()
 Return the number of current Iterations.
void SetIterationLimit (int numIter)
 Set and Get for the max_iter.
int GetIterationLimit ()
void SetAbsRes (double mabs_res)
 Set and Get for the abs_res and.
double GetAbsRes ()
void SetRelRes (double mrel_res)
double GetRelRes ()
int GetSolverStatus ()
 Return the solver status 0: unsuccessful 1: successfully converged.
virtual void Solve (int SIZE, int NNZ, double *A, unsigned int *ArowIdx, unsigned int *AcolIdx, double *x, double *b)=0
 The child class should override this function and solve for x. More...

Protected Attributes

double rel_res = 1e-3
double abs_res = 1e-6
int max_iter = 500
bool verbose = false
int Iterations = 0
double residual = 1e5
int solver_status = 0

Constructor & Destructor Documentation

chrono::fsi::ChFsiLinearSolver::ChFsiLinearSolver ( double  mrel_res = 1e-8,
double  mabs_res = 1e-4,
int  mmax_iter = 1000,
bool  mverbose = false 

Constructor of the ChFsiLinearSolver.

mrel_resrelative residual of the linear solver
mabs_resabsolute residual of the linear solver
mmax_iterMaximum number of iteration of the linear solver
mverboseVerbosity of solver during each solve stage

Member Function Documentation

virtual void chrono::fsi::ChFsiLinearSolver::Solve ( int  SIZE,
int  NNZ,
double *  A,
unsigned int *  ArowIdx,
unsigned int *  AcolIdx,
double *  x,
double *  b 
pure virtual

The child class should override this function and solve for x.

SIZEsize of the matrix in Ax=b
NNZnumber of nonzeros in A matrix
Apointer to the matrix A stored in CSR format
ArowIdxaccumulation of NNZ of each row of matrix A
AcolIdxcolumn index of each element of A and hence is of length NNZ
xpointer to the solution vector x
bpointer to the solution right hand side vector b in Ax=b

Implemented in chrono::fsi::ChFsiLinearSolverBiCGStab.