########################################################################## # Scriptfile: extractCharge_cdc.lsf # # Description: # This file extracts the carrier density as a function of voltage, # interpolates the points onto a rectangular grid and imports the results # into a .ldf file. # # Inputs: # contactName: The name of the contact for which the bias is swept # geometryName: The names of the rectangular geometries where the # charge will be interpolated. This is an input to # interpChargeInRect. # # Outputs: results are saved to rectCharge_.ldf # # Copyright 2012, Lumerical Solutions, Inc. ########################################################################### contactName = "anode"; # use the contact voltages downsample_step = 2; v_start = 0; v = getdata("CHARGE","charge","V_"+contactName); if (downsample_step < 0) { vindex = find(v <= (v_start + 1e-9)); } else { vindex = find(v >= (v_start - 1e-9)); } vindex = vindex(1:abs(downsample_step):length(vindex)); v = v(vindex); nv = length(v); savedata('sweepVoltage.ldf',v); geometryName = "slab"; ?"Starting interpolation for " + geometryName; interpChargeInRect_cdc; geometryName = "wgl"; ?"Starting interpolation for " + geometryName; interpChargeInRect_cdc; geometryName = "wgr"; ?"Starting interpolation for " + geometryName; interpChargeInRect_cdc; ?"Finished";