OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
diagpre.h
Go to the documentation of this file.
1 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2 /* ******** *** SparseLib++ */
3 /* ******* ** *** *** *** v. 1.5c */
4 /* ***** *** ******** ******** */
5 /* ***** *** ******** ******** R. Pozo */
6 /* ** ******* *** ** *** *** K. Remington */
7 /* ******** ******** A. Lumsdaine */
8 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
9 /* */
10 /* */
11 /* SparseLib++ : Sparse Matrix Library */
12 /* */
13 /* National Institute of Standards and Technology */
14 /* University of Notre Dame */
15 /* Authors: R. Pozo, K. Remington, A. Lumsdaine */
16 /* */
17 /* NOTICE */
18 /* */
19 /* Permission to use, copy, modify, and distribute this software and */
20 /* its documentation for any purpose and without fee is hereby granted */
21 /* provided that the above notice appear in all copies and supporting */
22 /* documentation. */
23 /* */
24 /* Neither the Institutions (National Institute of Standards and Technology, */
25 /* University of Notre Dame) nor the Authors make any representations about */
26 /* the suitability of this software for any purpose. This software is */
27 /* provided ``as is'' without expressed or implied warranty. */
28 /* */
29 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
30 
31 #ifndef diagpre_h
32 #define diagpre_h
33 
34 #include "floatarray.h"
35 #include "sparsemtrx.h"
36 #include "precond.h"
37 
38 namespace oofem {
42 class OOFEM_EXPORT DiagPreconditioner : public Preconditioner
43 {
44 private:
46 
47 public:
49  DiagPreconditioner(const SparseMtrx &, InputRecord & attributes);
53  virtual ~DiagPreconditioner(void) { }
54 
55  virtual void init(const SparseMtrx &a);
56 
57  void solve(const FloatArray &rhs, FloatArray &solution) const;
58  void trans_solve(const FloatArray &rhs, FloatArray &solution) const;
59 
60  virtual const char *giveClassName() const { return "DiagPre"; }
61 
62  const double &diag(int i) const { return diag_(i); }
63  double &diag(int i) { return diag_(i); }
64 };
65 } // end namespace oofem
66 #endif // diagpre_h
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
DiagPreconditioner()
Constructor. The user should call initializeFrom and init services in this given order to ensure cons...
Definition: diagpre.h:51
const double & diag(int i) const
Definition: diagpre.h:62
Class representing vector of real numbers.
Definition: floatarray.h:82
Abstract class for IML++ compatible preconditioner.
Definition: precond.h:53
Class representing the general Input Record.
Definition: inputrecord.h:101
Implementation of diagonal preconditioner.
Definition: diagpre.h:42
double & diag(int i)
Definition: diagpre.h:63
virtual ~DiagPreconditioner(void)
Destructor.
Definition: diagpre.h:53
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual const char * giveClassName() const
Returns the preconditioner name.
Definition: diagpre.h:60

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:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011