24 typedef viennagrid::line_1d_mesh MeshType;
27 typedef viennagrid::result_of::const_cell_range<MeshType>::type CellContainer;
28 typedef viennagrid::result_of::iterator<CellContainer>::type CellIterator;
29 typedef viennagrid::result_of::const_facet_range<MeshType>::type FacetContainer;
33 std::cout <<
"* main(): Creating mesh ..." << std::endl;
37 const double len_gate = 1e-9;
38 const double cs_gate = 0.01e-9;
39 const double len_oxide = 1e-9;
40 const double cs_ox = 0.05e-9;
41 const double len_bulk = 100e-9;
42 const double cs_bulk = 1e-9;
49 device.generate_mesh(mosgen);
56 std::cout << std::endl;
57 CellContainer cells(device.mesh());
58 for (CellIterator cit = cells.begin();
62 std::cout << cit->id() <<
" => " << device.get_material(*cit)
63 <<
" ## Nd = " << device.get_doping_n(*cit)
64 <<
" ## Na = " << device.get_doping_p(*cit)
65 <<
" ## has bnd cond: " << (device.has_contact_potential(*cit)==
true ?
"TRUE" :
"FALSE")
68 FacetContainer facets(device.mesh());
69 for (std::size_t i = 0; i < facets.size(); ++i)
70 std::cout << facets[i] << std::endl;
74 std::cout <<
"* main(): Creating DD simulator..." << std::endl;
92 std::cout <<
"* main(): Launching simulator..." << std::endl;
100 std::cout <<
"* main(): Testing results (DD) ..." << std::endl;
102 ok =
test_result(dd_simulator.dg_pot_p(), device,
"../../tests/data/dg/n/dd_dgpot_holes.dat" );
103 if(!ok)
return EXIT_FAILURE;
104 ok =
test_result(dd_simulator.dg_pot_n(), device,
"../../tests/data/dg/n/dd_dgpot_electrons.dat" );
105 if(!ok)
return EXIT_FAILURE;
106 ok =
test_result(dd_simulator.potential(), device,
"../../tests/data/dg/n/mos1d_dd_pot.dat" );
107 if(!ok)
return EXIT_FAILURE;
108 ok =
test_result(dd_simulator.electron_density(), device,
"../../tests/data/dg/n/mos1d_dd_electrons.dat");
109 if(!ok)
return EXIT_FAILURE;
110 ok =
test_result(dd_simulator.hole_density(), device,
"../../tests/data/dg/n/mos1d_dd_holes.dat");
111 if(!ok)
return EXIT_FAILURE;
119 std::cout <<
"* main(): Setting up SHE..." << std::endl;
148 std::cout <<
"* main(): Computing SHE..." << std::endl;
160 std::cout <<
"* main(): Testing results (SHE) ..." << std::endl;
162 ok =
test_result(dd_simulator.dg_pot_p(), device,
"../../tests/data/dg/n/she_dgpot_holes.dat" );
163 if(!ok)
return EXIT_FAILURE;
164 ok =
test_result(dd_simulator.dg_pot_n(), device,
"../../tests/data/dg/n/she_dgpot_electrons.dat" );
165 if(!ok)
return EXIT_FAILURE;
166 ok =
test_result(dd_simulator.potential(), device,
"../../tests/data/dg/n/mos1d_she_pot.dat" );
167 if(!ok)
return EXIT_FAILURE;
168 ok =
test_result(dd_simulator.electron_density(), device,
"../../tests/data/dg/n/mos1d_she_electrons.dat");
169 if(!ok)
return EXIT_FAILURE;
170 ok =
test_result(dd_simulator.hole_density(), device,
"../../tests/data/dg/n/mos1d_she_holes.dat");
171 if(!ok)
return EXIT_FAILURE;
174 std::cout <<
"... \\o/ SUCCESS \\o/ ..." << std::endl;
The main SHE configuration class. To be adjusted by the user for his/her needs.
double min_kinetic_energy_range(viennashe::carrier_type_id ctype) const
Returns the minimum kinetic energy range for the selected carrier.
long max_expansion_order() const
Returns the current maximum expansion order.
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.
double energy_spacing() const
Returns the uniform energy spacing of discrete energies.
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
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
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.
Class for self-consistent SHE simulations.
void set(long solver_id)
Sets a new linear solver. Provide IDs defined in.
double ilut_drop_tolerance() const
Returns the drop tolerance for the ILUT preconditioenr.
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.
Contains common code for the 1D MOS DG tests.
bool test_result(AccessorType const &quan, DeviceType const &device, std::string filename)
Tests the given quantity against reference data in a file. Uses reference_values.
void init_device(DeviceType &device, double Vg_init, double Nd, double Na)
Initalizes the MOS 1D device for testing.
std::string hole_density()
std::string electron_density()
std::string preamble()
Prints the ViennaSHE preamble (header). Used in all the examples as well as the standalone-applicatio...
MOS 1D test-grid generator.
Writes quantities to a file which can be processed by Gnuplot. Works for 1d, 2d and 3d only.
static const double q
Elementary charge.
A trivial filter, all objects are accepted.