MFEM v2.0
Functions
pcgsolver.cpp File Reference
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include "vector.hpp"
#include "matrix.hpp"
#include "sparsemat.hpp"
Include dependency graph for pcgsolver.cpp:

Go to the source code of this file.

Functions

void PCG (const Operator &A, const Operator &B, const Vector &b, Vector &x, int print_iter=0, int max_num_iter=1000, double RTOLERANCE=10e-12, double ATOLERANCE=10e-24, int save=0)
void SLI (const Operator &A, const Operator &B, const Vector &b, Vector &x, int print_iter=0, int max_num_iter=1000, double RTOLERANCE=10e-12, double ATOLERANCE=10e-24)
 Stationary linear iteration: x <- x + B (b - A x)

Function Documentation

void PCG ( const Operator A,
const Operator B,
const Vector b,
Vector x,
int  print_iter = 0,
int  max_num_iter = 1000,
double  RTOLERANCE = 10e-12,
double  ATOLERANCE = 10e-24,
int  save = 0 
)

Preconditioned conjugate gradient method. Given Matrix A, preconditioner Matrix B, vector b and initial guess x, iteratively solve A x = b. When the default arguments are used PCG doesn't print current residuals and number of iterations, maximum number of iterations is 1000, the relative tolerance is 10e-12 and the absolute tolerance is 10e-24. Remark : if no better initial guess is available, the user may set it as B b (since not done in PCG routine).

Definition at line 22 of file pcgsolver.cpp.

References add(), Operator::Mult(), Vector::Print(), Vector::Size(), and subtract().

Referenced by main().

void SLI ( const Operator A,
const Operator B,
const Vector b,
Vector x,
int  print_iter = 0,
int  max_num_iter = 1000,
double  RTOLERANCE = 10e-12,
double  ATOLERANCE = 10e-24 
)

Stationary linear iteration: x <- x + B (b - A x)

Definition at line 115 of file pcgsolver.cpp.

References add(), Operator::Mult(), Vector::Size(), and subtract().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines