protected override void Set_Material_Parameters() { material = Material.Substrate; Material specific_material = Material.GaAs; ILayer tmp_layer; if (specific_material == Material.GaAs) { tmp_layer = new GaAs_Layer(new Slab(0.0, 0.0), -1); } else if (specific_material == Material.AlGaAs) { // create a temporary gaas layer to obtain the material properties from (assume typical 33% AlGaAs) tmp_layer = new AlGaAs_Layer(new Slab(0.0, 0.0), -1, 0.33); } else { throw new NotImplementedException(); } permitivity = tmp_layer.Permitivity; // set the GaAs band gap and acceptor/donor energies are positivie and show how far from the band gap centre the donors are this.band_gap = tmp_layer.Band_Gap; allow_donors = true; this.acceptor_energy = tmp_layer.Acceptor_Energy; this.donor_energy = tmp_layer.Donor_Energy; }
static ILayer Create_Layer(Dictionary<string, object> data) { // get various necessary properties from this list Material mat = Layer_Tool.GetMaterial((string)data["mat"]); Geometry_Type geom_type; if (data.ContainsKey("geom")) { geom_type = GetGeometryType((string)data["geom"]); } else geom_type = Geometry_Type.slab; // set geometry IGeom geom; switch (geom_type) { case Geometry_Type.slab: geom = new Slab((double)data["zmin"], (double)data["zmax"]); break; case Geometry_Type.sheet: geom = new Sheet((double)data["zmin"]); break; case Geometry_Type.strip: geom = new Strip((double)data["zmin"], (double)data["zmax"], (double)data["dx"], (double)data["dy"], (double)data["width"], (double)data["theta"]); break; case Geometry_Type.half_slab: geom = new Half_Slab((double)data["zmin"], (double)data["zmax"], (double)data["dx"], (double)data["dy"], (double)data["theta"]); break; case Geometry_Type.half_strip: geom = new Half_Strip((double)data["zmin"], (double)data["zmax"], (double)data["dx"], (double)data["dy"], (double)data["width"], (double)data["theta"]); break; case Geometry_Type.triangle_slab: geom = new Triangle_Slab((double)data["zmin"], (double)data["zmax"], (double)data["x0"], (double)data["y0"], (double)data["theta1"], (double)data["theta2"]); break; default: throw new NotImplementedException("Error - Unknown geometry"); } // create layer ILayer result; switch (mat) { case Material.GaAs: result = new GaAs_Layer(geom, (int)data["layer_no"]); break; case Material.AlGaAs: result = new AlGaAs_Layer(geom, (int)data["layer_no"], (double)data["x"]); break; case Material.InGaAs: result = new InGaAs_Layer(geom, (int)data["layer_no"], (double)data["x"]); break; case Material.InAlAs: result = new InAlAs_Layer(geom, (int)data["layer_no"], (double)data["x"]); break; case Material.PMMA: result = new PMMA_Layer(geom, (int)data["layer_no"]); break; case Material.Al2O3: result = new Al2O3_Layer(geom, (int)data["layer_no"]); break; case Material.Metal: result = new Metal_Layer(geom, (int)data["layer_no"]); break; case Material.Air: result = new Air_Layer(geom, (int)data["layer_no"]); break; // substrate always comes from -infty case Material.Substrate: result = new Substrate_Layer(new Slab(-1.0 * double.MaxValue, (double)data["zmax"]), (int)data["layer_no"]); break; default: throw new NotImplementedException("Error - Unknown material"); } // if this is actually a composite layer, then rewrite result... (this is simpler than putting a "Composite" material for the switch above) if (data.ContainsKey("composite")) if ((bool)data["composite"]) result = Create_Composite_Layer(result, data, geom); // and set dopent levels if necessary if (data.ContainsKey("nd") || data.ContainsKey("na")) { if (!data.ContainsKey("nd")) data.Add("nd", 0.0); if (!data.ContainsKey("na")) data.Add("na", 0.0); // use a factor of 10^-21 to convert from cm^-3 to nm^-3 data["na"] = 1.0e-21 * (double)data["na"]; data["nd"] = 1.0e-21 * (double)data["nd"]; result.Set_Dopents((double)data["na"], (double)data["nd"]); } return result; }