22#ifndef __FUNCTION_NAME__
23 #define LIBVIENNASHE_FUNCTION_NAME_MARKER
25 #define __FUNCTION_NAME__ __FUNCTION__
27 #define __FUNCTION_NAME__ __func__
32#define LIBVIENNASHE_CONFIG_GETTER(conf, retval, func_name, code) try { if ((conf) == NULL) \
34 viennashe::log::error() << "ERROR! " << (func_name) << "(): config must not be NULL! " << std::endl; return 1; \
36 if ((retval) == NULL) \
38 viennashe::log::error() << "ERROR! " << (func_name) << "(): The return pointer must not be NULL! " << std::endl; return 2; \
40 viennashe::config * int_conf = reinterpret_cast<viennashe::config *>((conf)); \
43 viennashe::log::error() << "ERROR! " << (func_name) << "(): UNKOWN ERROR!" << std::endl; return -1;\
270 viennashe::log::error() <<
"ERROR! set_linear_solver_config(): max_iters must be greater zero. max_iters = " << max_iters << std::endl;
290 viennashe::log::error() <<
"ERROR! set_linear_solver_config(): sol_id must be a valid solver id!" << std::endl;
318 viennashe::log::error() <<
"ERROR! set_nonlinear_solver_config(): max_iters must be greater zero. max_iters = " << max_iters << std::endl;
321 if (damping <= 0 || damping > 1)
323 viennashe::log::error() <<
"ERROR! set_nonlinear_solver_config(): damping must be in (0,1]. damping = " << damping << std::endl;
337 viennashe::log::error() <<
"ERROR! set_nonlinear_solver_config(): sol_id must be a valid solver id!" << std::endl;
359 int_conf->
with_traps((enabled != 0) ? true :
false);
380 viennashe::log::error() <<
"ERROR! viennashe_set_optical_phonon_scattering(): UNKOWN ERROR!" << std::endl;
396 viennashe::log::error() <<
"ERROR! viennashe_set_acoustic_phonon_scattering(): UNKOWN ERROR!" << std::endl;
412 viennashe::log::error() <<
"ERROR! viennashe_set_ionized_impurity_scattering(): UNKOWN ERROR!" << std::endl;
428 viennashe::log::error() <<
"ERROR! viennashe_set_impact_ionization_scattering(): UNKOWN ERROR!" << std::endl;
444 viennashe::log::error() <<
"ERROR! viennashe_set_electron_electron_scattering(): UNKOWN ERROR!" << std::endl;
508 viennashe::log::error() <<
"ERROR! viennashe_get_linear_solver_config(): UNKOWN ERROR!" << std::endl;
533 viennashe::log::error() <<
"ERROR! viennashe_get_nonlinear_solver_config(): UNKOWN ERROR!" << std::endl;
545#undef LIBVIENNASHE_CONFIG_GETTER
547#ifdef LIBVIENNASHE_FUNCTION_NAME_MARKER
548#undef __FUNCTION_NAME__
549#undef LIBVIENNASHE_FUNCTION_NAME_MARKER
The main SHE configuration class. To be adjusted by the user for his/her needs.
bool with_holes() const
Returns true if holes are considered in the simulation.
bool quantum_correction() const
bool with_traps() const
Returns true if traps are considered in the simulation.
nonlinear_solver_config_type & nonlinear_solver()
Returns the configuration object for the nonlinear solver.
void set_electron_equation(equation_id equ_id)
linear_solver_config_type & linear_solver()
Returns the configuration object for the linear solver.
void set_hole_equation(equation_id equ_id)
bool with_electrons() const
Returns true if electrons are considered in the simulation.
viennashe::she::scatter_config & scattering()
Returns the configuration object for scattering.
bool with_quantum_correction() const
ionized_impurity_scattering_parameters const & ionized_impurity() const
Returns the parameters for ionized impurity scattering. Const-version.
impact_ionization_scattering_parameters const & impact_ionization() const
Returns the parameters for impact ionization scattering. Const-version.
acoustic_phonon_scattering_parameters const & acoustic_phonon() const
Returns the parameters for acoustic phonon scattering. Const-version.
optical_phonon_scattering_parameters const & optical_phonon() const
Returns the parameters for optical phonon scattering. Const-version.
bool electron_electron() const
Returns true if electron-electron scattering is activated.
void set(long solver_id)
Sets a new linear solver. Provide IDs defined in.
long id() const
Returns the current linear solver ID.
std::size_t max_iters() const
Returns the maximum number of iterative linear solver iterations.
std::size_t max_iters() const
Returns the maximum number of nonlinear solver iterations.
double damping() const
Returns the damping for 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.
viennashe_linear_solver_id
Enum of available linear solvers.
@ viennashe_linear_solver_gpu_parallel
@ viennashe_linear_solver_dense
@ viennashe_linear_solver_parallel
@ viennashe_linear_solver_serial
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_linear_solver_config(viennashe_config conf, viennashe_linear_solver_id *sol_id, long *max_iters)
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_config(viennashe_config conf)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_enable_density_gradient(viennashe_config conf)
viennashe_nonlinear_solver_id
Enum of available non-linear solvers.
@ viennashe_nonlinear_solver_gummel
@ viennashe_nonlinear_solver_newton
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_with_traps(viennashe_config conf, libviennashe_bool enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_ionized_impurity_scattering(viennashe_config conf, libviennashe_bool enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_is_with_traps(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_standard_dd(viennashe_config conf)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_acoustic_phonon_scattering(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_nonlinear_solver_config(viennashe_config conf, viennashe_nonlinear_solver_id sol_id, long max_iters, double damping)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_she_unipolar_p(viennashe_config conf)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_has_density_gradient(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_optical_phonon_scattering(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_ionized_impurity_scattering(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_linear_solver_config(viennashe_config conf, viennashe_linear_solver_id sol_id, long max_iters)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_electron_electron_scattering(viennashe_config conf, libviennashe_bool enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_she_bipolar(viennashe_config conf, libviennashe_bool with_traps)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_impact_ionization_scattering(viennashe_config conf, libviennashe_bool enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_electron_electron_scattering(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_acoustic_phonon_scattering(viennashe_config conf, libviennashe_bool enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_nonlinear_solver_config(viennashe_config conf, viennashe_nonlinear_solver_id *sol_id, long *max_iters, double *damping)
VIENNASHE_EXPORT viennasheErrorCode viennashe_create_config(viennashe_config *conf)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_optical_phonon_scattering(viennashe_config conf, libviennashe_bool enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_she_unipolar_n(viennashe_config conf)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_impact_ionization_scattering(viennashe_config conf, libviennashe_bool *enabled)
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_disable_density_gradient(viennashe_config conf)
viennashe_config_impl * viennashe_config
logger< true > error()
Used to log errors. The logging level is logERROR.
@ 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)
@ gummel_nonlinear_solver
@ newton_nonlinear_solver
Gummel iteration.
Contains all viennashe includes and most of the C++/C-wrappers. Contains macros.
#define __FUNCTION_NAME__
#define CHECK_ARGUMENT_FOR_NULL(arg, pos, name)