Beispiel #1
0
        private void btn_close_Click(object sender, EventArgs e)
        {
            Joints_Array = null;
            Long_Girder_Members_Array  = null;
            Cross_Girder_Members_Array = null;
            MemColls.Clear();
            MemColls = null;

            this.Close();
        }
Beispiel #2
0
        //Chiranjit [2011 07 09]
        //Create Bridge Input Data by user's given values.
        //Long Girder Spacing, Cross Girder Spacing, Cantilever Width
        public void CreateData()
        {
            //double x_incr = (Length / (Total_Columns - 1));
            //double z_incr = (WidthBridge / (Total_Rows - 1));

            double x_incr = Spacing_Cross_Girder;
            double z_incr = Spacing_Long_Girder;

            JointNode nd;
            //Joints_Array = new JointNode[Total_Rows, Total_Columns];
            //Long_Girder_Members_Array = new Member[Total_Rows, Total_Columns - 1];
            //Cross_Girder_Members_Array = new Member[Total_Rows - 1, Total_Columns];


            int iCols = 0;
            int iRows = 0;

            Joints.Clear();

            double skew_length = Math.Tan((Skew_Angle * (Math.PI / 180.0)));

            double val1 = 12.1;
            double val2 = val1 * skew_length;



            double last_x = 0.0;
            double last_z = 0.0;

            List <double> list_x  = new List <double>();
            List <double> list_z  = new List <double>();
            Hashtable     z_table = new Hashtable();

            //Store Joint Coordinates
            double L_2, L_4, eff_d;
            double x_max, x_min;

            //int _Columns, _Rows;

            //_Columns = Total_Columns;
            //_Rows = Total_Rows;

            last_x = 0.0;
            //Creating X Coordinates at every Z level

            list_x.Clear();
            list_x.Add(0.0);
            list_x.Add(Effective_Depth);
            list_x.Add(Length - Effective_Depth);
            list_x.Add(Length / 4.0);
            list_x.Add(Length / 2.0);
            list_x.Add(Length);
            last_x = x_incr;
            do
            {
                if (!list_x.Contains(last_x) && last_x > Effective_Depth && last_x < (Length - Effective_Depth))
                {
                    list_x.Add(last_x);
                }
                last_x += x_incr;
            }while (last_x <= Length);

            list_x.Sort();

            list_z.Clear();
            list_z.Add(0);
            list_z.Add(WidthCantilever);
            list_z.Add(WidthCantilever / 2);
            list_z.Add(WidthBridge - WidthCantilever);
            list_z.Add(WidthBridge - WidthCantilever / 2);
            list_z.Add(WidthBridge);
            last_z = WidthCantilever + z_incr;
            do
            {
                if (!list_z.Contains(last_z) && last_z > WidthCantilever && last_z < (WidthBridge - WidthCantilever - 0.2))
                {
                    list_z.Add(last_z);
                }
                last_z += z_incr;
            } while (last_z <= WidthBridge);
            list_z.Sort();



            _Columns = list_x.Count;
            _Rows    = list_z.Count;

            int i = 0;

            List <double> list = new List <double>();

            for (iRows = 0; iRows < _Rows; iRows++)
            {
                list = new List <double>();
                for (iCols = 0; iCols < _Columns; iCols++)
                {
                    list.Add(list_x[iCols] + list_z[iRows] * skew_length);
                }
                z_table.Add(list_z[iRows], list);
            }



            //Chiranjit [2011 07 11]
            //Calculate L/2, L/4, Deff for Skew Angle
            //for(i = 0; i < list_z.Count; i++)
            //{
            //    list_x = z_table[list_z[i]] as List<double>;
            //    if (list_x != null)
            //    {
            //        list_x.Sort();

            //        //x_max = list_x[list_x.Count - 1] + (skew_length * list_z[i]);
            //        //x_min = list_x[0] + (skew_length * list_z[i]);
            //        x_max = list_x[list_x.Count - 1];
            //        x_min = list_x[0];
            //        if (i == 0)
            //        {
            //            span_length = (x_max - x_min);
            //            //Length = span_length;
            //        }

            //        L_2 = (x_max + x_min) / 2.0;
            //        L_4 = (L_2 + x_min) / 2.0;
            //        eff_d = (Effective_Depth + x_min);

            //        if (list_x.Contains(eff_d) == false)
            //            list_x.Add(eff_d);
            //        if (list_x.Contains(L_2) == false)
            //            list_x.Add(L_2);
            //        if (list_x.Contains(L_4) == false)
            //            list_x.Add(L_4);

            //        L_2 = (x_max + x_min) / 2.0;
            //        L_4 = x_max - L_4;
            //        eff_d = x_max - eff_d;
            //        if (list_x.Contains(eff_d) == false)
            //            list_x.Add(eff_d);
            //        if (list_x.Contains(L_2) == false)
            //            list_x.Add(L_2);
            //        if (list_x.Contains(L_4) == false)
            //            list_x.Add(L_4);


            //        list_x.Sort();

            //        //_Columns = list_x.Count;
            //        //_Rows = list_z.Count;

            //        z_table[list_z[i]] = list_x;
            //    }
            //}

            Joints_Array = new JointNode[_Rows, _Columns];
            Long_Girder_Members_Array  = new Member[_Rows, _Columns - 1];
            Cross_Girder_Members_Array = new Member[_Rows - 1, _Columns];



            for (iRows = 0; iRows < _Rows; iRows++)
            {
                list_x = z_table[list_z[iRows]] as List <double>;
                for (iCols = 0; iCols < _Columns; iCols++)
                {
                    nd   = new JointNode();
                    nd.Y = 0;
                    nd.Z = list_z[iRows];

                    //nd.X = list_x[iCols] + (skew_length * list_z[iRows]);
                    nd.X = list_x[iCols];

                    nd.NodeNo = Joints.JointNodes.Count + 1;
                    Joints.Add(nd);

                    Joints_Array[iRows, iCols] = nd;

                    last_x = nd.X;
                }
            }
            int nodeNo = 0;

            Joints.Clear();

            for (iCols = 0; iCols < _Columns; iCols++)
            {
                for (iRows = 0; iRows < _Rows; iRows++)
                {
                    nodeNo++;
                    Joints_Array[iRows, iCols].NodeNo = nodeNo;
                    Joints.Add(Joints_Array[iRows, iCols]);
                }
            }


            Member mem = new Member();

            MemColls.Clear();
            for (iCols = 0; iCols < _Columns; iCols++)
            {
                for (iRows = 1; iRows < _Rows; iRows++)
                {
                    mem           = new Member();
                    mem.StartNode = Joints_Array[iRows - 1, iCols];
                    mem.EndNode   = Joints_Array[iRows, iCols];
                    mem.MemberNo  = MemColls.Count + 1;
                    MemColls.Add(mem);
                    Cross_Girder_Members_Array[iRows - 1, iCols] = mem;
                }
            }
            for (iRows = 0; iRows < _Rows; iRows++)
            {
                for (iCols = 1; iCols < _Columns; iCols++)
                {
                    mem           = new Member();
                    mem.StartNode = Joints_Array[iRows, iCols - 1];
                    mem.EndNode   = Joints_Array[iRows, iCols];
                    mem.MemberNo  = MemColls.Count + 1;
                    MemColls.Add(mem);
                    Long_Girder_Members_Array[iRows, iCols - 1] = mem;
                }
            }
        }