1#ifndef VIENNASHE_SHE_RESCALING_HPP
2#define VIENNASHE_SHE_RESCALING_HPP
29#include "viennagrid/mesh/mesh.hpp"
47 template <
typename DeviceType,
53 VectorType & scaling_vector)
55 typedef typename DeviceType::mesh_type MeshType;
56 typedef typename viennagrid::result_of::const_cell_range<MeshType>::type CellContainer;
57 typedef typename viennagrid::result_of::iterator<CellContainer>::type CellIterator;
60 for (CellIterator cit = cells.begin();
66 for (std::size_t index_H = 0; index_H < quan.get_value_H_size(); ++index_H)
68 long index_base = quan.get_unknown_index(*cit, index_H);
72 long num_per_node =
static_cast<long>(quan.get_unknown_num(*cit, index_H));
73 for (
long i=0; i<num_per_node; ++i)
89 template <
typename MatrixType,
92 VectorType
const & scaling)
94 typedef typename MatrixType::row_type RowType;
95 typedef typename MatrixType::iterator2 AlongRowIterator;
97 for (std::size_t i=0; i<system_matrix.size1(); ++i)
99 RowType & row_i = system_matrix.row(i);
100 for (AlongRowIterator iter = row_i.begin();
104 iter->second *= scaling[iter->first];
The main SHE configuration class. To be adjusted by the user for his/her needs.
she_scaling_type_id she_scaling_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...
The SHE configuration class is defined here.
void rescale_system(MatrixType &system_matrix, VectorType const &scaling)
Scales the system matrix (right-preconditioner) with respect to the rescaled unknowns.
void setup_unknown_scaling(DeviceType const &device, viennashe::config const &conf, SHEQuantity &quan, VectorType &scaling_vector)
Initializes the unknown scaling. Returns a vector holding the scaling factors.
The main ViennaSHE namespace. All functionality resides inside this namespace.
@ SHE_SCALING_KINETIC_ENERGY
Provides a number of fundamental constants. All constants in SI units.
Defines a SHE quantity in (x, H)-space for use within the solvers of ViennaSHE.
static const double kB
Boltzmann constant.