OOFEM 3.0
Loading...
Searching...
No Matches
oofem::DiagPreconditioner Class Reference

#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.
 DiagPreconditioner ()
 Constructor. The user should call initializeFrom and init services in this given order to ensure consistency.
virtual ~DiagPreconditioner (void)
 Destructor.
void init (const SparseMtrx &a) override
void solve (const FloatArray &rhs, FloatArray &solution) const override
void trans_solve (const FloatArray &rhs, FloatArray &solution) const override
const char * giveClassName () const override
 Returns the preconditioner name.
Public Member Functions inherited from oofem::Preconditioner
 Preconditioner (const SparseMtrx &a, InputRecord &attributes)
 Preconditioner ()
virtual ~Preconditioner (void)
 Destructor.
FloatArray solve (const FloatArray &rhs) const
FloatArray trans_solve (const FloatArray &rhs) const
virtual void initializeFrom (InputRecord &ir)
 Initializes receiver from given record. Empty implementation.

Private Attributes

FloatArray diag

Detailed Description

Implementation of diagonal preconditioner

Definition at line 42 of file diagpre.h.

Constructor & Destructor Documentation

◆ DiagPreconditioner() [1/2]

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.

References diag, and oofem::Preconditioner::Preconditioner().

◆ DiagPreconditioner() [2/2]

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.

References oofem::Preconditioner::Preconditioner().

◆ ~DiagPreconditioner()

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

Destructor.

Definition at line 53 of file diagpre.h.

Member Function Documentation

◆ giveClassName()

const char * oofem::DiagPreconditioner::giveClassName ( ) const
inlineoverridevirtual

Returns the preconditioner name.

Reimplemented from oofem::Preconditioner.

Definition at line 60 of file diagpre.h.

◆ init()

void oofem::DiagPreconditioner::init ( const SparseMtrx & a)
overridevirtual

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, oofem::SparseMtrx::giveNumberOfRows(), and OOFEM_ERROR.

◆ solve()

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

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().

◆ trans_solve()

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

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

◆ diag

FloatArray oofem::DiagPreconditioner::diag
private

Definition at line 45 of file diagpre.h.

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


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011