1#ifndef VIENNASHE_SHE_SCATTERING_SURFACE_ROUGHNESS_SCATTERING_HPP
2#define VIENNASHE_SHE_SCATTERING_SURFACE_ROUGHNESS_SCATTERING_HPP
18#ifdef VIENNASHE_USE_DISABLED_CODE
34#include "viennagrid/forwards.hpp"
35#include "viennagrid/algorithm/inner_prod.hpp"
36#include "viennagrid/algorithm/norm.hpp"
51 template <
typename DeviceType,
typename ControllerType,
typename ElectricFieldAccessor>
52 class surface_roughness_scattering :
public scattering_base<DeviceType, ControllerType>
54 typedef scattering_base<DeviceType, ControllerType> base_type;
55 typedef typename base_type::VertexType VertexType;
56 typedef typename base_type::EdgeType EdgeType;
59 typedef typename base_type::scatter_processes_type scatter_processes_type;
60 typedef scatter_processes_type value_type;
62 explicit surface_roughness_scattering(
const viennashe::materials::surface_roughness_scattering_parameters & params,
63 ElectricFieldAccessor
const & Efield)
64 : _params(params), _Efield(Efield) { }
66 scatter_processes_type operator()(DeviceType
const & device,
67 ControllerType
const & controller,
68 VertexType
const & elem,
69 double kinetic_energy,
72 return get(device, controller, elem, kinetic_energy, ctype);
75 scatter_processes_type operator()(DeviceType
const & device,
76 ControllerType
const & controller,
77 EdgeType
const & elem,
78 double kinetic_energy,
81 return get(device, controller, elem, kinetic_energy, ctype);
99 template <
typename ElementType>
100 scatter_processes_type get(DeviceType
const & device,
101 ControllerType
const & controller,
102 ElementType
const & elem,
103 double kinetic_energy,
106 scatter_processes_type result(1);
109 result[0].initial_energy(kinetic_energy);
110 result[0].final_energy(kinetic_energy);
111 result[0].rate(getScatteringRate(device, controller, elem, kinetic_energy, ctype));
116 template <
typename DeviceType,
typename ControllerType,
typename ElementType>
117 double getScatteringRate(DeviceType
const & device,
118 ControllerType
const & controller,
119 ElementType
const & elem,
120 double kinetic_energy,
123 const double temp = device.get_lattice_temperature(elem);
124 const double Ep = this->get_electric_field_n(device, elem, ctype);
128 return this->getScatteringRate(temp, Ep, ctype);
131 template <
typename DeviceType>
132 double get_electric_field_n(DeviceType
const & device,
133 typename viennagrid::result_of::ncell<typename DeviceType::mesh_type::config_type, 0 > ::type
const & vt,
136 typedef typename DeviceType::mesh_type MeshType;
137 typedef typename MeshType::config_type Config;
138 typedef typename Config::cell_tag CellTag;
139 typedef typename viennagrid::result_of::point<Config>::type PointType;
142 typename ElectricFieldAccessor::value_type Eacc = _Efield(vt);
143 for ( std::size_t i = 0; i < PointType::dim; i++) E[i] = Eacc[i];
145 PointType n = device.vector_to_next_insulator(vt);
148 if ( this->_params.get_correlation_length(tag) < distance )
150 if ( distance > 0) n /= distance;
153 return viennagrid::inner_prod(E, n);
159 template <
typename DeviceType>
160 double get_electric_field_n(DeviceType
const & device,
161 typename viennagrid::result_of::ncell<typename DeviceType::mesh_type::config_type, 1 > ::type
const & edge,
165 return 0.5 * (this->get_electric_field_n(device, viennagrid::ncells < 0 > (edge)[0], tag) +
166 this->get_electric_field_n(device, viennagrid::ncells < 0 > (edge)[1], tag));
179 const double drms = _params.get_rms_height(ctype);
180 const double L = _params.get_correlation_length(ctype);
182 const double Eeff = this->getEffectiveField(T, Ep, ctype);
185 double scattering_rate = 2.0 * pi * q * q / hbar * (esi * esi) * drms * drms * L * L;
186 scattering_rate = scattering_rate * Eeff * Eeff;
188 return _params.get_fit_factor() * scattering_rate;
193 viennashe::materials::surface_roughness_scattering_parameters _params;
194 ElectricFieldAccessor
const & _Efield;
Contains the definition of per-device accessors (read-only!) for various quantities.
Contains the dispersion relations for different materials and different polarities.
A logging facility providing fine-grained control over logging in ViennaSHE.
A very simple material database. Needs to be replaced by something more versatile soon.
Provides a number of fundamental math constants.
VectorType::value_type norm_2(VectorType const &v)
@ SURFACE_ROUGHNESS_SCATTERING
The main ViennaSHE namespace. All functionality resides inside this namespace.
carrier_type_id
Enumeration type for selecting the carrier type.
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.
static double permittivity()
static const double pi
Pi.
static const double q
Elementary charge.
static const double hbar
Modified Planck constant.
Defines the log keys used within the viennashe::she namespace.
Common classes for scattering operators.