OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::DiagPreconditioner Class Reference

Implementation of diagonal preconditioner. More...

#include <diagpre.h>

+ Inheritance diagram for oofem::DiagPreconditioner:
+ Collaboration diagram for oofem::DiagPreconditioner:

Public Member Functions

 DiagPreconditioner (const SparseMtrx &, InputRecord &attributes)
 Constructor. Initializes the the receiver (constructs the precontioning matrix M) of given matrix. More...
 
 DiagPreconditioner ()
 Constructor. The user should call initializeFrom and init services in this given order to ensure consistency. More...
 
virtual ~DiagPreconditioner (void)
 Destructor. More...
 
virtual void init (const SparseMtrx &a)
 Initializes the receiver (constructs the preconditioning matrix M) of given matrix. More...
 
void solve (const FloatArray &rhs, FloatArray &solution) const
 Solves the linear system. More...
 
void trans_solve (const FloatArray &rhs, FloatArray &solution) const
 Solves the transposed system. More...
 
virtual const char * giveClassName () const
 Returns the preconditioner name. More...
 
const double & diag (int i) const
 
double & diag (int i)
 
- Public Member Functions inherited from oofem::Preconditioner
 Preconditioner (const SparseMtrx &a, InputRecord &attributes)
 Constructor. More...
 
 Preconditioner ()
 Constructor. More...
 
virtual ~Preconditioner (void)
 Destructor. More...
 
FloatArray solve (const FloatArray &rhs) const
 Solves the linear system. More...
 
FloatArray trans_solve (const FloatArray &rhs) const
 Solves transposed system. More...
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver from given record. Empty implementation. More...
 

Private Attributes

FloatArray diag_
 

Detailed Description

Implementation of diagonal preconditioner.

Definition at line 42 of file diagpre.h.

Constructor & Destructor Documentation

oofem::DiagPreconditioner::DiagPreconditioner ( const SparseMtrx C,
InputRecord attributes 
)

Constructor. Initializes the the receiver (constructs the precontioning matrix M) of given matrix.

Definition at line 35 of file diagpre.C.

oofem::DiagPreconditioner::DiagPreconditioner ( )
inline

Constructor. The user should call initializeFrom and init services in this given order to ensure consistency.

Definition at line 51 of file diagpre.h.

virtual oofem::DiagPreconditioner::~DiagPreconditioner ( void  )
inlinevirtual

Destructor.

Definition at line 53 of file diagpre.h.

Member Function Documentation

const double& oofem::DiagPreconditioner::diag ( int  i) const
inline

Definition at line 62 of file diagpre.h.

Referenced by init(), solve(), and trans_solve().

double& oofem::DiagPreconditioner::diag ( int  i)
inline

Definition at line 63 of file diagpre.h.

virtual const char* oofem::DiagPreconditioner::giveClassName ( ) const
inlinevirtual

Returns the preconditioner name.

Reimplemented from oofem::Preconditioner.

Definition at line 60 of file diagpre.h.

void oofem::DiagPreconditioner::init ( const SparseMtrx a)
virtual

Initializes the receiver (constructs the preconditioning matrix M) of given matrix.

Virtual service, to be implemented by derived classes. Should be called after initializeFrom service.

Parameters
aSparse matrix to be preconditioned.

Reimplemented from oofem::Preconditioner.

Definition at line 41 of file diagpre.C.

References oofem::SparseMtrx::at(), diag(), diag_, oofem::SparseMtrx::giveNumberOfRows(), OOFEM_ERROR, oofem::FloatArray::resize(), and oofem::FloatArray::zero().

void oofem::DiagPreconditioner::solve ( const FloatArray rhs,
FloatArray solution 
) const
virtual

Solves the linear system.

Parameters
rhsRight hand side.
solutionSolution.

Implements oofem::Preconditioner.

Definition at line 61 of file diagpre.C.

References diag(), oofem::FloatArray::giveSize(), and oofem::FloatArray::resize().

void oofem::DiagPreconditioner::trans_solve ( const FloatArray rhs,
FloatArray solution 
) const
virtual

Solves the transposed system.

Parameters
rhsRight hand side.
solutionSolution.

Implements oofem::Preconditioner.

Definition at line 71 of file diagpre.C.

References diag(), oofem::FloatArray::giveSize(), and oofem::FloatArray::resize().

Member Data Documentation

FloatArray oofem::DiagPreconditioner::diag_
private

Definition at line 45 of file diagpre.h.

Referenced by init().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:34 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011