MFEM  v3.3
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Attributes | List of all members
mfem::PetscSolver Class Reference

Abstract class for PETSc's solvers. More...

#include <petsc.hpp>

Inheritance diagram for mfem::PetscSolver:
[legend]
Collaboration diagram for mfem::PetscSolver:
[legend]

Public Member Functions

 PetscSolver ()
 Construct an empty PetscSolver. Initialize protected objects to NULL. More...
 
virtual ~PetscSolver ()
 Destroy the PetscParVectors allocated (if any). More...
 
void Customize (bool customize=true) const
 Customize object with options set. More...
 
int GetConverged ()
 
int GetNumIterations ()
 
double GetFinalNorm ()
 
void SetMonitor (PetscSolverMonitor *ctx)
 Sets user-defined monitoring routine. More...
 
 operator PetscObject () const
 Conversion function to PetscObject. More...
 
Update of PETSc options.

The following Set methods can be used to update the internal PETSc options.

Note
They will be overwritten by the options in the input PETSc file.
void SetTol (double tol)
 
void SetRelTol (double tol)
 
void SetAbsTol (double tol)
 
void SetMaxIter (int max_iter)
 
void SetPrintLevel (int plev)
 

Protected Attributes

bool clcustom
 Boolean to handle SetFromOptions calls. More...
 
PetscObject obj
 The actual PETSc object (KSP, PC, SNES or TS). More...
 
PetscClassId cid
 The class id of the actual PETSc object. More...
 
PetscParVectorB
 Right-hand side and solution vector. More...
 
PetscParVectorX
 
PetscSolverMonitormonitor_ctx
 Monitor context. More...
 
bool operatorset
 Boolean to handle SetOperator calls. More...
 

Detailed Description

Abstract class for PETSc's solvers.

Definition at line 321 of file petsc.hpp.

Constructor & Destructor Documentation

mfem::PetscSolver::PetscSolver ( )

Construct an empty PetscSolver. Initialize protected objects to NULL.

Definition at line 1196 of file petsc.cpp.

mfem::PetscSolver::~PetscSolver ( )
virtual

Destroy the PetscParVectors allocated (if any).

Definition at line 1205 of file petsc.cpp.

Member Function Documentation

void mfem::PetscSolver::Customize ( bool  customize = true) const

Customize object with options set.

If customize is false, it disables any options customization.

Definition at line 1380 of file petsc.cpp.

int mfem::PetscSolver::GetConverged ( )

Definition at line 1413 of file petsc.cpp.

double mfem::PetscSolver::GetFinalNorm ( )

Definition at line 1479 of file petsc.cpp.

int mfem::PetscSolver::GetNumIterations ( )

Definition at line 1446 of file petsc.cpp.

mfem::PetscSolver::operator PetscObject ( ) const
inline

Conversion function to PetscObject.

Definition at line 372 of file petsc.hpp.

void mfem::PetscSolver::SetAbsTol ( double  tol)

Definition at line 1241 of file petsc.cpp.

void mfem::PetscSolver::SetMaxIter ( int  max_iter)

Definition at line 1266 of file petsc.cpp.

void mfem::PetscSolver::SetMonitor ( PetscSolverMonitor ctx)

Sets user-defined monitoring routine.

Definition at line 1374 of file petsc.cpp.

void mfem::PetscSolver::SetPrintLevel ( int  plev)

Definition at line 1293 of file petsc.cpp.

void mfem::PetscSolver::SetRelTol ( double  tol)

Definition at line 1216 of file petsc.cpp.

void mfem::PetscSolver::SetTol ( double  tol)

Definition at line 1211 of file petsc.cpp.

Member Data Documentation

PetscParVector* mfem::PetscSolver::B
mutableprotected

Right-hand side and solution vector.

Definition at line 334 of file petsc.hpp.

PetscClassId mfem::PetscSolver::cid
protected

The class id of the actual PETSc object.

Definition at line 331 of file petsc.hpp.

bool mfem::PetscSolver::clcustom
mutableprotected

Boolean to handle SetFromOptions calls.

Definition at line 325 of file petsc.hpp.

PetscSolverMonitor* mfem::PetscSolver::monitor_ctx
protected

Monitor context.

Definition at line 337 of file petsc.hpp.

PetscObject mfem::PetscSolver::obj
protected

The actual PETSc object (KSP, PC, SNES or TS).

Definition at line 328 of file petsc.hpp.

bool mfem::PetscSolver::operatorset
mutableprotected

Boolean to handle SetOperator calls.

Definition at line 340 of file petsc.hpp.

PetscParVector * mfem::PetscSolver::X
mutableprotected

Definition at line 334 of file petsc.hpp.


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