public override void Get_ChargeDensity(ILayer[] layers, ref SpinResolved_Data density, Band_Data chem_pot) { for (int i = 0; i < nx; i++) for (int j = 0; j < ny; j++) for (int k = 0; k < nz; k++) { double x = dx * i + xmin; double y = dy * j + ymin; double z = dz * k + zmin; // get the relevant layer ILayer current_Layer = Solver_Bases.Geometry.Geom_Tool.GetLayer(layers, x, y, z); // calculate the density at the given point ZeroD_Density charge_calc = new ZeroD_Density(current_Layer, temperature); double local_charge_density = charge_calc.Get_CarrierDensity(chem_pot.vol[k][i, j]); // as there is no spin dependence in this problem yet, just divide the charge into spin-up and spin-down components equally density.Spin_Down.vol[k][i, j] = 0.5 * local_charge_density; density.Spin_Up.vol[k][i, j] = 0.5 * local_charge_density; } }
public override void Get_ChargeDensity(ILayer[] layers, ref SpinResolved_Data density, Band_Data chem_pot) { for (int i = 0; i < nx; i++) for (int j = 0; j < ny; j++) { // do not add anything to the density if on the edge of the domain if (i == 0 || i == nx - 1 || j == 0 || j == ny - 1) continue; double x = dx * i + xmin; double y = dy * j + ymin; // get the relevant layer ILayer current_Layer = Solver_Bases.Geometry.Geom_Tool.GetLayer(layers, plane, x, y, pos_z); // calculate the density at the given point ZeroD_Density charge_calc = new ZeroD_Density(current_Layer, temperature); double local_charge_density = charge_calc.Get_CarrierDensity(chem_pot.mat[i, j]); // as there is no spin dependence in this problem yet, just divide the charge into spin-up and spin-down components equally density.Spin_Down.mat[i, j] = 0.5 * local_charge_density; density.Spin_Up.mat[i, j] = 0.5 * local_charge_density; } }
public override void Get_ChargeDensity(ILayer[] layers, ref SpinResolved_Data carrier_density, ref SpinResolved_Data dopent_density, Band_Data chem_pot) { Band_Data car_dens_spin_summed = carrier_density.Spin_Summed_Data; Band_Data dop_dens_spin_summed = dopent_density.Spin_Summed_Data; for (int i = 0; i < nz; i++) { double z = dz * i + zmin; double local_dopent_density; double local_carrier_density = car_dens_spin_summed.vec[i]; // get the relevant layer and if it's frozen out, don't recalculate the charge ILayer current_Layer = Solver_Bases.Geometry.Geom_Tool.GetLayer(layers, z); // calculate the density at the given point ZeroD_Density charge_calc = new ZeroD_Density(current_Layer, temperature); if (!current_Layer.Dopents_Frozen_Out(temperature)) { local_dopent_density = charge_calc.Get_DopentDensity(chem_pot.vec[i]); local_carrier_density = charge_calc.Get_CarrierDensity(chem_pot.vec[i]); } else { // if the density is frozen out, on the first step, this will add the carrier density to the dopent density // to give a total, frozen-out charge. After that, the local carrier density is set to zero and so this value // should not change local_dopent_density = dop_dens_spin_summed.vec[i]; local_carrier_density = charge_calc.Get_CarrierDensity(chem_pot.vec[i]); } // as there is no spin dependence in this problem yet, just divide the charge into spin-up and spin-down components equally dopent_density.Spin_Down.vec[i] = 0.5 * local_dopent_density; dopent_density.Spin_Up.vec[i] = 0.5 * local_dopent_density; carrier_density.Spin_Down.vec[i] = 0.5 * local_carrier_density; carrier_density.Spin_Up.vec[i] = 0.5 * local_carrier_density; } }