public void Get_ChargeDensity(ILayer[] layers, ref SpinResolved_Data charge_density, Band_Data chem_pot) { SpinResolved_Data electron_density = charge_density.DeepenThisCopy(); SpinResolved_Data hole_density = charge_density.DeepenThisCopy(); // remove the electron density from the hole density SpinResolved_Data and vice versa for (int i = 0; i < electron_density.Spin_Summed_Data.Length; i++) { if (electron_density.Spin_Summed_Data.vec[i] > 0.0) { electron_density.Spin_Up[i] = 0.0; electron_density.Spin_Down[i] = 0.0; } if (hole_density.Spin_Summed_Data.vec[i] < 0.0) { hole_density.Spin_Up[i] = 0.0; hole_density.Spin_Down[i] = 0.0; } } electron_dens_calc.Get_ChargeDensity(layers, ref electron_density, chem_pot); hole_dens_calc.Get_ChargeDensity(layers, ref hole_density, chem_pot); charge_density = electron_density + hole_density; }
/// <summary> /// protects carrier_density such that its values are not overriden /// </summary> public override SpinResolved_Data Get_ChargeDensity(ILayer[] layers, SpinResolved_Data carrier_density, SpinResolved_Data dopent_density, Band_Data chem_pot) { SpinResolved_Data tmp_dens = carrier_density.DeepenThisCopy(); Get_ChargeDensity(layers, ref tmp_dens, ref dopent_density, chem_pot); return(tmp_dens + dopent_density); }
public SpinResolved_Data Get_ChargeDensity_Deriv(ILayer[] layers, SpinResolved_Data carrier_density_deriv, SpinResolved_Data dopent_density_deriv, Band_Data chem_pot) { SpinResolved_Data electron_density_deriv = carrier_density_deriv.DeepenThisCopy(); SpinResolved_Data hole_density_deriv = carrier_density_deriv.DeepenThisCopy(); // remove the electron density from the hole density SpinResolved_Data and vice versa for (int i = 0; i < electron_density_deriv.Spin_Summed_Data.Length; i++) { if (electron_density_deriv.Spin_Summed_Data.vec[i] > 0.0) { electron_density_deriv.Spin_Up[i] = 0.0; electron_density_deriv.Spin_Down[i] = 0.0; } if (hole_density_deriv.Spin_Summed_Data.vec[i] < 0.0) { hole_density_deriv.Spin_Up[i] = 0.0; hole_density_deriv.Spin_Down[i] = 0.0; } } return(electron_dens_calc.Get_ChargeDensity_Deriv(layers, electron_density_deriv, dopent_density_deriv, chem_pot) + hole_dens_calc.Get_ChargeDensity_Deriv(layers, hole_density_deriv, dopent_density_deriv, chem_pot)); }
public SpinResolved_Data Get_ChargeDensity(ILayer[] layers, SpinResolved_Data carrier_charge_density, SpinResolved_Data dopent_charge_density, Band_Data chem_pot) { SpinResolved_Data electron_density = carrier_charge_density.DeepenThisCopy(); SpinResolved_Data hole_density = carrier_charge_density.DeepenThisCopy(); // remove the electron density from the hole density SpinResolved_Data and vice versa for (int i = 0; i < electron_density.Spin_Summed_Data.Length; i++) { if (electron_density.Spin_Summed_Data.vec[i] > 0.0) { electron_density.Spin_Up[i] = 0.0; electron_density.Spin_Down[i] = 0.0; } if (hole_density.Spin_Summed_Data.vec[i] < 0.0) { hole_density.Spin_Up[i] = 0.0; hole_density.Spin_Down[i] = 0.0; } } // must remove one lot of dopents due to double counting return(electron_dens_calc.Get_ChargeDensity(layers, electron_density, dopent_charge_density, chem_pot) + hole_dens_calc.Get_ChargeDensity(layers, hole_density, dopent_charge_density, chem_pot) - dopent_charge_density); }