OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
precond.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef precond_h
36 #define precond_h
37 
38 #include "oofemcfg.h"
39 #include "floatarray.h"
40 #include "sparsemtrx.h"
41 #include "inputrecord.h"
42 
43 namespace oofem {
53 class OOFEM_EXPORT Preconditioner
54 {
55 public:
63  Preconditioner(const SparseMtrx & a, InputRecord & attributes);
70  virtual ~Preconditioner(void) { }
71 
77  virtual void init(const SparseMtrx &a) { }
78 
84  FloatArray solve(const FloatArray &rhs) const {
85  FloatArray y;
86  this->solve(rhs, y);
87  return y;
88  }
94  FloatArray trans_solve(const FloatArray &rhs) const {
95  FloatArray y;
96  this->trans_solve(rhs, y);
97  return y;
98  }
104  virtual void solve(const FloatArray &rhs, FloatArray &solution) const = 0;
110  virtual void trans_solve(const FloatArray &rhs, FloatArray &solution) const = 0;
111 
113  virtual const char *giveClassName() const { return "Preconditioner"; }
116 };
117 } // end namespace oofem
118 #endif // precond_h
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
FloatArray trans_solve(const FloatArray &rhs) const
Solves transposed system.
Definition: precond.h:94
Preconditioner()
Constructor.
Definition: precond.h:68
virtual void init(const SparseMtrx &a)
Initializes the receiver (constructs the preconditioning matrix M) of given matrix.
Definition: precond.h:77
FloatArray solve(const FloatArray &rhs) const
Solves the linear system.
Definition: precond.h:84
Class representing vector of real numbers.
Definition: floatarray.h:82
Abstract class for IML++ compatible preconditioner.
Definition: precond.h:53
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual const char * giveClassName() const
Returns the preconditioner name.
Definition: precond.h:113
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual ~Preconditioner(void)
Destructor.
Definition: precond.h:70
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver from given record. Empty implementation.
Definition: precond.h:115

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