17 #pragma warning(disable:4503)
28#include "viennagrid/config/default_configs.hpp"
29#include "viennagrid/algorithm/centroid.hpp"
41 mos1d_mesh_generator(
double len_gate,
double cs_gate,
double len_oxide,
double cs_ox,
double len_bulk,
double cs_bulk)
42 : len_gate_(len_gate), cs_gate_(cs_gate), len_oxide_(len_oxide), cs_ox_(cs_ox), len_bulk_(len_bulk), cs_bulk_(cs_bulk)
45 template <
typename MeshT,
typename SegmentationT >
46 void operator()(MeshT & mesh, SegmentationT & seg)
const
50 gconf.
add_segment(0, len_gate_,
static_cast<unsigned long>(len_gate_ /cs_gate_ + 1.0) );
51 gconf.
add_segment(len_gate_, len_oxide_,
static_cast<unsigned long>(len_oxide_/cs_ox_ + 1.0) );
52 gconf.
add_segment(len_gate_+len_oxide_, len_bulk_,
static_cast<unsigned long>(len_bulk_ /cs_bulk_ + 1.0) );
53 gconf.
add_segment(len_gate_+len_oxide_+len_bulk_, 1e-9, 10 );
73template <
typename DeviceType>
74void init_device(DeviceType & device,
double Vg_init)
76 typedef typename DeviceType::segment_type SegmentType;
78 SegmentType
const & gate = device.segment(0);
79 SegmentType
const & oxide = device.segment(1);
80 SegmentType
const & silicon = device.segment(2);
81 SegmentType
const & bulk = device.segment(3);
83 std::cout <<
"* init_device(): Setting material ..." << std::endl;
90 std::cout <<
"* init_device(): Setting doping (per cell) ..." << std::endl;
93 device.set_doping_n(1e16, silicon);
94 device.set_doping_p(1e16, silicon);
96 std::cout <<
"* init_device(): Setting contact potentials (per cell) ..." << std::endl;
98 device.set_contact_potential(0.0, bulk);
99 device.set_contact_potential(Vg_init, gate);
101 std::cout <<
"* init_device(): DONE!" << std::endl;
107 typedef viennagrid::line_1d_mesh MeshType;
115 std::cout <<
"* main(): Initializing device ..." << std::endl;
119 const double len_gate = 1e-9;
120 const double cs_gate = 1e-10;
121 const double len_oxide = 1e-9;
122 const double cs_ox = 2e-10;
123 const double len_bulk = 1e-9;
124 const double cs_bulk = 1e-10;
129 device.generate_mesh(mosgen);
136 std::cout <<
"* main(): Creating DD simulator..." << std::endl;
146 std::cout <<
"* main(): Launching simulator..." << std::endl;
150 double pot_gate_left = dd_simulator.potential().at(viennagrid::cells(device.mesh())[12]);
151 double pot_gate_right = dd_simulator.potential().at(viennagrid::cells(device.mesh())[13]);
152 double dx_gate = viennagrid::norm(viennagrid::centroid(viennagrid::cells(device.mesh())[13]) - viennagrid::centroid(viennagrid::cells(device.mesh())[12]));
153 double field_gate = (pot_gate_left - pot_gate_right) / dx_gate;
155 double pot_bulk_left = dd_simulator.potential().at(viennagrid::cells(device.mesh())[22]);
156 double pot_bulk_right = dd_simulator.potential().at(viennagrid::cells(device.mesh())[23]);
157 double dx_bulk = viennagrid::norm(viennagrid::centroid(viennagrid::cells(device.mesh())[23]) - viennagrid::centroid(viennagrid::cells(device.mesh())[22]));
158 double field_bulk = (pot_bulk_left - pot_bulk_right) / dx_bulk;
161 std::cout <<
"Field in gate: " << field_gate << std::endl;
162 std::cout <<
"Field in bulk: " << field_bulk << std::endl;
163 std::cout <<
"Ratio of electric fields: " << field_gate / field_bulk << std::endl;
166 std::cout <<
"Ratio of permittivities: " << permittivity_bulk / permittivity_ox << std::endl;
171 std::cout << std::endl;
172 if ( std::abs(field_gate / field_bulk - permittivity_bulk / permittivity_ox) > 0.01 )
174 std::cout <<
"TEST FAILED: Ratios of fields do not correspond to ratio of permittivities!" << std::endl;
178 std::cout <<
"TEST PASSED: Ratios match!" << std::endl;
179 std::cout << std::endl;
181 std::cout <<
"*********************************************************" << std::endl;
182 std::cout <<
"* Test finished successfully *" << std::endl;
183 std::cout <<
"*********************************************************" << std::endl;
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.
nonlinear_solver_config_type & nonlinear_solver()
Returns the configuration object for the nonlinear solver.
bool with_electrons() const
Returns true if electrons are considered in the simulation.
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Class for self-consistent SHE simulations.
std::size_t max_iters() const
Returns the maximum number of nonlinear solver iterations.
double damping() const
Returns the damping for the nonlinear solver.
Configuration class for the simple mesh generator.
void add_segment(double start_x, double start_y, double len_x, double len_y, unsigned long points_x, unsigned long points_y)
Convenience header, which includes all core functionality available in ViennaSHE.
void init_device(DeviceType &device, double Vg_init, double Nd, double Na)
Initalizes the MOS 1D device for testing.
double permittivity(long material_id)
Convenience function for returning the permittivity of the material identified by the ID provided.
void generate_device(MeshT &mesh, SegmentationT &seg, device_generation_config const &conf)
Public interface for mesh generation of simple one- or two-dimensional meshes. Device must be rectang...
MOS 1D test-grid generator.
mos1d_mesh_generator(double len_gate, double cs_gate, double len_oxide, double cs_ox, double len_bulk, double cs_bulk)
void operator()(MeshT &mesh, SegmentationT &seg) const
Writes quantities to a file which can be processed by Gnuplot. Works for 1d, 2d and 3d only.
A class referring to hafnium dioxide.
A class referring to silicon and providing certain material parameters Note that this is the default ...
A trivial filter, all objects are accepted.