public virtual PlotDataSet GetChargeDensityDataset(Length offset) { var dataset = new PlotDataSet { Name = Name, PlotColor = FillColor, LineThickness = 2 }; foreach (var point in EvalPoints) { var location = point.Location + offset; var charge = point.ChargeDensity; dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = 0.0 }); dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = charge.MicroCoulombsPerSquareCentimeter }); dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = 0.0 }); } return(dataset); }
public override PlotDataSet GetChargeDensityDataset(Length offset) { var dataset = new PlotDataSet { Name = Name, PlotColor = FillColor, LineThickness = 2 }; for (var i = 1; i < EvalPoints.Count; i++) { var location = EvalPoints[i].Location + offset; var charge = EvalPoints[i].ChargeDensity; if (i == 0) { dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = 0.0 }); } dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = charge.MicroCoulombsPerSquareCentimeter }); } return(dataset); }
public virtual PlotDataSet GetElectricFieldDataset(Length offset) { var dataset = new PlotDataSet { Name = Name, PlotColor = FillColor, LineThickness = 2 }; if (ParentStructure.Layers.IndexOf(this) > 0) { var previousMaterial = ParentStructure.Layers[ParentStructure.Layers.IndexOf(this) - 1]; dataset.DataPoints.Add(new PlotDataPoint { X = offset.Nanometers, Y = previousMaterial.GetElectricFieldDataset(Length.Zero).DataPoints.Last().Y }); } foreach (var point in EvalPoints) { var location = point.Location + offset; dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = point.ElectricField.MegavoltsPerCentimeter }); } return(dataset); }
public override List <PlotDataSet> GetEnergyDatasets(Length offset) { var dataset = new PlotDataSet { Name = Name, LineThickness = 2, PlotColor = FillColor }; var startLocation = EvalPoints.First().Location + offset; var endLocation = EvalPoints.Last().Location + offset; var startEnergy = -EnergyFromVacuumToTopBand - EvalPoints.First().Potential; var endEnergy = -EnergyFromVacuumToTopBand - EvalPoints.Last().Potential; dataset.DataPoints.Add(new PlotDataPoint { X = startLocation.Nanometers, Y = startEnergy.ElectronVolts }); dataset.DataPoints.Add(new PlotDataPoint { X = endLocation.Nanometers, Y = endEnergy.ElectronVolts }); return(new List <PlotDataSet> { dataset }); }
public PlotDataSet GetPotentialDataset(Length offset) { var dataset = new PlotDataSet { Name = Name, PlotColor = FillColor, LineThickness = 2 }; foreach (var point in EvalPoints) { var location = point.Location + offset; var potential = point.Potential; dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = potential.Volts }); } return(dataset); }
public override PlotDataSet GetElectricFieldDataset(Length offset) { var dataset = new PlotDataSet { Name = Name, LineThickness = 2, PlotColor = FillColor }; var previousMaterial = ParentStructure.Layers[ParentStructure.Layers.IndexOf(this) - 1]; var lastEField = previousMaterial.GetLastElectricField(); foreach (var point in EvalPoints) { var location = point.Location + offset; if (point != EvalPoints.Last()) { dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = lastEField.MegavoltsPerCentimeter }); } lastEField = point.ElectricField; dataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = lastEField.MegavoltsPerCentimeter }); } return(dataset); }
public override List <PlotDataSet> GetEnergyDatasets(Length offset) { var cbDataset = new PlotDataSet { Name = String.Format("{0} - Conduction Band", Name), LineThickness = 2, PlotColor = FillColor }; var vbDataset = new PlotDataSet { Name = String.Format("{0} - Valance Band", Name), LineThickness = 2, PlotColor = FillColor }; var efiDataset = new PlotDataSet { Name = String.Format("{0} - Fermi Level", Name), LineThickness = 1, PlotColor = FillColor }; var wfDataset = new PlotDataSet { Name = String.Format("{0} - Work Function", Name), LineThickness = 1, PlotColor = Color.Black }; foreach (var point in EvalPoints) { Length location; // If this point is at 50nm or greater, we declare it to // be the last point, and we set it to be at 50nm so that it makes // a solid line on the plot. if (point.Location.Nanometers >= 50.0) { location = Length.FromNanometers(50.0) + offset; } else { location = point.Location + offset; } var cbEnergy = -EnergyFromVacuumToTopBand - point.Potential; var vbEnergy = -EnergyFromVacuumToBottomBand - point.Potential; var efiEnergy = -EnergyFromVacuumToEfi - point.Potential; var wfEnergy = -WorkFunction; if (double.IsNaN(location.Meters)) { Debug.WriteLine("Why is this NaN"); } cbDataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = cbEnergy.ElectronVolts }); vbDataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = vbEnergy.ElectronVolts }); efiDataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = efiEnergy.ElectronVolts }); wfDataset.DataPoints.Add(new PlotDataPoint { X = location.Nanometers, Y = wfEnergy.ElectronVolts }); // Any points greater than 50nm are ignored. if (point.Location.Nanometers > 50.0) { break; } } return(new List <PlotDataSet> { cbDataset, vbDataset, efiDataset, wfDataset }); }
public override List <PlotDataSet> GetEnergyDatasets(Length offset) { var dataset = new PlotDataSet { Name = Name, LineThickness = 2, PlotColor = FillColor }; var location1 = EvalPoints.First().Location + offset; var energy1 = -EnergyFromVacuumToTopBand - EvalPoints.First().Potential; dataset.DataPoints.Add(new PlotDataPoint { X = location1.Nanometers, Y = energy1.ElectronVolts }); var location2 = EvalPoints.First().Location + offset; var energy2 = -EnergyFromVacuumToBottomBand - EvalPoints.First().Potential; dataset.DataPoints.Add(new PlotDataPoint { X = location2.Nanometers, Y = energy2.ElectronVolts }); // for in between points foreach (var point in EvalPoints) { if (point == EvalPoints.First()) { continue; } var locationA = point.Location + offset; var energyA = -EnergyFromVacuumToBottomBand - point.Potential; dataset.DataPoints.Add(new PlotDataPoint { X = locationA.Nanometers, Y = energyA.ElectronVolts }); } // for the last point var location3 = EvalPoints.Last().Location + offset; var energy3 = -EnergyFromVacuumToTopBand - EvalPoints.Last().Potential; dataset.DataPoints.Add(new PlotDataPoint { X = location3.Nanometers, Y = energy3.ElectronVolts }); // for in between points foreach (var point in EvalPoints.Reverse <EvalPoint>()) { var locationB = point.Location + offset; var energyB = -EnergyFromVacuumToTopBand - point.Potential; dataset.DataPoints.Add(new PlotDataPoint { X = locationB.Nanometers, Y = energyB.ElectronVolts }); } var location4 = EvalPoints.First().Location + offset; var energy4 = -EnergyFromVacuumToTopBand - EvalPoints.First().Potential; dataset.DataPoints.Add(new PlotDataPoint { X = location4.Nanometers, Y = energy4.ElectronVolts }); return(new List <PlotDataSet> { dataset }); }