Ejemplo n.º 1
0
        public double GetK1OverHToLh(WindExposureCategory windExposureCategory, TopographyType TopographyType, double HToLh)
        {

            #region Read Table

            var SampleValue = new { ExposureCategory = "", TopographyType = "", K1OverHToLh = "" }; // sample
            var K1OverHToLhList = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_8_1K1OverHToLh))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        string thisTopographyType = (string)Vals[0];
                        string thisExposureCategory = (string)Vals[1];
                        string thisK1OverHToLh = (string)Vals[2];

                        K1OverHToLhList.Add(new
                        {
                            ExposureCategory = thisExposureCategory,
                            TopographyType = thisTopographyType,
                            K1OverHToLh = thisK1OverHToLh
                        });
                    }
                }

            }

            #endregion

            var tableValues = from K1OverHToLhEntry in K1OverHToLhList
                              where (K1OverHToLhEntry.ExposureCategory == windExposureCategory.ToString()
                                  && K1OverHToLhEntry.TopographyType == TopographyType.ToString())
                              select K1OverHToLhEntry;
            var result = (tableValues.ToList()).FirstOrDefault().K1OverHToLh;

            double K1OverHToLh = 0.0;
            if (result != null)
            {
                K1OverHToLh = Double.Parse(result, CultureInfo.InvariantCulture);
            }
            else
            {
                throw new ParameterNotFoundInTableException("K1OverHToLh");
            }
            return K1OverHToLh;
        }
Ejemplo n.º 2
0
        //µ: Horizontal attenuation factor. 
        public double GetMu(TopographyType TopographyType, TopographicLocation TopographicLocation)
        {

            #region Read Table

            var SampleValue = new { TopographyType = "", TopographicLocation = "", Mu = "" }; // sample
            var MuList = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_8_1Mu))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        string thisTopographyType = (string)Vals[0];
                        string thisTopographicLocation = (string)Vals[1];
                        string thisMu = (string)Vals[2];

                        MuList.Add(new
                        {
                            TopographyType = thisTopographyType,
                            TopographicLocation = thisTopographicLocation,
                            Mu = thisMu
                        });
                    }
                }

            }

            #endregion

            var tableValues = from muEntry in MuList where (muEntry.TopographyType == TopographyType.ToString() 
                                  && muEntry.TopographicLocation == TopographicLocation.ToString()) select muEntry;
            var result = (tableValues.ToList()).FirstOrDefault().Mu;
            
            double mu =0.0;
            if (result!=null)
            {
                mu = Double.Parse(result, CultureInfo.InvariantCulture);
            }
            else
            {
                throw new ParameterNotFoundInTableException("Mu");
            }

            return mu;
        }
Ejemplo n.º 3
0
        public double Getgamma(TopographyType TopographyType)
        {

            #region Read Table

            var SampleValue = new { TopographyType = "", gamma = "" }; // sample
            var gammaList = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_8_1Gamma))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 2)
                    {
                        string thisTopographyType = (string)Vals[0];
                        string thisgamma = (string)Vals[1];

                        gammaList.Add(new
                        {
                            TopographyType = thisTopographyType,
                            gamma = thisgamma
                        });
                    }
                }

            }

            #endregion

            var tableValues = from gammaEntry in gammaList
                              where (gammaEntry.TopographyType == TopographyType.ToString())
                              select gammaEntry;
            var result = (tableValues.ToList()).FirstOrDefault().gamma;

            double gamma = 0.0;
            if (result != null)
            {
                gamma = Double.Parse(result, CultureInfo.InvariantCulture);
            }
            else
            {
                throw new ParameterNotFoundInTableException("gamma");
            }

            return gamma;
        }
Ejemplo n.º 4
0
        public double GetK1OverHToLh(WindExposureCategory windExposureCategory, TopographyType TopographyType, double HToLh)
        {
            #region Read Table

            var SampleValue     = new { ExposureCategory = "", TopographyType = "", K1OverHToLh = "" }; // sample
            var K1OverHToLhList = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_8_1K1OverHToLh))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        string thisTopographyType   = (string)Vals[0];
                        string thisExposureCategory = (string)Vals[1];
                        string thisK1OverHToLh      = (string)Vals[2];

                        K1OverHToLhList.Add(new
                        {
                            ExposureCategory = thisExposureCategory,
                            TopographyType   = thisTopographyType,
                            K1OverHToLh      = thisK1OverHToLh
                        });
                    }
                }
            }

            #endregion

            var tableValues = from K1OverHToLhEntry in K1OverHToLhList
                              where (K1OverHToLhEntry.ExposureCategory == windExposureCategory.ToString() &&
                                     K1OverHToLhEntry.TopographyType == TopographyType.ToString())
                              select K1OverHToLhEntry;
            var result = (tableValues.ToList()).FirstOrDefault().K1OverHToLh;

            double K1OverHToLh = 0.0;
            if (result != null)
            {
                K1OverHToLh = Double.Parse(result, CultureInfo.InvariantCulture);
            }
            else
            {
                throw new ParameterNotFoundInTableException("K1OverHToLh");
            }
            return(K1OverHToLh);
        }
Ejemplo n.º 5
0
        public double Getgamma(TopographyType TopographyType)
        {
            #region Read Table

            var SampleValue = new { TopographyType = "", gamma = "" }; // sample
            var gammaList   = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_8_1Gamma))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 2)
                    {
                        string thisTopographyType = (string)Vals[0];
                        string thisgamma          = (string)Vals[1];

                        gammaList.Add(new
                        {
                            TopographyType = thisTopographyType,
                            gamma          = thisgamma
                        });
                    }
                }
            }

            #endregion

            var tableValues = from gammaEntry in gammaList
                              where (gammaEntry.TopographyType == TopographyType.ToString())
                              select gammaEntry;
            var result = (tableValues.ToList()).FirstOrDefault().gamma;

            double gamma = 0.0;
            if (result != null)
            {
                gamma = Double.Parse(result, CultureInfo.InvariantCulture);
            }
            else
            {
                throw new ParameterNotFoundInTableException("gamma");
            }

            return(gamma);
        }
Ejemplo n.º 6
0
        //µ: Horizontal attenuation factor.
        public double GetMu(TopographyType TopographyType, TopographicLocation TopographicLocation)
        {
            #region Read Table

            var SampleValue = new { TopographyType = "", TopographicLocation = "", Mu = "" }; // sample
            var MuList      = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.ASCE7_10F26_8_1Mu))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Count() == 3)
                    {
                        string thisTopographyType      = (string)Vals[0];
                        string thisTopographicLocation = (string)Vals[1];
                        string thisMu = (string)Vals[2];

                        MuList.Add(new
                        {
                            TopographyType      = thisTopographyType,
                            TopographicLocation = thisTopographicLocation,
                            Mu = thisMu
                        });
                    }
                }
            }

            #endregion

            var tableValues = from muEntry in MuList where (muEntry.TopographyType == TopographyType.ToString() &&
                                                            muEntry.TopographicLocation == TopographicLocation.ToString()) select muEntry;
            var result = (tableValues.ToList()).FirstOrDefault().Mu;

            double mu = 0.0;
            if (result != null)
            {
                mu = Double.Parse(result, CultureInfo.InvariantCulture);
            }
            else
            {
                throw new ParameterNotFoundInTableException("Mu");
            }

            return(mu);
        }