Exemplo n.º 1
0
        public Material DeepClone(DopingType dopingType)
        {
            var semiconductor = new Semiconductor
            {
                DielectricConstant            = DielectricConstant,
                BandGap                       = BandGap.DeepClone(),
                ElectronAffinity              = ElectronAffinity,
                DopingType                    = dopingType,
                DopantConcentration           = DopantConcentration.DeepClone(),
                IntrinsicCarrierConcentration = IntrinsicCarrierConcentration.DeepClone(),
                Temperature                   = Temperature
            };

            InitClone(semiconductor, Length.FromMicrometers(50));
            semiconductor.Prepare();

            return(semiconductor);
        }
Exemplo n.º 2
0
        private static List <MaterialParameterViewModel> GetSemiconductorParameterSection(Semiconductor material)
        {
            var semiconductorSection = new List <MaterialParameterViewModel>();
            var bgField = new MaterialParameterViewModel <string>(ParameterType.SemiconductorBandGap)
            {
                Value = material.BandGap?.Expression
            };

            bgField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.BandGap = new MathExpression <Energy>(bgField.Value);
            };

            semiconductorSection.Add(bgField);

            var eaField = new NumericMaterialParameterViewModel(ParameterType.ElectronAffinity)
            {
                Minimum  = 0,
                Maximum  = 5,
                StepSize = 0.05,
                Value    = material.ElectronAffinity?.ElectronVolts ?? 0.0
            };

            eaField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.ElectronAffinity = Energy.FromElectronVolts(eaField.Value);
            };

            semiconductorSection.Add(eaField);

            var dcField = new NumericMaterialParameterViewModel(ParameterType.DielectricConstant)
            {
                Minimum  = 0,
                Maximum  = 30,
                StepSize = 1,
                Value    = material.DielectricConstant
            };

            dcField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DielectricConstant = dcField.Value;
            };

            semiconductorSection.Add(dcField);

            var iccField = new MaterialParameterViewModel <string>(ParameterType.IntrinsicCarrierConcentration)
            {
                Value = material.IntrinsicCarrierConcentration?.Expression
            };

            iccField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.IntrinsicCarrierConcentration = new MathExpression <Concentration>(iccField.Value);
            };

            semiconductorSection.Add(iccField);

            var dtField = new MaterialParameterViewModel <DopingType>(ParameterType.DopingType)
            {
                Value = material.DopingType
            };

            dtField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DopingType = dtField.Value;
            };

            semiconductorSection.Add(dtField);

            var dopCField = new MaterialParameterViewModel <string>(ParameterType.DopantConcentration)
            {
                Value = material.DopantConcentration?.Expression
            };

            dopCField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DopantConcentration = new MathExpression <Concentration>(dopCField.Value);
            };

            semiconductorSection.Add(dopCField);

            var tempField = new NumericMaterialParameterViewModel(ParameterType.Temperature)
            {
                Minimum  = 100.0,
                Maximum  = 500.0,
                StepSize = 25.0,
                Value    = material.Temperature?.Kelvin ?? 0.0
            };

            tempField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.Temperature = new Temperature(tempField.Value);
            };

            semiconductorSection.Add(tempField);

            return(semiconductorSection);
        }