Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
epot_umfpacksolver.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2011-2013 Taneli Kalvas. All rights reserved.
6  *
7  * You can redistribute this software and/or modify it under the terms
8  * of the GNU General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this library (file "COPYING" included in the package);
19  * if not, write to the Free Software Foundation, Inc., 51 Franklin
20  * Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you have questions about your rights to use or distribute this
23  * software, please contact Berkeley Lab's Technology Transfer
24  * Department at TTD@lbl.gov. Other questions, comments and bug
25  * reports should be sent directly to the author via email at
26  * taneli.kalvas@jyu.fi.
27  *
28  * NOTICE. This software was developed under partial funding from the
29  * U.S. Department of Energy. As such, the U.S. Government has been
30  * granted for itself and others acting on its behalf a paid-up,
31  * nonexclusive, irrevocable, worldwide license in the Software to
32  * reproduce, prepare derivative works, and perform publicly and
33  * display publicly. Beginning five (5) years after the date
34  * permission to assert copyright is obtained from the U.S. Department
35  * of Energy, and subject to any subsequent five (5) year renewals,
36  * the U.S. Government is granted for itself and others acting on its
37  * behalf a paid-up, nonexclusive, irrevocable, worldwide license in
38  * the Software to reproduce, prepare derivative works, distribute
39  * copies to the public, perform publicly and display publicly, and to
40  * permit others to do so.
41  */
42 
43 
44 #ifndef EPOT_UMFPACKSOLVER_HPP
45 #define EPOT_UMFPACKSOLVER_HPP 1
46 
47 
48 #include "epot_matrixsolver.hpp"
49 #include "ccolmatrix.hpp"
50 
51 
55 
56  void *_numeric;
58  double _newton_res;
59  double _newton_step;
61  bool _gnewton;
62  double _newton_r_eps;
63  double _newton_step_eps;
64  uint32_t _newton_imax;
69  virtual void reset_problem( void );
70 
73  virtual void subsolve( MeshScalarField &epot, const MeshScalarField &scharge );
74 
75  static void umfpack_error( const std::string func, int status );
76 
77  void umfpack_decompose( const CColMatrix &mat );
78  void umfpack_solve( const CColMatrix &mat, const Vector &rhs, Vector &sol,
79  bool force_decomposition = false );
80 
81 public:
82 
86  double newton_r_eps = 1.0e-5,
87  double newton_step_eps = 1.0e-6,
88  uint32_t newton_imax = 10,
89  bool gnewton = true );
90 
93  EpotUMFPACKSolver( Geometry &geom, std::istream &s );
94 
97  virtual ~EpotUMFPACKSolver();
98 
101  void set_newton_imax( uint32_t newton_imax );
102 
107  void set_gnewton( bool enable );
108 
111  void set_newton_residual_eps( double newton_r_eps );
112 
115  double get_newton_residual( void ) const;
116 
119  void set_newton_step_eps( double newton_step_eps );
120 
123  double get_newton_step( void ) const;
124 
127  virtual void debug_print( std::ostream &os ) const;
128 
131  virtual void save( std::ostream &s ) const;
132 };
133 
134 
135 #endif
Compressed column sparse matrix algebra.
Compressed column sparse matrix class.
Definition: ccolmatrix.hpp:75
Parent class for Matrix-based solvers for Electric potential problem.
Definition: epot_matrixsolver.hpp:62
UMFPACK matrix solver for Electric potential problem.
Definition: epot_umfpacksolver.hpp:54
virtual ~EpotUMFPACKSolver()
Destructor.
Definition: epot_umfpacksolver.cpp:76
void set_newton_imax(uint32_t newton_imax)
Sets maximum iteration count for Newton-Raphson steps.
Definition: epot_umfpacksolver.cpp:83
void set_gnewton(bool enable)
Enable/disable globally convergent Newton-Raphson.
Definition: epot_umfpacksolver.cpp:101
double get_newton_step(void) const
Get last Newton-Raphson step size.
Definition: epot_umfpacksolver.cpp:113
void set_newton_residual_eps(double newton_r_eps)
Sets the accuracy request for Newton-Raphson residual.
Definition: epot_umfpacksolver.cpp:89
virtual void save(std::ostream &s) const
Saves problem data to stream.
Definition: epot_umfpacksolver.cpp:70
void set_newton_step_eps(double newton_step_eps)
Sets the accuracy request for Newton-Raphson step size.
Definition: epot_umfpacksolver.cpp:95
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: epot_umfpacksolver.cpp:334
double get_newton_residual(void) const
Get last Newton-Raphson residual.
Definition: epot_umfpacksolver.cpp:107
EpotUMFPACKSolver(Geometry &geom, double newton_r_eps=1.0e-5, double newton_step_eps=1.0e-6, uint32_t newton_imax=10, bool gnewton=true)
Constructor.
Definition: epot_umfpacksolver.cpp:50
Geometry defining class.
Definition: geometry.hpp:180
Scalar field class.
Definition: meshscalarfield.hpp:70
Dense math vector class.
Definition: mvector.hpp:71
Matrix solver for electric potential problem.


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.