ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
device.hpp
Go to the documentation of this file.
1#ifndef VIENNASHE_DEVICE_HPP
2#define VIENNASHE_DEVICE_HPP
3/* ============================================================================
4 Copyright (c) 2011-2022, Institute for Microelectronics,
5 Institute for Analysis and Scientific Computing,
6 TU Wien.
7
8 -----------------
9 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
10 -----------------
11
12 http://viennashe.sourceforge.net/
13
14 License: MIT (X11), see file LICENSE in the base directory
15 =============================================================================== */
16
17#include <stdexcept>
18
19#include <ostream>
20#include <cstddef>
21#include <cmath>
22#include <deque>
23
24#include "viennagrid/forwards.hpp"
25#include "viennagrid/mesh/mesh.hpp"
26#include "viennagrid/algorithm/norm.hpp"
27#include "viennagrid/algorithm/refine.hpp"
28#include "viennagrid/algorithm/geometric_transform.hpp"
29#include "viennagrid/io/netgen_reader.hpp"
30#include "viennagrid/io/vtk_reader.hpp"
31
32#include "viennashe/forwards.h"
37
39
41#include "viennashe/setters.hpp"
42
47namespace viennashe
48{
49
50 namespace detail
51 {
53 template<typename MeshT>
55 {
56 protected:
57 typedef typename viennagrid::result_of::segmentation<MeshT>::type segmentation_type;
58
59 typedef typename viennagrid::result_of::vertex<MeshT>::type vertex_type;
60 typedef typename viennagrid::result_of::point<MeshT>::type point_type;
61
62 typedef typename viennagrid::result_of::const_cell_handle<MeshT>::type const_cell_handle_type;
63
64 public:
65 typedef MeshT mesh_type;
66 typedef typename viennagrid::result_of::facet<MeshT>::type facet_type;
67 typedef typename viennagrid::result_of::cell<MeshT>::type cell_type;
68 typedef typename viennagrid::result_of::accessor_container<cell_type,
69 bool, viennagrid::std_vector_tag>::type CellRefinementContainerType;
70
71 typedef typename viennagrid::result_of::segment_handle<segmentation_type>::type segment_type;
72 typedef typename viennagrid::result_of::segmentation_segment_id_type<
74 typedef long material_id_type;
75 typedef std::size_t id_type;
77 typedef std::vector<trap_level_type> trap_level_container_type;
78
79 typedef typename viennagrid::result_of::voronoi_cell_contribution<
81
82 private:
83 std::size_t
84 get_id (cell_type const &cell) const
85 {
86 return static_cast<std::size_t> (cell.id ().get ());
87 }
88
89 public:
91 seg_ (mesh_)
92 {
93 }
94
95 void
96 load_mesh (std::string filename)
97 {
98 if (filename.size () > 5
99 && filename.substr (filename.size () - 5) == ".mesh")
100 {
101 viennagrid::io::netgen_reader my_reader;
102 my_reader (mesh_, seg_, filename);
103 }
104 else if (filename.size () > 4
105 && (filename.substr (filename.size () - 4) == ".vtu"
106 || filename.substr (filename.size () - 4) == ".pvd"))
107 {
108 viennagrid::io::vtk_reader<MeshT> mesh_reader;
109 mesh_reader (mesh_, seg_, filename);
110 }
111 else
112 {
113 throw std::runtime_error ("Unknown file extension!");
114 }
115
116 init_datastructures ();
117 }
118
119 template<typename DeviceLoaderType>
120 void
121 load_device (DeviceLoaderType &loader)
122 {
123 loader (mesh_, seg_);
124 init_datastructures ();
125 }
126
127 void
129 viennashe::util::device_generation_config const &generator_params)
130 {
131 viennashe::util::generate_device (mesh_, seg_, generator_params);
132 init_datastructures ();
133 }
134
135 template<typename MeshGeneratorType>
136 void
137 generate_mesh (MeshGeneratorType const &gen)
138 {
139 gen (mesh_, seg_);
140 init_datastructures ();
141 }
142
144 MeshT const&
145 mesh () const
146 {
147 return mesh_;
148 }
149 MeshT&
151 {
152 return mesh_;
153 }
154
155 segmentation_type const&
157 {
158 return seg_;
159 }
162 {
163 return seg_;
164 }
165
166 segment_type const&
168 {
169 return seg_.at (id);
170 }
171
172 void
173 scale (double factor)
174 {
175 viennagrid::scale (mesh_, factor);
176 init_datastructures (); //for Voronoi quantities
177 }
178
179 void
180 refine (int factor)
181 {
182 MeshT mesh_refined,mesh_refined_temp;
183 segmentation_type seg_temp (mesh_refined);
184 CellRefinementContainerType cell_refinement_flag;
185 int cellsize = viennagrid::cells (mesh_).size ();
186 long unsigned int finalcellsize = factor * cellsize;
187 int ibegin = 0;
188 typename viennagrid::result_of::field< CellRefinementContainerType,cell_type >::type cell_refinement_field(cell_refinement_flag);
189 mesh_refined = mesh_;
190 std::cout << "* Size of mesh:" <<cellsize <<std::endl;
191 std::cout << "* Size of mesh:" <<finalcellsize <<std::endl;
192 if(factor <8 ){
193 do
194 {
195 typename viennagrid::result_of::field< CellRefinementContainerType,cell_type >::type cell_refinement_field(cell_refinement_flag);
196 for(int i =ibegin;i<ibegin+700;i+=2)
197 cell_refinement_field( viennagrid::cells(mesh_refined)[i] ) = true;
198 viennagrid::cell_refine(mesh_refined,seg_, mesh_refined_temp,seg_temp, cell_refinement_field);
199 for(int i =ibegin;i<ibegin+700;i+=2)
200 cell_refinement_field( viennagrid::cells(mesh_refined)[i] ) = false;
201 mesh_refined = mesh_refined_temp;
202 seg_ = seg_temp;
203 std::cout << "* Size of mesh:" <<viennagrid::cells (mesh_refined).size() <<std::endl;
204 ibegin += 400;
205 }while(finalcellsize > viennagrid::cells ( mesh_refined).size() );}
206 else{
207 do
208 {
209 typename viennagrid::result_of::field< CellRefinementContainerType,cell_type >::type cell_refinement_field(cell_refinement_flag);
210 for(int i =ibegin;i< cellsize;i+=2)
211 cell_refinement_field( viennagrid::cells(mesh_refined)[i] ) = true;
212 viennagrid::cell_refine(mesh_refined,seg_, mesh_refined_temp,seg_temp, cell_refinement_field);
213 for(int i =ibegin;i< cellsize;i+=2)
214 cell_refinement_field( viennagrid::cells(mesh_refined)[i] ) = false;
215 mesh_refined = mesh_refined_temp;
216 seg_ = seg_temp;
217 std::cout << "* Size of mesh:" <<viennagrid::cells (mesh_refined).size() <<std::endl;
218
219 }while(finalcellsize > viennagrid::cells ( mesh_refined).size() );
220
221 }
222 mesh_ = mesh_refined;
223 seg_ = seg_temp;
224 init_datastructures (); //for Voronoi quantities
225
226 }
227
228 //
229 // Lattice temperature: Cell-centric
230 //
231
233 void
234 set_lattice_temperature (double new_value)
235 {
236 set_lattice_temp_impl (new_value, mesh_);
237 }
238
240 void
241 set_lattice_temperature (double new_value, cell_type const &c)
242 {
243 set_lattice_temp_impl (new_value, c);
244 }
245
247 void
248 set_lattice_temperature (double new_value, segment_type const &s)
249 {
250 set_lattice_temp_impl (new_value, s);
251 }
252
254 double
256 {
257 assert(
258 cell_temperature_.at (get_id (c)) > 0
259 && bool (
260 "get_lattice_temp_impl(): Accessing non-positive temperature from cell!"));
261 return cell_temperature_.at (get_id (c));
262 }
263
264 double
266 {
267 typedef typename viennagrid::result_of::const_coboundary_range<MeshT,
268 facet_type, cell_type>::type CellOnFacetContainer;
269 typedef typename viennagrid::result_of::iterator<CellOnFacetContainer>::type CellOnFacetIterator;
270
271 CellOnFacetContainer cells_on_facet (
272 mesh_, viennagrid::handle (mesh_, facet));
273
274 CellOnFacetIterator cofit = cells_on_facet.begin ();
275 cell_type const &c1 = *cofit;
276 ++cofit;
277
278 if (cofit == cells_on_facet.end ())
279 return get_lattice_temperature (c1);
280
281 cell_type const &c2 = *cofit;
283 / 2.0;
284 }
285
286 //
287 // Doping: cell- and vertex-centric; cell-centric preferred. Conversion utilities are available.
288 //
289
291 void
292 set_doping_n (double value, cell_type const &c)
293 {
294 set_doping_n_impl (value, c);
295 }
296
298 void
299 set_doping_n (double value, segment_type const &d)
300 {
301 set_doping_n_impl (value, d);
302 }
303
305 void
306 set_doping_n (double value, segment_id_type const &seg_id)
307 {
308 set_doping_n_impl (value, segment (seg_id));
309 }
310
312 void
313 set_doping_n (double value)
314 {
315 set_doping_n_impl (value, mesh_);
316 }
317
319 double
320 get_doping_n (cell_type const &c) const
321 {
322 return cell_doping_n_.at (get_id (c));
323 }
324
325 double
326 get_doping_n (facet_type const &facet) const
327 {
328 typedef typename viennagrid::result_of::const_coboundary_range<MeshT,
329 facet_type, cell_type>::type CellOnFacetContainer;
330 typedef typename viennagrid::result_of::iterator<CellOnFacetContainer>::type CellOnFacetIterator;
331
332 CellOnFacetContainer cells_on_facet (
333 mesh_, viennagrid::handle (mesh_, facet));
334
335 CellOnFacetIterator cofit = cells_on_facet.begin ();
336 cell_type const &c1 = *cofit;
337 ++cofit;
338
339 if (cofit == cells_on_facet.end ())
340 return get_doping_n (c1);
341
342 cell_type const &c2 = *cofit;
344 {
346 return std::sqrt (get_doping_n (c1))
347 * std::sqrt (get_doping_n (c2));
348 else
349 return get_doping_n (c1);
350 }
352 return get_doping_n (c2);
353
354 return 0;
355 }
356
357 std::vector<double> const&
358 doping_n () const
359 {
360 return cell_doping_n_;
361 }
362
364 void
365 set_doping_p (double value, cell_type const &c)
366 {
367 set_doping_p_impl (value, c);
368 }
369
371 void
372 set_doping_p (double value, segment_type const &d)
373 {
374 set_doping_p_impl (value, d);
375 }
376
378 void
379 set_doping_p (double value, segment_id_type const &seg_id)
380 {
381 set_doping_p_impl (value, segment (seg_id));
382 }
383
385 void
386 set_doping_p (double value)
387 {
388 set_doping_p_impl (value, mesh_);
389 }
390
392 double
393 get_doping_p (cell_type const &c) const
394 {
395 return cell_doping_p_.at (get_id (c));
396 }
397
398 double
399 get_doping_p (facet_type const &facet) const
400 {
401 typedef typename viennagrid::result_of::const_coboundary_range<MeshT,
402 facet_type, cell_type>::type CellOnFacetContainer;
403 typedef typename viennagrid::result_of::iterator<CellOnFacetContainer>::type CellOnFacetIterator;
404
405 CellOnFacetContainer cells_on_facet (
406 mesh_, viennagrid::handle (mesh_, facet));
407
408 CellOnFacetIterator cofit = cells_on_facet.begin ();
409 cell_type const &c1 = *cofit;
410 ++cofit;
411
412 if (cofit == cells_on_facet.end ())
413 return get_doping_p (c1);
414
415 cell_type const &c2 = *cofit;
417 {
419 return std::sqrt (get_doping_p (c1))
420 * std::sqrt (get_doping_p (c2));
421 else
422 return get_doping_p (c1);
423 }
425 return get_doping_p (c2);
426
427 return 0;
428 }
429
430 std::vector<double> const&
431 doping_p () const
432 {
433 return cell_doping_p_;
434 }
435
436 double
437 get_doping (cell_type const &c, carrier_type_id ctype) const
438 {
439 return
440 (ctype == ELECTRON_TYPE_ID) ? get_doping_n (c) : get_doping_p (c);
441 }
442
443 //
444 // Material: cell-centric.
445 //
447 void
448 set_material (long material_id, cell_type const &elem)
449 {
450 cell_material_.at (get_id (elem)) = material_id;
451 }
452
454 template<typename MaterialType>
455 void
456 set_material (MaterialType, cell_type const &elem)
457 {
458 set_material (long (MaterialType::id), elem);
459 }
460
461 //segment
463 void
464 set_material (long material_id, segment_type const &seg)
465 {
466 set_material_on_complex (material_id, seg);
467 }
468
470 void
471 set_material (long material_id, segment_id_type id)
472 {
473 set_material_on_complex (material_id, segment (id));
474 }
475
477 template<typename MaterialType>
478 void
479 set_material (MaterialType, segment_type const &seg)
480 {
481 set_material_on_complex (long (MaterialType::id), seg);
482 }
483
484 // full mesh
486 void
487 set_material (long material_id)
488 {
489 set_material_on_complex (material_id, mesh_);
490 }
491
493 template<typename MaterialType>
494 void
495 set_material (MaterialType)
496 {
497 set_material_on_complex (long (MaterialType::id), mesh_);
498 }
499
501 long
502 get_material (cell_type const &elem) const
503 {
504 return cell_material_.at (get_id (elem));
505 }
506
507 std::vector<material_id_type> const&
508 material () const
509 {
510 return cell_material_;
511 }
512
513 //
514 // Contact potential: vertex-centric.
515 //
516
517 private:
518
519 void
520 init_datastructures ()
521 {
522 cell_doping_n_.resize (viennagrid::cells (mesh_).size ());
523 cell_doping_p_.resize (viennagrid::cells (mesh_).size ());
524
525 cell_temperature_.resize (viennagrid::cells (mesh_).size (), 300.0);
526
528 viennagrid::cells (mesh_).size ());
529 cell_contact_potential_.resize (viennagrid::cells (mesh_).size (),
530 -1000.0);
531
532 cell_material_.resize (viennagrid::cells (mesh_).size ());
533
534 cell_traps_.resize (viennagrid::cells (mesh_).size ());
535
536 cell_fixed_charges_.resize (viennagrid::cells (mesh_).size ());
537 }
538
539 public:
541 void
542 set_contact_potential (double pot, cell_type const &c)
543 {
544 cell_contact_potential_mask_.at (get_id (c)) = true;
545 cell_contact_potential_.at (get_id (c)) = pot;
546 }
547
549 void
550 set_contact_potential (double pot, segment_type const &seg)
551 {
552 typedef typename viennagrid::result_of::const_cell_range<segment_type>::type CellOnSegmentContainer;
553 typedef typename viennagrid::result_of::iterator<
554 CellOnSegmentContainer>::type CellOnSegmentIterator;
555
556 CellOnSegmentContainer cells_on_segment (seg);
557 for (CellOnSegmentIterator cit = cells_on_segment.begin ();
558 cit != cells_on_segment.end (); ++cit)
559 {
560 set_contact_potential (pot, *cit);
561 }
562 }
563
565 double
567 {
568 assert(
569 cell_contact_potential_mask_.at (get_id (c)) == true
570 && bool (
571 "Accessing potential from vertex for which no contact potential was set!"));
572 return cell_contact_potential_.at (get_id (c));
573 }
574
576 bool
578 {
579 return cell_contact_potential_mask_.at (get_id (c));
580 }
581
582 bool
584 {
585 return false;
586 }
587
588 //
589 // Traps
590 //
591
593 void
595 {
596 cell_traps_.at (get_id (cell)).push_back (trap);
597 }
598
600 void
602 {
603 add_trap_level_on_complex (trap, seg);
604 }
605
607 void
609 {
611 }
612
615 get_trap_levels (cell_type const &cell) const
616 {
617 return cell_traps_.at (get_id (cell));
618 }
619
621 void
623 {
624 for (std::size_t i = 0; i < cell_traps_.size (); ++i)
625 cell_traps_[i].clear ();
626 }
627
628 //
629 // Fixed charges
630 //
631
636 void
637 set_fixed_charge (cell_type const &c, double charge)
638 {
639 cell_fixed_charges_.at (get_id (c)) = charge;
640 }
641
647 double
649 {
650 return cell_fixed_charges_.at (get_id (c));
651 }
652
653 protected:
654
655 //
656 // Lattice temperature
657 //
658 void
659 set_lattice_temp_impl (double value, cell_type const &c)
660 {
661 cell_temperature_.at (get_id (c)) = value;
662 }
663
664 template<typename MeshOrSegmentT>
665 void
666 set_lattice_temp_impl (double value, MeshOrSegmentT const &meshseg) //ComplexType is a segment or a mesh
667 {
668 typedef typename viennagrid::result_of::const_cell_range<
669 MeshOrSegmentT>::type CellContainer;
670 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
671 if (value <= 0.0)
672 {
674 "device.set_lattice_temp*: Lattice temperatures have to be greater 0 K!",
675 value);
676 }
677
678 CellContainer cells (meshseg);
679 for (CellIterator cit = cells.begin (); cit != cells.end (); ++cit)
680 {
681 set_lattice_temp_impl (value, *cit);
682 }
683 }
684
685 //
686 // Doping
687 //
688
689 void
690 set_doping_n_impl (double value, cell_type const &c)
691 {
692 if (value <= 0.0)
693 {
695 "device.set_doping_p_impl(): Concentrations have to be greater 0 !",
696 value);
697 }
698 cell_doping_n_.at (get_id (c)) = value;
699 }
700
701 void
702 set_doping_p_impl (double value, cell_type const &c)
703 {
704 if (value <= 0.0)
705 {
707 "device.set_doping_p_impl(): Concentrations have to be greater 0 !",
708 value);
709 }
710 cell_doping_p_.at (get_id (c)) = value;
711 }
712
713 template<typename MeshOrSegmentT>
714 void
715 set_doping_n_impl (double value, MeshOrSegmentT const &meshseg)
716 {
717 typedef typename viennagrid::result_of::const_cell_range<
718 MeshOrSegmentT>::type CellContainer;
719 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
720
721 if (value <= 0.0)
722 {
724 "device.set_doping*: Concentrations have to be greater 0 !",
725 value);
726 }
727 CellContainer cells (meshseg);
728 for (CellIterator cit = cells.begin (); cit != cells.end (); ++cit)
729 {
730 set_doping_n_impl (value, *cit);
731 }
732 }
733
734 template<typename MeshOrSegmentT>
735 void
736 set_doping_p_impl (double value, MeshOrSegmentT const &meshseg)
737 {
738 typedef typename viennagrid::result_of::const_cell_range<
739 MeshOrSegmentT>::type CellContainer;
740 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
741
742 if (value <= 0.0)
743 {
745 "device.set_doping*: Concentrations have to be greater 0 !",
746 value);
747 }
748 CellContainer cells (meshseg);
749 for (CellIterator cit = cells.begin (); cit != cells.end (); ++cit)
750 {
751 set_doping_p_impl (value, *cit);
752 }
753 }
754
755 //
756 // Material
757 //
758
759 template<typename MeshOrSegmentT>
760 void
761 set_material_on_complex (long material_id,
762 MeshOrSegmentT const &meshseg)
763 {
764 typedef typename viennagrid::result_of::const_cell_range<
765 MeshOrSegmentT>::type CellContainer;
766 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
767 //if (material_id < 0.0) { throw viennashe::invalid_value_exception("device.set_material*: !", material_id); }
768
769 CellContainer cells (meshseg);
770 for (CellIterator cit = cells.begin (); cit != cells.end (); ++cit)
771 set_material (material_id, *cit);
772 }
773
774 //
775 // Traps
776 //
777
778 template<typename MeshOrSegmentT>
779 void
781 MeshOrSegmentT const &meshseg)
782 {
783 typedef typename viennagrid::result_of::const_cell_range<
784 MeshOrSegmentT>::type CellContainer;
785 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
786
787 CellContainer cells (meshseg);
788 for (CellIterator cit = cells.begin (); cit != cells.end (); ++cit)
789 {
790 add_trap_level (trap, *cit);
791 }
792 }
793
794 MeshT mesh_;
796
797 // device data:
798 std::vector<double> cell_doping_n_;
799 std::vector<double> cell_doping_p_;
800
801 std::vector<double> cell_temperature_; //TODO: Think about handling temperatures in device
802
804 std::vector<double> cell_contact_potential_;
805
806 std::vector<material_id_type> cell_material_;
807
808 std::vector<trap_level_container_type> cell_traps_;
809
810 std::vector<double> cell_fixed_charges_;
811 };
812
813 }
814
816 template<typename MeshT, bool edges_and_cells_different /* see forwards.h for default argument */>
817 class device : public detail::device_base<MeshT>
818 {
819 };
820
821} //namespace viennashe
822
823#endif
Contains the definition of per-device accessors (read-only!) for various quantities.
Defines the physical properties of a device, e.g. doping.
Definition: device.hpp:55
double get_doping(cell_type const &c, carrier_type_id ctype) const
Definition: device.hpp:437
void generate_mesh(viennashe::util::device_generation_config const &generator_params)
Definition: device.hpp:128
std::vector< bool > cell_contact_potential_mask_
Definition: device.hpp:803
void set_material(long material_id, cell_type const &elem)
Sets the material ID on a cell.
Definition: device.hpp:448
void load_device(DeviceLoaderType &loader)
Definition: device.hpp:121
viennagrid::result_of::vertex< MeshT >::type vertex_type
Definition: device.hpp:59
void set_material(MaterialType)
Sets a uniform material type using the structs defined in viennashe::materials on the whole device.
Definition: device.hpp:495
viennagrid::result_of::segment_handle< segmentation_type >::type segment_type
Definition: device.hpp:71
double get_doping_p(facet_type const &facet) const
Definition: device.hpp:399
void add_trap_level(trap_level_type trap, cell_type const &cell)
Adds a trap (density, energy) to a cell of the device.
Definition: device.hpp:594
void load_mesh(std::string filename)
Definition: device.hpp:96
void set_doping_p_impl(double value, cell_type const &c)
Definition: device.hpp:702
void set_doping_n_impl(double value, MeshOrSegmentT const &meshseg)
Definition: device.hpp:715
segmentation_type & segmentation()
Definition: device.hpp:161
bool has_contact_potential(cell_type const &c) const
Returns true if a contact potential has been set for the respective vertex.
Definition: device.hpp:577
std::vector< double > cell_doping_n_
Definition: device.hpp:798
double get_lattice_temperature(cell_type const &c) const
Returns the lattice temperature on a cell.
Definition: device.hpp:255
void scale(double factor)
Definition: device.hpp:173
bool has_contact_potential(facet_type const &) const
Definition: device.hpp:583
void add_trap_level(trap_level_type trap)
Adds a trap (density, energy) to the whole device.
Definition: device.hpp:608
void set_material(long material_id)
Sets a uniform material ID on the whole device.
Definition: device.hpp:487
void set_material(long material_id, segment_type const &seg)
Sets the material ID on a segment.
Definition: device.hpp:464
viennagrid::result_of::segmentation< MeshT >::type segmentation_type
Definition: device.hpp:57
void set_lattice_temperature(double new_value, segment_type const &s)
Sets the lattice temperature on a segment.
Definition: device.hpp:248
segmentation_type seg_
Definition: device.hpp:795
void set_doping_n(double value)
Sets the donator doping (in m^-3) in the whole device.
Definition: device.hpp:313
void set_lattice_temperature(double new_value, cell_type const &c)
Sets the lattice temperature at a cell.
Definition: device.hpp:241
segmentation_type const & segmentation() const
Definition: device.hpp:156
void refine(int factor)
Definition: device.hpp:180
viennagrid::result_of::point< MeshT >::type point_type
Definition: device.hpp:60
viennagrid::result_of::voronoi_cell_contribution< const_cell_handle_type >::type voronoi_contribution_container_type
Definition: device.hpp:80
std::vector< double > cell_fixed_charges_
Definition: device.hpp:810
void set_doping_p_impl(double value, MeshOrSegmentT const &meshseg)
Definition: device.hpp:736
void add_trap_level_on_complex(trap_level_type trap, MeshOrSegmentT const &meshseg)
Definition: device.hpp:780
double get_doping_p(cell_type const &c) const
Returns the donator doping (in m^-3) in the specified cell.
Definition: device.hpp:393
void set_lattice_temperature(double new_value)
Sets the homogeneous temperature of the device.
Definition: device.hpp:234
long get_material(cell_type const &elem) const
Returns the material id of the provided cell.
Definition: device.hpp:502
std::vector< double > cell_temperature_
Definition: device.hpp:801
double get_lattice_temperature(facet_type const &facet) const
Definition: device.hpp:265
void clear_traps()
Removes all traps from the device.
Definition: device.hpp:622
void set_fixed_charge(cell_type const &c, double charge)
Sets a fixed charge at a cell.
Definition: device.hpp:637
void set_contact_potential(double pot, cell_type const &c)
Sets the contact potential at a cell.
Definition: device.hpp:542
segment_type const & segment(segment_id_type id) const
Definition: device.hpp:167
std::vector< trap_level_container_type > cell_traps_
Definition: device.hpp:808
void set_material(MaterialType, cell_type const &elem)
Sets the material type using the structs defined in viennashe::materials on a cell.
Definition: device.hpp:456
std::vector< double > const & doping_p() const
Definition: device.hpp:431
void set_material_on_complex(long material_id, MeshOrSegmentT const &meshseg)
Definition: device.hpp:761
std::vector< double > cell_contact_potential_
Definition: device.hpp:804
void set_doping_p(double value, cell_type const &c)
Sets the acceptor doping (in m^-3) in the specified cell.
Definition: device.hpp:365
viennagrid::result_of::cell< MeshT >::type cell_type
Definition: device.hpp:67
viennagrid::result_of::const_cell_handle< MeshT >::type const_cell_handle_type
Definition: device.hpp:62
std::vector< material_id_type > const & material() const
Definition: device.hpp:508
void set_material(MaterialType, segment_type const &seg)
Sets the material type using the structs defined in viennashe::materials on a segment.
Definition: device.hpp:479
MeshT const & mesh() const
Returns the underlying mesh.
Definition: device.hpp:145
double get_doping_n(cell_type const &c) const
Returns the donator doping (in m^-3) in the specified cell.
Definition: device.hpp:320
void set_lattice_temp_impl(double value, cell_type const &c)
Definition: device.hpp:659
viennagrid::result_of::facet< MeshT >::type facet_type
Definition: device.hpp:66
void set_doping_n_impl(double value, cell_type const &c)
Definition: device.hpp:690
double get_contact_potential(cell_type const &c) const
Returns the contact potential at a given cell (this is the externally applied voltage not considering...
Definition: device.hpp:566
void set_material(long material_id, segment_id_type id)
Sets the material ID on a segment.
Definition: device.hpp:471
trap_level_container_type const & get_trap_levels(cell_type const &cell) const
Returns all the trap levels defined for the provided cell.
Definition: device.hpp:615
void set_doping_n(double value, cell_type const &c)
Sets the donator doping (in m^-3) in the specified cell.
Definition: device.hpp:292
void set_doping_p(double value)
Sets the acceptor doping (in m^-3) in the whole device.
Definition: device.hpp:386
void set_doping_n(double value, segment_id_type const &seg_id)
Sets the donator doping (in m^-3) in the specified segment.
Definition: device.hpp:306
std::vector< double > const & doping_n() const
Definition: device.hpp:358
void generate_mesh(MeshGeneratorType const &gen)
Definition: device.hpp:137
void add_trap_level(trap_level_type trap, segment_type const &seg)
Adds a trap (density, energy) to a segment of the device.
Definition: device.hpp:601
void set_contact_potential(double pot, segment_type const &seg)
Sets a contact potential for a whole segment.
Definition: device.hpp:550
double get_doping_n(facet_type const &facet) const
Definition: device.hpp:326
void set_doping_n(double value, segment_type const &d)
Sets the donator doping (in m^-3) in the specified segment.
Definition: device.hpp:299
viennagrid::result_of::segmentation_segment_id_type< segmentation_type >::type segment_id_type
Definition: device.hpp:73
void set_lattice_temp_impl(double value, MeshOrSegmentT const &meshseg)
Definition: device.hpp:666
std::vector< double > cell_doping_p_
Definition: device.hpp:799
viennagrid::result_of::accessor_container< cell_type, bool, viennagrid::std_vector_tag >::type CellRefinementContainerType
Definition: device.hpp:69
std::vector< trap_level_type > trap_level_container_type
Definition: device.hpp:77
void set_doping_p(double value, segment_type const &d)
Sets the acceptor doping (in m^-3) in the specified segment.
Definition: device.hpp:372
std::vector< material_id_type > cell_material_
Definition: device.hpp:806
void set_doping_p(double value, segment_id_type const &seg_id)
Sets the donator doping (in m^-3) in the specified segment.
Definition: device.hpp:379
double get_fixed_charge(cell_type const &c) const
Gives the fixed charge set at a certain cell.
Definition: device.hpp:648
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Definition: device.hpp:818
Exception for the case that an invalid value (depends on the method called) is encountered.
Definition: exception.hpp:76
Describes a SRH trap.
Definition: trap_level.hpp:31
Configuration class for the simple mesh generator.
Provides the exceptions used in the main viennashe namespace.
Contains forward declarations and definition of small classes that must be defined at an early stage.
Contains a very simple mesh generator (ortho-grids) for one and two spatial dimensions.
A very simple material database. Needs to be replaced by something more versatile soon.
bool is_semiconductor(long material_id)
Convenience function for checking whether the supplied material ID refers to a semiconductor.
Definition: all.hpp:156
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...
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40
carrier_type_id
Enumeration type for selecting the carrier type.
Definition: forwards.h:185
@ ELECTRON_TYPE_ID
Definition: forwards.h:187
Provides a number of fundamental constants. All constants in SI units.
Contains the definition of convenience functors for accessing device quantities (see class device)....
Contains the definition of a trap level.