Esempio n. 1
0
        public override void Initialise(Dictionary<string, object> input_dict)
        {
            // simulation domain inputs
            Get_From_Dictionary<double>(input_dict, "dz", ref dz_dens); dz_pot = dz_dens;
            Get_From_Dictionary(input_dict, "nz", ref nz_dens); nz_pot = nz_dens;

            // physics parameters are done by the base method
            base.Initialise(input_dict);
            Get_From_Dictionary<bool>(input_dict, "illuminated", ref illuminated, true);

            // check that the size of the domain [(nz_pot-1) * dz_pot] is not larger than the band structure
            if (layers[layers.Length - 1].Zmax - Geom_Tool.Get_Zmin(layers) < (Nz_Pot - 1) * Dz_Pot)
                throw new Exception("Error - the band structure provided is smaller than the simulation domain!\nUse nz = " + (int)Math.Ceiling((layers[layers.Length - 1].Zmax - Geom_Tool.Get_Zmin(layers)) / Dz_Pot) + " instead");
            // and check that the top of the domain is the surface (unless this check is overloaded)
            bool surface_override = false; Get_From_Dictionary<bool>(input_dict, "surface_check", ref surface_override, true);
            if (!surface_override && Geom_Tool.Find_Layer_Below_Surface(layers).Zmax - Geom_Tool.Get_Zmin(layers) - Nz_Pot * Dz_Pot != 0.0)
                throw new Exception("Error - the top of the domain is not the surface!\nUse the input \"surface_check\" to override");

            // calculate the top and bottom of the domain
            input_dict["zmin"] = Geom_Tool.Get_Zmin(layers);
            input_dict["zmax"] = Geom_Tool.Get_Zmin(layers) + dz_pot * nz_pot;

            // and split gate dimensions
            device_dimensions.Add("bottom_position", (double)input_dict["zmin"]);
            device_dimensions.Add("top_position", (double)input_dict["zmax"]);

            // check whether the bottom should be fixed
            if (input_dict.ContainsKey("bottom_V"))
                fix_bottom_V = true;

            // initialise the dictionary which contains the surface charges at each temperature
            surface_charge = new Dictionary<double, double>();

            // double check whether you want to use FlexPDE
            if (input_dict.ContainsKey("use_FlexPDE"))
                using_flexPDE = (bool)input_dict["use_FlexPDE"];

            // Initialise potential solver
            pois_solv = new OneD_PoissonSolver(this, using_flexPDE, input_dict);

            Initialise_DataClasses(input_dict);

            // if the input dictionary already has the dopent distribution, we don't need to recalculate it
            if (input_dict.ContainsKey("Dopent_Density"))
                dopents_calculated = true;

            // Get carrier type for DFT calculations (default is electron)
            if (input_dict.ContainsKey("carrier_type"))
                carrier_type = (Carrier)Enum.Parse(typeof(Carrier), (string)input_dict["carrier_type"]);

            Console.WriteLine("Experimental parameters initialised");
        }
Esempio n. 2
0
        public override void Initialise(Dictionary <string, object> input_dict)
        {
            // simulation domain inputs
            Get_From_Dictionary <double>(input_dict, "dz", ref dz_dens); dz_pot = dz_dens;
            Get_From_Dictionary(input_dict, "nz", ref nz_dens); nz_pot          = nz_dens;

            // physics parameters are done by the base method
            base.Initialise(input_dict);
            Get_From_Dictionary <bool>(input_dict, "illuminated", ref illuminated, true);

            // check that the size of the domain [(nz_pot-1) * dz_pot] is not larger than the band structure
            if (layers[layers.Length - 1].Zmax - Geom_Tool.Get_Zmin(layers) < (Nz_Pot - 1) * Dz_Pot)
            {
                throw new Exception("Error - the band structure provided is smaller than the simulation domain!\nUse nz = " + (int)Math.Ceiling((layers[layers.Length - 1].Zmax - Geom_Tool.Get_Zmin(layers)) / Dz_Pot) + " instead");
            }
            // and check that the top of the domain is the surface (unless this check is overloaded)
            bool surface_override = false; Get_From_Dictionary <bool>(input_dict, "surface_check", ref surface_override, true);

            if (!surface_override && Geom_Tool.Find_Layer_Below_Surface(layers).Zmax - Geom_Tool.Get_Zmin(layers) - Nz_Pot * Dz_Pot != 0.0)
            {
                throw new Exception("Error - the top of the domain is not the surface!\nUse the input \"surface_check\" to override");
            }

            // calculate the top and bottom of the domain
            input_dict["zmin"] = Geom_Tool.Get_Zmin(layers);
            input_dict["zmax"] = Geom_Tool.Get_Zmin(layers) + dz_pot * nz_pot;

            // and split gate dimensions
            device_dimensions.Add("bottom_position", (double)input_dict["zmin"]);
            device_dimensions.Add("top_position", (double)input_dict["zmax"]);

            // check whether the bottom should be fixed
            if (input_dict.ContainsKey("bottom_V"))
            {
                fix_bottom_V = true;
            }

            // initialise the dictionary which contains the surface charges at each temperature
            surface_charge = new Dictionary <double, double>();

            // double check whether you want to use FlexPDE
            if (input_dict.ContainsKey("use_FlexPDE"))
            {
                using_flexPDE = (bool)input_dict["use_FlexPDE"];
            }

            // Initialise potential solver
            pois_solv = new OneD_PoissonSolver(this, using_flexPDE, input_dict);

            Initialise_DataClasses(input_dict);

            // if the input dictionary already has the dopent distribution, we don't need to recalculate it
            if (input_dict.ContainsKey("Dopent_Density"))
            {
                dopents_calculated = true;
            }

            // Get carrier type for DFT calculations (default is electron)
            if (input_dict.ContainsKey("carrier_type"))
            {
                carrier_type = (Carrier)Enum.Parse(typeof(Carrier), (string)input_dict["carrier_type"]);
            }

            Console.WriteLine("Experimental parameters initialised");
        }