OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
ilucomprowprecond.C
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 #include "dyncomprow.h"
36 #include "ilucomprowprecond.h"
37 #include "verbose.h"
38 
39 namespace oofem {
41 CompRow_ILUPreconditioner(const SparseMtrx &A, InputRecord &attributes) : Preconditioner(A, attributes)
42 { }
43 
46 {
47  IRResultType result; // Required by IR_GIVE_FIELD macro
48 
49  this->drop_tol = 1.e-8;
51 
52  part_fill = 5;
54 
56 }
57 
58 
59 void
61 {
62  if ( dynamic_cast< const DynCompRow *>(& A) ) {
63  this->A = ( * ( ( DynCompRow * ) & A ) );
64  ( this->A ).ILUPYourself(part_fill, drop_tol);
65  } else {
66  OOFEM_ERROR("unsupported sparse matrix type");
67  }
68 }
69 
70 void
72 {
73  A.ILUPsolve(x, y);
74 }
75 
76 
77 void
79 {
80  A.ILUPtrans_solve(x, y);
81 }
82 } // end namespace oofem
virtual void trans_solve(const FloatArray &x, FloatArray &y) const
Solves transposed system.
void ILUPsolve(const FloatArray &x, FloatArray &y) const
Definition: dyncomprow.C:970
virtual void init(const SparseMtrx &a)
Initializes the receiver (constructs the precontioning matrix M) of given matrix. ...
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
#define _IFT_CompRow_ILUPrecond_droptol
void ILUPtrans_solve(const FloatArray &x, FloatArray &y) const
Definition: dyncomprow.C:1007
#define OOFEM_ERROR(...)
Definition: error.h:61
Implementation of sparse matrix stored in compressed column storage.
Definition: dyncomprow.h:57
CompRow_ILUPreconditioner()
Constructor. The user should call initializeFrom and init services in this given order to ensure cons...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver from given record. Empty implementation.
virtual void solve(const FloatArray &x, FloatArray &y) const
Solves the linear system.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
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
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_CompRow_ILUPrecond_partfill
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
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:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011