1#ifndef VIENNASHE_SHE_BOUNDARY_CONDITIONS_HPP
2#define VIENNASHE_SHE_BOUNDARY_CONDITIONS_HPP
24#include "viennagrid/mesh/mesh.hpp"
55 template <
typename DeviceType,
56 typename VertexT,
typename EdgeT>
61 typedef typename DeviceType::mesh_type MeshType;
63 typedef typename viennagrid::result_of::const_cell_range<MeshType>::type CellContainer;
64 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
73 CellContainer cells(mesh);
74 for (CellIterator cit = cells.begin();
86 for (std::size_t index_H = 1;
91 double energy_lower = std::max<double>((quan.
get_kinetic_energy(*cit, index_H - 1) + energy_mid) / 2.0, 0.0);
94 if (energy_lower < energy_upper && (energy_upper >= 0))
96 double height =
box_height(quan, *cit, index_H);
106 for (std::size_t index_H = 1; index_H < quan.
get_value_H_size() - 1; ++index_H)
109 double energy_lower = std::max<double>((quan.
get_kinetic_energy(*cit, index_H - 1) + energy) / 2.0, 0.0);
112 double bnd_value = 0.0;
113 if (energy_lower < energy_upper && (energy_upper >= 0))
120 bnd_value = bnd_carrier_density(*cit, TL) * exp(-energy / (kB * T)) / bnd_corr;
123 bnd_value = bnd_carrier_density(*cit, TL) *
averaged_density_of_states(quan, dispersion, *cit, index_H) * exp(-energy / (kB * T)) / bnd_corr;
126 throw std::runtime_error(
"Unknown SHE discretization type");
137 template <
typename DeviceType>
Contains the definition of per-device accessors (read-only!) for various quantities.
Provides an accessor for the carrier density.
The main SHE configuration class. To be adjusted by the user for his/her needs.
viennashe::physics::dispersion_proxy dispersion_relation(viennashe::carrier_type_id ctype) const
Returns the dispersion relation for electrons.
equation_id get_electron_equation() const
bool with_holes() const
Returns true if holes are considered in the simulation.
equation_id get_hole_equation() const
bool with_electrons() const
Returns true if electrons are considered in the simulation.
she_discretization_type_id she_discretization_type() const
double get_lattice_temperature(cell_type const &c) const
Returns the lattice temperature on a cell.
MeshT const & mesh() const
Returns the underlying mesh.
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
A proxy object for a dispersion relation. Does NOT take ownership of the provided pointer!
double symmetry_factor() const
The main SHE simulator controller class. Acts as an accessor for all SHE quantities needed for the si...
UnknownSHEQuantityType const & electron_distribution_function() const
UnknownSHEQuantityType const & hole_distribution_function() const
General representation of any solver quantity defined on two different element types (e....
carrier_type_id get_carrier_type_id() const
std::size_t get_value_H_size() const
ValueT get_kinetic_energy(AssociatedT1 const &elem, std::size_t index_H) const
void set_boundary_value(AssociatedT1 const &elem, std::size_t index_H, ValueT value)
The SHE configuration class is defined here.
Contains the dispersion relations for different materials and different polarities.
Contains forward declarations and definition of small classes that must be defined at an early stage.
double averaged_density_of_states(SHEQuantity const &quan, viennashe::config::dispersion_relation_type const &dispersion, CellFacetType const &cell_facet, std::size_t index_H)
Returns the density of states around a vertex or an edge at total energy specified by index_H....
void write_boundary_conditions(DeviceType const &device, viennashe::she::unknown_she_quantity< VertexT, EdgeT > &quan, viennashe::config const &conf)
Writes boundary conditions for SHE to the device. Stores the result using ViennaData.
double box_height(SHEQuantity const &quan, ElementType const &elem, std::size_t index_H)
Returns the height of the control box with respect to energy at the provided element (vertex or edge)...
The main ViennaSHE namespace. All functionality resides inside this namespace.
@ SHE_DISCRETIZATION_EVEN_ODD_ORDER_GENERALIZED_DF
@ SHE_DISCRETIZATION_EVEN_ODD_ORDER_DF
Provides a number of fundamental constants. All constants in SI units.
Returns a few helper routines for computing physical quantities. To be replaced in the future.
Defines a SHE quantity in (x, H)-space for use within the solvers of ViennaSHE.
static const double kB
Boltzmann constant.
A container of all quantities defined for a certain timestep t.