1#ifndef VIENNASHE_SHE_SETUP_ENERGIES_HPP
2#define VIENNASHE_SHE_SETUP_ENERGIES_HPP
22#include "viennagrid/mesh/mesh.hpp"
23#include "viennagrid/config/default_configs.hpp"
59 template <
typename DeviceT,
60 typename VertexT,
typename EdgeT>
67 typedef typename DeviceT::mesh_type MeshType;
69 typedef typename viennagrid::result_of::facet<MeshType>::type FacetType;
70 typedef typename viennagrid::result_of::cell<MeshType>::type CellType;
72 typedef typename viennagrid::result_of::const_facet_range<MeshType>::type FacetContainer;
73 typedef typename viennagrid::result_of::iterator<FacetContainer>::type FacetIterator;
75 typedef typename viennagrid::result_of::const_cell_range<MeshType>::type CellContainer;
76 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
78 typedef typename viennagrid::result_of::const_coboundary_range<MeshType, FacetType, CellType>::type CellOnFacetContainer;
82 double max_potential = -1.0 * std::numeric_limits<double>::max();
83 double min_potential = std::numeric_limits<double>::max();
90 CellContainer cells(mesh);
91 for (CellIterator cit = cells.begin();
98 const double cell_potential =
potential.get_value(*cit) + quantum_correction.
get_value(*cit);
100 if (cell_potential < min_potential) min_potential = cell_potential;
101 if (cell_potential > max_potential) max_potential = cell_potential;
116 total_energy_bandedge = -total_energy_increment;
120 std::size_t num_energies =
static_cast<std::size_t
>(total_energy_range / conf.
energy_spacing()) + 1;
121 quan.
resize(viennagrid::cells(mesh).size(), viennagrid::facets(mesh).size(), num_energies);
124 quan.
set_value_H(index_H, total_energy_bandedge + index_H * total_energy_increment);
130 for (CellIterator cit = cells.begin();
140 FacetContainer facets(mesh);
141 for (FacetIterator fit = facets.begin();
145 CellOnFacetContainer cells_on_facet(mesh, fit.handle());
146 if (cells_on_facet.size() == 2)
161 template <
typename DeviceType>
Contains the definition of per-device accessors (read-only!) for various quantities.
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.
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
double energy_spacing() const
Returns the uniform energy spacing of discrete energies.
bool use_h_transformation() const
Returns whether the H-transformation is used.
bool with_electrons() const
Returns true if electrons are considered in the simulation.
long get_material(cell_type const &elem) const
Returns the material id of the provided 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...
The main SHE simulator controller class. Acts as an accessor for all SHE quantities needed for the si...
UnknownSHEQuantityType const & electron_distribution_function() const
UnknownQuantityType & get_unknown_quantity(std::string quantity_name)
Returns a reference to the unkown quantity identified by its name.
UnknownSHEQuantityType const & hole_distribution_function() const
General representation of any solver quantity defined on two different element types (e....
void set_bandedge_shift(AssociatedT1 const &elem, ValueT value)
ValueT get_bandedge_shift(AssociatedT1 const &elem) const
carrier_type_id get_carrier_type_id() const
std::size_t get_value_H_size() const
void resize(std::size_t num_values_1, std::size_t num_values_2)
void set_value_H(std::size_t index_H, ValueT value)
ValueT get_value(associated_type const &elem) const
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.
A logging facility providing fine-grained control over logging in ViennaSHE.
bool is_semiconductor(long material_id)
Convenience function for checking whether the supplied material ID refers to a semiconductor.
std::string density_gradient_hole_correction()
std::string density_gradient_electron_correction()
void setup_energies(DeviceT const &device, viennashe::she::unknown_she_quantity< VertexT, EdgeT > &quan, viennashe::config const &conf, viennashe::unknown_quantity< VertexT > const &potential, viennashe::unknown_quantity< VertexT > const &quantum_correction)
Computes the kinetic energy over the device as obtained from the provided potential.
The main ViennaSHE namespace. All functionality resides inside this namespace.
Provides a number of fundamental constants. All constants in SI units.
Provides the exceptions used inside the viennashe::she namespace.
Defines a SHE quantity in (x, H)-space for use within the solvers of ViennaSHE.
Defines a generic simulator quantity for use within the solvers of ViennaSHE.
static const double q
Elementary charge.
A container of all quantities defined for a certain timestep t.