VMTK
Loading...
Searching...
No Matches
vtkvmtkLinearSystemSolver Class Reference

Serves as the base class for linear-system-of-equations solver implementations. More...

#include <vtkvmtkLinearSystemSolver.h>

Inheritance diagram for vtkvmtkLinearSystemSolver:
[legend]
Collaboration diagram for vtkvmtkLinearSystemSolver:
[legend]

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkLinearSystemSolver * NewInstance () const
virtual int Solve ()
virtual void SetLinearSystem (vtkvmtkLinearSystem *)
virtual vtkvmtkLinearSystem * GetLinearSystem ()
virtual void SetMaximumNumberOfIterations (int)
virtual int GetMaximumNumberOfIterations ()
virtual void SetConvergenceTolerance (double)
virtual double GetConvergenceTolerance ()

Static Public Member Functions

static vtkvmtkLinearSystemSolver * New ()
static int IsTypeOf (const char *type)
static vtkvmtkLinearSystemSolver * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkLinearSystemSolver ()
 ~vtkvmtkLinearSystemSolver ()

Protected Attributes

vtkvmtkLinearSystem * LinearSystem
int MaximumNumberOfIterations
double ConvergenceTolerance
int NumberOfIterations
double Residual

Detailed Description

Serves as the base class for linear-system-of-equations solver implementations.

vtkvmtkLinearSystemSolver defines the common interface and iteration control parameters (MaximumNumberOfIterations, ConvergenceTolerance) for iterative solvers of a vtkvmtkLinearSystem. This base class implementation of Solve() only validates that LinearSystem is set and internally consistent (via vtkvmtkLinearSystem::CheckSystem()); concrete subclasses override Solve() to actually iterate towards a solution, updating NumberOfIterations and Residual as they progress.

See also
vtkvmtkLinearSystem, vtkvmtkFEAssembler

Definition at line 39 of file vtkvmtkLinearSystemSolver.h.

Member Typedef Documentation

◆ Superclass

Definition at line 43 of file vtkvmtkLinearSystemSolver.h.

Constructor & Destructor Documentation

◆ vtkvmtkLinearSystemSolver()

vtkvmtkLinearSystemSolver::vtkvmtkLinearSystemSolver ( )
protected

◆ ~vtkvmtkLinearSystemSolver()

vtkvmtkLinearSystemSolver::~vtkvmtkLinearSystemSolver ( )
protected

Definition at line 40 of file vtkvmtkLinearSystemSolver.cxx.

41{
42 if (this->LinearSystem)
43 {
44 this->LinearSystem->Delete();
45 this->LinearSystem = NULL;
46 }
47}

Member Function Documentation

◆ New()

vtkvmtkLinearSystemSolver * vtkvmtkLinearSystemSolver::New ( )
static

◆ IsTypeOf()

int vtkvmtkLinearSystemSolver::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkLinearSystemSolver::IsA ( const char * type)
virtual

◆ SafeDownCast()

vtkvmtkLinearSystemSolver * vtkvmtkLinearSystemSolver::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkLinearSystemSolver::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkLinearSystemSolver * vtkvmtkLinearSystemSolver::NewInstance ( ) const

◆ SetLinearSystem()

virtual void vtkvmtkLinearSystemSolver::SetLinearSystem ( vtkvmtkLinearSystem * )
virtual

Set/get the linear system to be solved.

◆ GetLinearSystem()

virtual vtkvmtkLinearSystem * vtkvmtkLinearSystemSolver::GetLinearSystem ( )
virtual

Set/get the linear system to be solved.

◆ SetMaximumNumberOfIterations()

virtual void vtkvmtkLinearSystemSolver::SetMaximumNumberOfIterations ( int )
virtual

Set/get the maximum number of iterations an iterative solver subclass is allowed to perform before giving up. Default: a very large integer (effectively unlimited).

◆ GetMaximumNumberOfIterations()

virtual int vtkvmtkLinearSystemSolver::GetMaximumNumberOfIterations ( )
virtual

Set/get the maximum number of iterations an iterative solver subclass is allowed to perform before giving up. Default: a very large integer (effectively unlimited).

◆ SetConvergenceTolerance()

virtual void vtkvmtkLinearSystemSolver::SetConvergenceTolerance ( double )
virtual

Set/get the residual tolerance at which an iterative solver subclass considers the system to have converged. Default: 1E-4.

◆ GetConvergenceTolerance()

virtual double vtkvmtkLinearSystemSolver::GetConvergenceTolerance ( )
virtual

Set/get the residual tolerance at which an iterative solver subclass considers the system to have converged. Default: 1E-4.

◆ Solve()

int vtkvmtkLinearSystemSolver::Solve ( )
virtual

Solve LinearSystem. This base class implementation only checks that LinearSystem is set and consistent (returning -1 and emitting an error if not); subclasses override this method to perform the actual solve, storing the number of iterations and residual reached in NumberOfIterations / Residual, and returning 0 on success or -1 on failure.

Reimplemented in vtkvmtkOpenNLLinearSystemSolver.

Definition at line 49 of file vtkvmtkLinearSystemSolver.cxx.

50{
51 if (this->LinearSystem==NULL)
52 {
53 vtkErrorMacro(<< "Linear system not set!");
54 return -1;
55 }
56
57 if (this->LinearSystem->CheckSystem()==-1)
58 {
59 return -1;
60 }
61
62 return 0;
63}

Member Data Documentation

◆ LinearSystem

vtkvmtkLinearSystem* vtkvmtkLinearSystemSolver::LinearSystem
protected

Definition at line 83 of file vtkvmtkLinearSystemSolver.h.

◆ MaximumNumberOfIterations

int vtkvmtkLinearSystemSolver::MaximumNumberOfIterations
protected

Definition at line 85 of file vtkvmtkLinearSystemSolver.h.

◆ ConvergenceTolerance

double vtkvmtkLinearSystemSolver::ConvergenceTolerance
protected

Definition at line 86 of file vtkvmtkLinearSystemSolver.h.

◆ NumberOfIterations

int vtkvmtkLinearSystemSolver::NumberOfIterations
protected

Definition at line 88 of file vtkvmtkLinearSystemSolver.h.

◆ Residual

double vtkvmtkLinearSystemSolver::Residual
protected

Definition at line 89 of file vtkvmtkLinearSystemSolver.h.


The documentation for this class was generated from the following files: