ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
expansion_order.hpp
Go to the documentation of this file.
1#ifndef VIENNASHE_SHE_POSTPROC_EXPANSION_ORDER_HPP
2#define VIENNASHE_SHE_POSTPROC_EXPANSION_ORDER_HPP
3
4/* ============================================================================
5 Copyright (c) 2011-2022, Institute for Microelectronics,
6 Institute for Analysis and Scientific Computing,
7 TU Wien.
8
9 -----------------
10 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
11 -----------------
12
13 http://viennashe.sourceforge.net/
14
15 License: MIT (X11), see file LICENSE in the base directory
16=============================================================================== */
17
18
19
20#include <math.h>
21#include <fstream>
22#include <iostream>
23
24#include "viennagrid/mesh/mesh.hpp"
25
26#include "viennashe/forwards.h"
29
34namespace viennashe
35{
36 namespace she
37 {
38
40 template <typename DeviceType, typename SHEQuantity>
42 {
43 public:
44
45 typedef double value_type;
46
47 average_expansion_order_wrapper(SHEQuantity const & quan,
48 double energy_start,
49 double energy_end) : quan_(quan),
50 energy_start_(energy_start),
51 energy_end_(energy_end) {}
52
53 template <typename CellType>
54 value_type operator()(CellType const & cell) const
55 {
56 double sum_order = 0; //summation of all expansion orders
57 long num_energies = 0; //no of energy points considered
58
59 for (std::size_t index_H=1; index_H<quan_.get_value_H_size() - 1; ++index_H)
60 {
61 double kinetic_energy = quan_.get_kinetic_energy(cell, index_H);
62
63 if (kinetic_energy >= energy_start_ && kinetic_energy <= energy_end_)
64 {
65 sum_order += quan_.get_expansion_order(cell, index_H);
66 ++num_energies;
67 }
68 }
69
70 return sum_order / num_energies;
71 }
72
73 private:
74 SHEQuantity quan_;
75 double energy_start_;
76 double energy_end_;
77 };
78
87 template <typename DeviceType,
88 typename SHEQuantity,
89 typename ContainerType>
91 SHEQuantity const & quan,
92 ContainerType & container,
93 double energy_start = 0.0,
94 double energy_end = 1.0)
95 {
96 average_expansion_order_wrapper<DeviceType, SHEQuantity> wrapper(quan, energy_start, energy_end);
97
99 }
100
101 } //namespace she
102} //namespace viennashe
103
104#endif
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Definition: device.hpp:818
Accessor class providing the average expansion order inside the device.
average_expansion_order_wrapper(SHEQuantity const &quan, double energy_start, double energy_end)
value_type operator()(CellType const &cell) const
Contains forward declarations and definition of small classes that must be defined at an early stage.
Writer for arbitrary macroscopic quantities.
void write_average_expansion_order_to_container(DeviceType const &device, SHEQuantity const &quan, ContainerType &container, double energy_start=0.0, double energy_end=1.0)
Convenience function for writing the average expansion order to the container provided.
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40
void write_macroscopic_quantity_to_container(DeviceType const &device, MacroscopicQuantityAccessor const &quantity, ContainerType &quantity_container)
Writes the provided macroscopic quantity to the container provided.
Definition: macroscopic.hpp:46
Provides a number of fundamental constants. All constants in SI units.