MFEM  v4.3.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected 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:
Collaboration diagram for mfem::PetscSolver:

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...
void SetBCHandler (PetscBCHandler *bch)
 Sets the object to handle essential boundary conditions. More...
void SetPreconditionerFactory (PetscPreconditionerFactory *factory)
 Sets the object for the creation of the preconditioner. More...
 operator PetscObject () const
 Conversion function to PetscObject. More...
MPI_Comm GetComm () const
 Get the associated MPI communicator. More...
Update of PETSc options.

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

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 Member Functions

void CreatePrivateContext ()
void FreePrivateContext ()

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...
 Right-hand side and solution vector. More...
 Handler for boundary conditions. More...
void * private_ctx
 Private context for solver. More...
bool operatorset
 Boolean to handle SetOperator calls. More...

Detailed Description

Abstract class for PETSc's solvers.

Definition at line 648 of file petsc.hpp.

Constructor & Destructor Documentation

mfem::PetscSolver::PetscSolver ( )

Construct an empty PetscSolver. Initialize protected objects to NULL.

Definition at line 2275 of file petsc.cpp.

mfem::PetscSolver::~PetscSolver ( )

Destroy the PetscParVectors allocated (if any).

Definition at line 2285 of file petsc.cpp.

Member Function Documentation

void mfem::PetscSolver::CreatePrivateContext ( )

These two methods handle creation and destructions of private data for the Solver objects

Definition at line 2673 of file petsc.cpp.

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 2549 of file petsc.cpp.

void mfem::PetscSolver::FreePrivateContext ( )

Definition at line 2705 of file petsc.cpp.

MPI_Comm mfem::PetscSolver::GetComm ( ) const

Get the associated MPI communicator.

Definition at line 2454 of file petsc.cpp.

int mfem::PetscSolver::GetConverged ( )

Definition at line 2582 of file petsc.cpp.

double mfem::PetscSolver::GetFinalNorm ( )

Definition at line 2648 of file petsc.cpp.

int mfem::PetscSolver::GetNumIterations ( )

Definition at line 2615 of file petsc.cpp.

mfem::PetscSolver::operator PetscObject ( ) const

Conversion function to PetscObject.

Definition at line 708 of file petsc.hpp.

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

Definition at line 2322 of file petsc.cpp.

void mfem::PetscSolver::SetBCHandler ( PetscBCHandler bch)

Sets the object to handle essential boundary conditions.

Definition at line 2489 of file petsc.cpp.

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

Definition at line 2347 of file petsc.cpp.

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

Sets user-defined monitoring routine.

Definition at line 2459 of file petsc.cpp.

void mfem::PetscSolver::SetPreconditionerFactory ( PetscPreconditionerFactory factory)

Sets the object for the creation of the preconditioner.

Definition at line 2508 of file petsc.cpp.

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

Definition at line 2374 of file petsc.cpp.

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

Definition at line 2297 of file petsc.cpp.

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

Definition at line 2292 of file petsc.cpp.

Member Data Documentation

PetscParVector* mfem::PetscSolver::B

Right-hand side and solution vector.

Definition at line 661 of file petsc.hpp.

PetscBCHandler* mfem::PetscSolver::bchandler

Handler for boundary conditions.

Definition at line 664 of file petsc.hpp.

PetscClassId mfem::PetscSolver::cid

The class id of the actual PETSc object.

Definition at line 658 of file petsc.hpp.

bool mfem::PetscSolver::clcustom

Boolean to handle SetFromOptions calls.

Definition at line 652 of file petsc.hpp.

PetscObject mfem::PetscSolver::obj

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

Definition at line 655 of file petsc.hpp.

bool mfem::PetscSolver::operatorset

Boolean to handle SetOperator calls.

Definition at line 670 of file petsc.hpp.

void* mfem::PetscSolver::private_ctx

Private context for solver.

Definition at line 667 of file petsc.hpp.

PetscParVector * mfem::PetscSolver::X

Definition at line 661 of file petsc.hpp.

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