21#include "../../libviennashe/include/libviennashe.h"
24#define FALSE libviennashe_false
25#define TRUE libviennashe_true
40 printf(
"Number of Quanitites: %ld\n", num_quan);
43 names = (
char**)malloc(
sizeof(
char*) * num_quan);
47 printf(
"#############################\n");
48 for (i = 0; i < num_quan; ++i)
50 printf(
"%3ld: '%s'\n", i, names[i]);
53 printf(
"#############################\n");
56 free(names); names = NULL;
65 double ** values = NULL;
86 printf(
"%2ld => ", i);
87 for ( j = 0; j < len[i]; ++j)
89 printf(
"%e", values[i][j]);
100 printf(
"Unable to find the electrostatic potential by name ('Electrostatic potential') !\n");
111 const double len_x = 1e-6;
121 double bnd_pot[] = { 0.0, 1.0 };
231 return (EXIT_SUCCESS);
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_config(viennashe_config conf)
@ viennashe_nonlinear_solver_gummel
VIENNASHE_EXPORT viennasheErrorCode viennashe_config_standard_dd(viennashe_config conf)
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_bipolar(viennashe_config conf, libviennashe_bool with_traps)
VIENNASHE_EXPORT viennasheErrorCode viennashe_create_config(viennashe_config *conf)
viennashe_config_impl * viennashe_config
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_device(viennashe_device dev)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_contact_potential_cells(viennashe_device dev, viennashe_index_type *cell_ids, double *values, viennashe_index_type len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_create_1d_device(viennashe_device *dev, double len_x, size_t points_x)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_num_cells(viennashe_device dev, viennashe_index_type *num)
VIENNASHE_EXPORT viennasheErrorCode viennashe_initalize_device(viennashe_device dev, viennashe_material_id *material_ids, double *doping_n, double *doping_p)
VIENNASHE_EXPORT viennasheErrorCode viennashe_finalize(void)
Finalizes ViennaSHE.
VIENNASHE_EXPORT viennasheErrorCode viennashe_initalize(void)
Initializes ViennaSHE. To be called before ViennaSHE is used.
long viennashe_material_id
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_metal_id(viennashe_material_id *id)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_silicon_id(viennashe_material_id *id)
conf_dd
Create the simulator configuration.
sim_dd
Apply standard DD configuration.
reg
This is DD, so we do not need to give any inital guess.
VIENNASHE_EXPORT viennasheErrorCode viennashe_write_to_gnuplot(viennashe_quan_register reg, char const *name, char const *filename)
VIENNASHE_EXPORT viennasheErrorCode viennashe_write_she_results_to_gnuplot(viennashe_quan_register reg, viennashe_carrier_ids ctype, char const *filename)
viennashe_quan_register_impl * viennashe_quan_register
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_quantity_register(viennashe_quan_register reg)
VIENNASHE_EXPORT viennasheErrorCode viennashe_has_cell_based_quantity(viennashe_quan_register reg, char const *name, libviennashe_bool *exists)
VIENNASHE_EXPORT viennasheErrorCode viennashe_create_quantity_register(viennashe_quan_register *reg, viennashe_simulator sim)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_cell_based_quantity_list(viennashe_quan_register reg, char **names)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_cell_based_quantity(viennashe_quan_register reg, char const *name, double **values, viennashe_index_type *len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_prealloc_cell_based_quantity(viennashe_device dev, double ***uarray, viennashe_index_type **len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_cell_based_quantity(viennashe_device dev, double ***uarray, viennashe_index_type **len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_num_cell_based(viennashe_quan_register reg, viennashe_index_type *num)
void print_quan_info(viennashe_quan_register reg)
Prints the names of the available quantities in a register
void print_potential(viennashe_device dev, viennashe_quan_register reg)
Prints the electrostatic potential profile to stdout
VIENNASHE_EXPORT viennasheErrorCode viennashe_run(viennashe_simulator sim)
VIENNASHE_EXPORT viennasheErrorCode viennashe_set_initial_guess_from_other_sim(viennashe_simulator sim, viennashe_simulator other_sim)
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_simulator(viennashe_simulator sim)
VIENNASHE_EXPORT viennasheErrorCode viennashe_create_simulator(viennashe_simulator *sim, viennashe_device dev, viennashe_config conf)
Internal C++ to C wrapper for the device. Has typedefs and destructor.
Internal C++ to C wrapper for the simulator. Has typedefs and destructor.
unsigned long viennashe_index_type