23sys.path.append(
'../../pythonbinding/src')
24sys.path.append(
'./pythonbinding/src')
27 import pyviennashe
as viennashe
30 print "\nCannot import pyviennashe. Possible causes:"
31 print "\n - The LD_LIBRARY_PATH (UNIX) or the WINDOWS paths are set incorrectly."
32 print "\n - The PYTHONPATH needs to be set to the same directory as the library search path (LD_LIBRARY_PATH for *NIX SYSTEMS)"
41SI_ID = viennashe.get_silicon_id()[1]
42METAL_ID = viennashe.get_metal_id()[1]
43SIO2_ID = viennashe.get_sio2_id()[1]
44HFO2_ID = viennashe.get_hfo2_id()[1]
46dev = viennashe.create_1d_device(len_x, points_x)
48num_cells = viennashe.get_num_cells(dev)[1]
50print "num_vertices = ", viennashe.get_num_vertices(dev)[1]
51print "num_cells = ", num_cells
55for i
in range(0, num_cells): matids.append(SI_ID)
57matids[num_cells-1] = METAL_ID
60for i
in range(0, num_cells):
64bnd_cells = [0, num_cells-1]
67viennashe.initalize_device(dev, matids, Nd, Na)
68viennashe.set_contact_potential_cells(dev, bnd_cells, bnd_pot, 2)
72conf_dd = viennashe.create_config();
75viennashe.config_standard_dd(conf_dd)
76viennashe.set_nonlinear_solver_config(conf_dd, viennashe.nonlinear_solver_gummel, 55, 0.5)
79sim_dd = viennashe.create_simulator(dev, conf_dd)
84reg = viennashe.create_quantity_register(sim_dd )
86viennashe.write_to_gnuplot(reg,
"Electrostatic potential",
"potential_she.dat")
87viennashe.write_to_gnuplot(reg,
"Electron density",
"n_she.dat")
88viennashe.write_to_gnuplot(reg,
"Hole density",
"p_she.dat")