LinSolver

This class is used to manage the Linear Solver. More…

#include "LinSolver.h"

Inherited by BiCGstab, PCG

Public Functions

Name
virtual ~LinSolver() =0
Deletes the object.
virtual void Set_Solver(MatrixProd &restrict MAT, DDMat &restrict RHS, MatrixProd &restrict PREC) =0
Sets the solver for monolithic preconditioning.
virtual void Set_Solver(MatrixProd &restrict MAT, DDMat &restrict RHS, MatrixProd &restrict PREC_L, MatrixProd &restrict PREC_R) =0
Sets the solver for split preconditioning.
void Set_rhs(MatrixProd &restrict MAT, DDMat &restrict RHS)
Sets the rhs array.
virtual void Solve(MatrixProd &restrict MAT, DDMat &restrict RHS, DDMat &restrict SOL, MatrixProd &restrict PREC, const string filename) =0
Solves the linear system with monolithic preconditioning.
virtual void Solve(MatrixProd &restrict MAT, DDMat &restrict RHS, DDMat &restrict SOL, MatrixProd &restrict PREC_L, MatrixProd &restrict PREC_R, const string filename) =0
Solves the linear system with split preconditioning.
void Set_maxITER(const iReg input_maxITER)
Sets the maximum number of iterations.
void Set_exitTOL(const rExt input_exitTOL)
Sets the exit tolerance.
void Set_final_sol_1(const bool input_final_sol_1)
Sets the flag to have the final solution = 1.
void Set_initial_sol(const iReg input_initial_sol)
Sets the flag for initial solution.
void Set_printConvProfile(const bool input_printConvProfile)
Sets the flag for Convergence Profile printing.

Public Attributes

Name
iReg maxITER
maximum number of iterations.
rExt exitTOL
exit tolerance.
bool final_sol_1
flag to set the final solution equal to one.
iReg initial_sol
flag to set the initial solution.
bool printConvProfile
flag for Convergence Profile printing.
DDMat RES
residual array.
DDMat SCR1
array for scratch 1.
iReg ITER
total number of iterations.
VEC< rExt > normRES0
euclidean norm of the initial residual.
VEC< rExt > normRES
euclidean norm of the final iterative residual.
VEC< rExt > normRESreal
euclidean norm of the final real residual.
VEC< rExt > normRHS
euclidean norm of the Right Hand Side.

Detailed Description

class LinSolver;

This class is used to manage the Linear Solver.

class LinSolver.

Public Functions Documentation

function ~LinSolver

virtual ~LinSolver() =0

Deletes the object.

function Set_Solver

virtual void Set_Solver(
    MatrixProd &__restrict__ MAT,
    DDMat &__restrict__ RHS,
    MatrixProd &__restrict__ PREC
) =0

Sets the solver for monolithic preconditioning.

Parameters:

  • MAT system matrix.
  • RHS Right Hand Sidde.
  • PREC preconditioner.

Reimplemented by: BiCGstab::Set_Solver, PCG::Set_Solver

function Set_Solver

virtual void Set_Solver(
    MatrixProd &__restrict__ MAT,
    DDMat &__restrict__ RHS,
    MatrixProd &__restrict__ PREC_L,
    MatrixProd &__restrict__ PREC_R
) =0

Sets the solver for split preconditioning.

Parameters:

  • MAT system matrix.
  • RHS Right Hand Sidde.
  • PREC_L LEFT preconditioner.
  • PREC_R RIGHT preconditioner.

Reimplemented by: BiCGstab::Set_Solver, PCG::Set_Solver

function Set_rhs

void Set_rhs(
    MatrixProd &__restrict__ MAT,
    DDMat &__restrict__ RHS
)

Sets the rhs array.

Parameters:

  • MAT system matrix.
  • [OUT] RHS Right Hand Side.

function Solve

virtual void Solve(
    MatrixProd &__restrict__ MAT,
    DDMat &__restrict__ RHS,
    DDMat &__restrict__ SOL,
    MatrixProd &__restrict__ PREC,
    const string filename
) =0

Solves the linear system with monolithic preconditioning.

Parameters:

  • MAT system matrix.
  • RHS system Right Hand Side.
  • SOL solution array.
  • PREC preconditioner.
  • filename file name where the convergence profile is printed.

Reimplemented by: BiCGstab::Solve, PCG::Solve

function Solve

virtual void Solve(
    MatrixProd &__restrict__ MAT,
    DDMat &__restrict__ RHS,
    DDMat &__restrict__ SOL,
    MatrixProd &__restrict__ PREC_L,
    MatrixProd &__restrict__ PREC_R,
    const string filename
) =0

Solves the linear system with split preconditioning.

Parameters:

  • MAT system matrix.
  • RHS system Right Hand Side.
  • SOL solution array.
  • PREC_L LEFT preconditioner.
  • PREC_R RIGHT preconditioner.
  • filename file name where the convergence profile is printed.

Reimplemented by: BiCGstab::Solve, PCG::Solve

function Set_maxITER

void Set_maxITER(
    const iReg input_maxITER
)

Sets the maximum number of iterations.

function Set_exitTOL

void Set_exitTOL(
    const rExt input_exitTOL
)

Sets the exit tolerance.

function Set_final_sol_1

void Set_final_sol_1(
    const bool input_final_sol_1
)

Sets the flag to have the final solution = 1.

function Set_initial_sol

void Set_initial_sol(
    const iReg input_initial_sol
)

Sets the flag for initial solution.

function Set_printConvProfile

void Set_printConvProfile(
    const bool input_printConvProfile
)

Sets the flag for Convergence Profile printing.

Public Attributes Documentation

variable maxITER

iReg maxITER;

maximum number of iterations.

variable exitTOL

rExt exitTOL;

exit tolerance.

variable final_sol_1

bool final_sol_1;

flag to set the final solution equal to one.

T → final solution = 1 : rhs = A x 1 F → final solution not available : rhs = 1

variable initial_sol

iReg initial_sol;

flag to set the initial solution.

0 → initial solution available : sol0 = Prec x rhs 1 → initial solution not available : sol0 = 0 2 → initial solution not available : sol0 = input

variable printConvProfile

bool printConvProfile;

flag for Convergence Profile printing.

variable RES

DDMat RES;

residual array.

variable SCR1

DDMat SCR1;

array for scratch 1.

variable ITER

iReg ITER;

total number of iterations.

variable normRES0

VEC< rExt > normRES0;

euclidean norm of the initial residual.

variable normRES

VEC< rExt > normRES;

euclidean norm of the final iterative residual.

variable normRESreal

VEC< rExt > normRESreal;

euclidean norm of the final real residual.

variable normRHS

VEC< rExt > normRHS;

euclidean norm of the Right Hand Side.


Updated on 12 February 2021 at 11:59:50 CET