1#ifndef VIENNASHE_SOLVERS_CONFIG_HPP
2#define VIENNASHE_SOLVERS_CONFIG_HPP
63 1000), ilut_entries_(60), ilut_drop_tol_(1e-4), do_scale_(true)
84 void set(
long solver_id)
93#ifdef VIENNASHE_HAVE_GPU_SOLVER
104 void set(std::string solver_name)
107 std::transform(solver_name.begin(), solver_name.end(),
108 solver_name.begin(), ::tolower);
110 if (solver_name ==
"dense_linear_solver")
113 }
else if (solver_name ==
"serial_linear_solver")
116 }
else if (solver_name ==
"parallel_linear_solver")
119 }
else if (solver_name ==
"petsc_parallel_linear_solver")
123 else if (solver_name ==
"petsc_parallel_AMGX_solver")
127#ifdef VIENNASHE_HAVE_GPU_SOLVER
128 else if (solver_name ==
"gpu_parallel_linear_solver")
168 return ilut_entries_;
179 return ilut_drop_tol_;
185 ilut_drop_tol_ = tol;
190 return block_precond_boundaries_;
194 return block_precond_boundaries_;
227 std::size_t max_iters_;
228 std::size_t ilut_entries_;
229 double ilut_drop_tol_;
284 void set(std::string solver_name)
287 std::transform(solver_name.begin(), solver_name.end(),
288 solver_name.begin(), ::tolower);
290 if (solver_name ==
"gummel_nonlinear_solver"
291 || solver_name ==
"gummel")
294 }
else if (solver_name ==
"newton_nonlinear_solver"
295 || solver_name ==
"newton")
353 THRESHOLD = threshold;
363 std::size_t max_iters_;
Exception for the case that an invalid solver is in use.
Exception for the case that an invalid nonlinear solver is in use.
A configuration class holding options for use within the different linear solvers.
void set(long solver_id)
Sets a new linear solver. Provide IDs defined in.
std::vector< std::pair< std::size_t, std::size_t > > block_preconditioner_boundaries_container
void max_iters(std::size_t iters)
Sets the maximum number of iterations within the iterative linear solver.
double ilut_drop_tolerance() const
Returns the drop tolerance for the ILUT preconditioenr.
void set(std::string solver_name)
Sets a new linear solver. Provide IDs defined in.
std::size_t ilut_entries() const
Returns the maximum number of entries in each of the two factors of the ILUT preconditioner.
long id() const
Returns the current linear solver ID.
block_preconditioner_boundaries_container const & block_preconditioner_boundaries() const
double tolerance() const
Returns the tolerance for the (iterative) linear solver.
std::size_t max_iters() const
Returns the maximum number of iterative linear solver iterations.
void scale(bool value)
Controls the scaling of unkowns. Give "false" to disable unkown scaling.
bool scale() const
Returns whether or not the unkowns are scaled before solving the equation set.
void setArgv(char **argv)
void tolerance(double tol)
Sets the tolerance for the (iterative) linear solver. Non-positive values are ignored.
block_preconditioner_boundaries_container & block_preconditioner_boundaries()
void ilut_drop_tolerance(double tol)
Sets the drop tolerance for the ILUT preconditioner. Non-positive values are ignored.
void ilut_entries(std::size_t num)
Sets the maximum number of entries in each of the two factors of the ILUT preconditioner.
A configuration class holding options for use within the different linear solvers.
long getThreshold() const
void operator++(int)
Increment the Number of Iterations for the nonlinear solver.
nonlinear_solver_config()
double tolerance() const
Returns the tolerance for the nonlinear solver potential update.
std::size_t max_iters() const
Returns the maximum number of nonlinear solver iterations.
double damping() const
Returns the damping for the nonlinear solver.
void damping(double d)
Sets the tolerance for the nonlinear solver. Negative values are ignored.
void setThreshold(long threshold)
void max_iters(std::size_t iters)
Sets the maximum number of iterations within the nonlinear solver.
long id() const
Returns the current linear solver ID.
void set(long solver_id)
Sets a new linear solver. Provide IDs defined in.
void tolerance(double tol)
Sets the tolerance for the nonlinear solver potential update. Non-positive values are ignored.
void set(std::string solver_name)
Sets a new nonlinear solver.
Contains forward declarations and definition of small classes that must be defined at an early stage.
The main ViennaSHE namespace. All functionality resides inside this namespace.
Provides the exceptions used inside the viennashe::she namespace.
Provides IDs for the linear solvers.
@ petsc_parallel_AMGX_solver
PETSC-assisted solver (Hypre AMG)
@ gpu_parallel_linear_solver
multi-threaded solver (block ILUT)
@ parallel_linear_solver
single-threaded solver (using ILUT)
@ serial_linear_solver
Gauss solver (use for systems up to ~1000-by-1000 only)
@ petsc_parallel_linear_solver
gpu-assisted solver (block ILUT)
Provides IDs for the nonlinear iteration schemes.
@ gummel_nonlinear_solver
@ newton_nonlinear_solver
Gummel iteration.