コード例 #1
0
ファイル: CGenex.cs プロジェクト: 777ondro/sw-en
        public void GenerateMesh1D(CModel TopoModel)
        {
            // Generate FEM nodes
            // Nodes
            for (int i = 0; i < TopoModel.m_arrNodes.Length; i++)
            {
                // Create FEM node
                CFemNode TempNode = new CFemNode(TopoModel.m_arrNodes[i]);
                m_arrFemNodes[i] = TempNode;

                // Set FEM node DOF

                // Get nodal support
                // Search if node is in list of supported nodes for each nodal support
                for (int i2 = 0; i2 < TopoModel.m_arrNSupports.Length; i2++) // Check all nodal supports
                {
                    for (int j = 0; j < TopoModel.m_arrNSupports[i2].m_iNodeCollection.Length; j++) // Check list of nodes (Nodes IDs collection)
                    {
                        if (m_arrFemNodes[i].ID == TopoModel.m_arrNSupports[i2].m_iNodeCollection[j])
                        {
                            // DOF of nodes are free - zero rigidity of restraints  false as default
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e2D_DOF.eUX] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e2D_DOF.eUX]; // !!! 2D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e2D_DOF.eUY] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e2D_DOF.eUY]; // !!! 2D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e2D_DOF.eRZ] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e2D_DOF.eRZ]; // !!! 2D Environment enum
                        }
                    }
                }
            }

            // Generate FEM members
            // Members
            for (int i = 0; i < TopoModel.m_arrMembers.Length; i++)
            {
                CE_1D TempMember = new CE_1D(TopoModel.m_arrMembers[i], m_arrFemNodes);
                m_arrFemMembers[i] = TempMember;

                // Set FEM Member DOF
                if (TopoModel.m_arrNReleases != null) // Some releases exist
                {
                    for (int j = 0; j < TopoModel.m_arrNReleases.Length; j++) // Check each release
                    {
                        for (int k = 0; k < TopoModel.m_arrNReleases[j].m_iMembCollection.Length; k++) //  Check each member in collection
                        {
                            if (TopoModel.m_arrNReleases[j].m_iMembCollection[k] == m_arrFemMembers[i].ID) // if release exists on member
                            {
                                if (TopoModel.m_arrMembers[i].CnRelease1 != null)
                                    m_arrFemMembers[i].CnRelease1 = TopoModel.m_arrMembers[i].CnRelease1;
                                if (TopoModel.m_arrMembers[i].CnRelease2 != null)
                                    m_arrFemMembers[i].CnRelease2 = TopoModel.m_arrMembers[i].CnRelease2;
                            }
                        }
                    }
                }
            }

            ////////////////////////////////////////////////////////////////////////////////////////////////
            // Additional data of nodes depending on generated members

            for (int i = 0; i < m_arrFemNodes.Length; i++)
            {
                m_arrFemNodes[i].m_iMemberCollection = new System.Collections.ArrayList(); // Allocate collection memory

                for (int j = 0; j < m_arrFemMembers.Length; j++)
                {
                    if (m_arrFemNodes[i].ID == m_arrFemMembers[j].NodeStart.ID || m_arrFemNodes[i].ID == m_arrFemMembers[j].NodeEnd.ID) // Is node ID same as member start or end node ID
                    {
                        m_arrFemNodes[i].m_iMemberCollection.Add(m_arrFemMembers[j].ID); // Add FEMmember ID to the FEM node list
                    }
                }
            }

            //  If only two members are connected in one node and if release exists at that node, copy this release from one member to the another
            for (int i = 0; i < m_arrFemNodes.Length; i++)
            {
                if (m_arrFemNodes[i].m_iMemberCollection != null && m_arrFemNodes[i].m_iMemberCollection.Count == 2) // Node is connected to two members
                {
                    // We know member ID, so we can get index of members in list
                    int iMember1_index = -1;
                    int iMember2_index = -1;

                    for (int j = 0; j < m_arrFemMembers.Length; j++)
                    {
                        // 1st member index
                        if (iMember1_index < 0 && m_arrFemNodes[i].m_iMemberCollection.Contains(m_arrFemMembers[j].ID)) // if Member ID is in the list
                        {
                            iMember1_index = j; // Set 1st
                        }

                        if(iMember1_index > -1) // Index was defined, we can break cycle
                          break;
                    }

                    // 2nd member index
                    for (int k = iMember1_index + 1; k < m_arrFemMembers.Length; k++) // Search for second only in interval between first founded member and last member
                    {
                        if (iMember2_index < 0 && m_arrFemNodes[i].m_iMemberCollection.Contains(m_arrFemMembers[k].ID)) // if Member ID is in the list interval
                        {
                            iMember2_index = k;
                        }

                        if (iMember2_index > -1) // Index was defined, we can break cycle
                            break;
                    }

                   // If relases exist, they are neccesary to define DOF of both members, therefore copy release of one member to the another one
                   if(m_arrFemNodes[i].ID == m_arrFemMembers[iMember1_index].NodeStart.ID && m_arrFemMembers[iMember1_index].CnRelease1 != null)
                   {
                       if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember2_index].NodeStart.ID && m_arrFemMembers[iMember2_index].CnRelease1 == null)
                             m_arrFemMembers[iMember2_index].CnRelease1.m_bRestrain = m_arrFemMembers[iMember1_index].CnRelease1.m_bRestrain;
                          else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember2_index].NodeEnd.ID && m_arrFemMembers[iMember2_index].CnRelease2 == null)
                             m_arrFemMembers[iMember2_index].CnRelease2.m_bRestrain = m_arrFemMembers[iMember1_index].CnRelease1.m_bRestrain;
                   }
                   else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember1_index].NodeEnd.ID && m_arrFemMembers[iMember1_index].CnRelease2 != null)
                   {
                       if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember2_index].NodeStart.ID && m_arrFemMembers[iMember2_index].CnRelease1 == null)
                           m_arrFemMembers[iMember2_index].CnRelease1.m_bRestrain = m_arrFemMembers[iMember1_index].CnRelease2.m_bRestrain;
                       else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember2_index].NodeEnd.ID && m_arrFemMembers[iMember2_index].CnRelease2 == null)
                           m_arrFemMembers[iMember2_index].CnRelease2.m_bRestrain = m_arrFemMembers[iMember1_index].CnRelease2.m_bRestrain;
                   }
                   else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember2_index].NodeStart.ID && m_arrFemMembers[iMember2_index].CnRelease1 != null)
                   {
                       if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember1_index].NodeStart.ID && m_arrFemMembers[iMember1_index].CnRelease1 == null)
                           m_arrFemMembers[iMember1_index].CnRelease1.m_bRestrain = m_arrFemMembers[iMember2_index].CnRelease1.m_bRestrain;
                       else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember1_index].NodeEnd.ID && m_arrFemMembers[iMember1_index].CnRelease2 == null)
                           m_arrFemMembers[iMember1_index].CnRelease2.m_bRestrain = m_arrFemMembers[iMember2_index].CnRelease1.m_bRestrain;
                   }
                   else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember2_index].NodeEnd.ID && m_arrFemMembers[iMember2_index].CnRelease2 != null)
                   {
                       if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember1_index].NodeStart.ID && m_arrFemMembers[iMember1_index].CnRelease1 == null)
                           m_arrFemMembers[iMember1_index].CnRelease1.m_bRestrain = m_arrFemMembers[iMember2_index].CnRelease2.m_bRestrain;
                       else if (m_arrFemNodes[i].ID == m_arrFemMembers[iMember1_index].NodeEnd.ID && m_arrFemMembers[iMember1_index].CnRelease2 == null)
                           m_arrFemMembers[iMember1_index].CnRelease2.m_bRestrain = m_arrFemMembers[iMember2_index].CnRelease2.m_bRestrain;
                   }
                }
            }

            // Additional data of members
            // Fill Members stifeness matrices
            for (int i = 0; i < m_arrFemMembers.Length; i++)
            {
                m_arrFemMembers[i].FillBasic3_StiffMatrices();
            }

            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // External Loads
            // Fill vectors

            // Nodal loads
            // Fill vector of external load for each node in list
            // Node could be included in all lists only once, more than one nodal load in one node is not allowed
            if (TopoModel.m_arrNLoads != null)
            {
                for (int i = 0; i < TopoModel.m_arrNLoads.Length; i++) // Each load
                {
                    if (TopoModel.m_arrNLoads[i].INodeCollection != null) // Check if some nodes are in list
                    {
                        for (int j = 0; j < TopoModel.m_arrNLoads[i].INodeCollection.Length; j++) // Each node in collection
                        {
                            // Set load vector values
                            for (int k = 0; k < m_arrFemNodes.Length; k++) // Neefektivne prechadzat zbytocne vsetky uzly kedze pozname konkretne ID zatazenych
                            {
                                if (TopoModel.m_arrNLoads[i].INodeCollection.Contains(TopoModel.m_arrNodes[k].ID)) // If node ID is same as collection item
                                {
                                    // Check object class
                                    if (TopoModel.m_arrNLoads[i] is BaseClasses.CNLoadAll)
                                    {
                                        CNLoadAll oTemp = new CNLoadAll(); // Create new object of necessary type

                                        oTemp = (CNLoadAll)(TopoModel.m_arrNLoads[i]); // Change object type

                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eFX] = oTemp.Value_FX;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eFY] = oTemp.Value_FY;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eMZ] = oTemp.Value_MZ;

                                        /*
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eFX] = TopoModel.m_arrNLoads[i].Value_FX;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eFY] = TopoModel.m_arrNLoads[i].Value_FY;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eMZ] = TopoModel.m_arrNLoads[i].Value_MZ;
                                        */
                                    }
                                    else
                                    {
                                        CNLoadSingle oTemp = new CNLoadSingle(); // Create new object of necessary type

                                        oTemp = (CNLoadSingle)(TopoModel.m_arrNLoads[i]); // Change object type

                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eFX] = oTemp.NLoadType == ENLoadType.eNLT_Fx ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eFY] = oTemp.NLoadType == ENLoadType.eNLT_Fy ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e2D_E_F.eMZ] = oTemp.NLoadType == ENLoadType.eNLT_Mz ? oTemp.Value : 0.0f;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            // Member loads

            // Set primary end forces only due to member loads in local coordinate system LCS
            // Summation of loads applied on one member
            // There can by more loads on one member, member could be in various loads lists (but only once in one list)

            if (TopoModel.m_arrMLoads != null)
            {
                for (int i = 0; i < TopoModel.m_arrMLoads.Length; i++) // Each load
                {
                    if (TopoModel.m_arrMLoads[i].IMemberCollection != null) // Check if some members are in list
                    {
                        for (int j = 0; j < TopoModel.m_arrMLoads[i].IMemberCollection.Length; j++) // Each node in collection
                        {
                            // Set end forces due to member load
                            for (int k = 0; k < m_arrFemMembers.Length; k++) // Neefektivne prechadzat zbytocne vsetky pruty kedze pozname konkretne ID zatazenych
                            {
                                // Temporary value of end forces due to particular external force
                                float fTemp_A_UXRX = 0f, fTemp_B_UXRX = 0f; // Auxialiary variables for values of end internal forces due to particular loads in load case, value of torsional moments about x-axis reactions are just auxialiary // never used to fill item of vectors in 2D in-plane solution
                                float fTemp_A_UYRZ = 0f, fTemp_B_UYRZ = 0f, fTemp_Ma_UYRZ = 0f, fTemp_Mb_UYRZ = 0f; // Auxialiary variables for values of end internal forces due to particular loads in load case

                                // Fill end forces due to external forces vectors for member particular load index i and member index k
                                // Depends on load dirrection and member support type
                                CMLoadPart objAux = new CMLoadPart(TopoModel, m_arrFemMembers, i, k,
                                    out fTemp_A_UXRX, out fTemp_A_UYRZ, out fTemp_Ma_UYRZ,
                                    out fTemp_B_UXRX, out fTemp_B_UYRZ, out fTemp_Mb_UYRZ
                                );

                                // Add values of temperary end forces due to particular load to the end forces items of vector
                                // Primary end forces due member loading in local coordinate system LCS

                                // Start Node
                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e2D_E_F.eFX] += fTemp_A_UXRX;
                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e2D_E_F.eFY] += fTemp_A_UYRZ; // !!! Signs - nutne skontrolovat znamienka podla smeru lokalnzch osi a orientacie zatazenia
                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e2D_E_F.eMZ] += fTemp_Ma_UYRZ;

                                // End Node
                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e2D_E_F.eFX] += fTemp_B_UXRX;
                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e2D_E_F.eFY] += fTemp_B_UYRZ; //-fTemp_B_UYRZ;  // Zmena znamienka pre silu Vb na konci pruta, znamienko je opacne nez u reakcie, toto su vsak reakcie
                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e2D_E_F.eMZ] += fTemp_Mb_UYRZ;

                            }
                        }
                    }
                }
            }

            // Set primary end forces only due to member loads in global coordinate system GCS

            foreach (CE_1D Elem in m_arrFemMembers)
            {
                Elem.SetGetPEF_GCS();
            }
        }
コード例 #2
0
ファイル: CFemNode.cs プロジェクト: 777ondro/sw-en
        // Array of int values - returns members indexes not IDs
        public ArrayList GetFoundedMembers_Index(CFemNode Node, CE_1D[] ElemArray)
        {
            ArrayList IndexList = new ArrayList();

            for (int i = 0; i <  ElemArray.Length; i++) // Check for each member in array
            {
                if ((ElemArray[i].NodeStart == Node) || (ElemArray[i].NodeEnd == Node))
                {
                    IndexList.Add(i); // Add Element to Element Index Array
                }
            }

            return IndexList;
        }
コード例 #3
0
ファイル: CMLoadPart.cs プロジェクト: 777ondro/sw-en
        //----------------------------------------------------------------------------
        //----------------------------------------------------------------------------
        //----------------------------------------------------------------------------
        public CMLoadPart(CModel TopoModel,
            CE_1D[] arrFemMembers,
            int iMLoadIndex,
            int kMemberIndex,
            out float fTemp_A_UXRX,
            out float fTemp_A_UYRZ,
            out float fTemp_Ma_UYRZ,
            out float fTemp_B_UXRX,
            out float fTemp_B_UYRZ,
            out float fTemp_Mb_UYRZ)
        {
            // Default
            fTemp_A_UXRX = 0.0f;
            fTemp_B_UXRX = 0.0f;
            fTemp_A_UYRZ = 0.0f;
            fTemp_B_UYRZ = 0.0f;
            fTemp_Ma_UYRZ = 0.0f;
            fTemp_Mb_UYRZ = 0.0f;

            if (TopoModel.m_arrMLoads[iMLoadIndex].IMemberCollection.Contains(TopoModel.m_arrMembers[kMemberIndex].ID)) // If member ID is same as collection item
            {

                float fTemp_Ma_UXRX = 0.0f, fTemp_Mb_UXRX = 0.0f; // Temporary for output of Mx which is not used in 2D in-plane solution

                // Fill external forces temp values

                switch (TopoModel.m_arrMLoads[iMLoadIndex].EDirPPC) // Load direction in principal coordinate system XX / YU / ZV
                {

                    // 0 - Displacement in x-axis and rotation about x-axis in PCS
                    // 1 - Displacement in y-axis and rotation about z-axis in PCS
                    // 2 - Displacement in z-axis and rotation about y-axis in PCS - not used

                    case EMLoadDirPCC1.eMLD_PCC_FXX_MXX: // Axial force or torsional moment
                        {
                            // DOF RX can't be released - always rigid
                            switch (arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX])
                            {
                                // Type of supports is already defined  but I check it once more in body of function !!!

                                // XX - direction both sides supported displacement
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_00_00:
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_00_0_:
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_0__00:
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_0__0_:
                                    {
                                        // Type ObjLoadType = typeof(TopoModel.m_arrMLoads[i]);
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Axial Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_AXIAL_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_AXIAL_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_A_UXRX,
                                                        out fTemp_B_UXRX);
                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Torsional Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_TORS objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TORS(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_Ma_UXRX,
                                                        out fTemp_Mb_UXRX);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                // XX - direction start supported, end free displacement
                                //case FEM_CALC_BASE.Enums.EElemSuppType.eEl_00__0:
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_00___:
                                    //case FEM_CALC_BASE.Enums.EElemSuppType.eEl_0____:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Axial Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_AXIAL_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_AXIAL_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_A_UXRX,
                                                        out fTemp_B_UXRX);
                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Torsional Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_TORS objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TORS(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_Ma_UXRX,
                                                        out fTemp_Mb_UXRX);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                // XX - direction start free displacement, end supported
                                //case FEM_CALC_BASE.Enums.EElemSuppType.eEl__0_00:
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl____00:
                                    //case FEM_CALC_BASE.Enums.EElemSuppType.eEl____0_:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Axial Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_AXIAL_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_AXIAL_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_A_UXRX,
                                                        out fTemp_B_UXRX);
                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Torsional Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_TORS objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TORS(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_Ma_UXRX,
                                                        out fTemp_Mb_UXRX);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                // XX - direction start free displacement, end free displacement
                                //case FEM_CALC_BASE.Enums.EElemSuppType.eEl__0__0:
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl______:
                                default:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Axial Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_AXIAL_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_AXIAL_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_A_UXRX,
                                                        out fTemp_B_UXRX);
                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Torsional Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_TORS objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TORS(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUXRX],
                                                        out fTemp_Ma_UXRX,
                                                        out fTemp_Mb_UXRX);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                            }
                            break;
                        }
                    case EMLoadDirPCC1.eMLD_PCC_FYU_MZV: // Transversal load
                        {
                            switch (arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ])
                            {
                                // Type of supports is already defined  but I check it once more in body of function !!!

                                // UZRY - direction both sides supported displacement
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_00_00:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_00_0_:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_0__00:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_0__0_:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                // UZRY - direction start supported, end free displacement
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl_00___:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                // UZRY - direction start free displacement, end supported
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl____00:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                                // UZRY - direction start free displacement, end free displacement
                                case FEM_CALC_BASE.Enums.EElemSuppType2D.eEl______:
                                default:
                                    {
                                        switch (TopoModel.m_arrMLoads[iMLoadIndex].MLoadType)
                                        {
                                            case BaseClasses.EMLoadType.eMLT_F:  // Transverse Force
                                                {
                                                    FEM_CALC_BASE.CMLoadPart_TRANS_F objMLoadPart = new FEM_CALC_BASE.CMLoadPart_TRANS_F(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);

                                                    break;
                                                }
                                            case BaseClasses.EMLoadType.eMLT_M: // Bending Moment
                                                {

                                                    FEM_CALC_BASE.CMLoadPart_BEND objMLoadPart = new FEM_CALC_BASE.CMLoadPart_BEND(TopoModel.m_arrMLoads[iMLoadIndex],
                                                        (CE_1D_BASE)arrFemMembers[kMemberIndex],
                                                        arrFemMembers[kMemberIndex].m_eSuppType[(int)EM_PCS_DIR1.eUYRZ],
                                                        out fTemp_A_UYRZ,
                                                        out fTemp_B_UYRZ,
                                                        out fTemp_Ma_UYRZ,
                                                        out fTemp_Mb_UYRZ);
                                                    break;
                                                }
                                            default:
                                                {

                                                    break;
                                                }
                                        }

                                        break;
                                    }
                            }
                            break;
                        }
                    case EMLoadDirPCC1.eMLD_PCC_FZV_MYU: // Transversal load
                    {
                       // DOF UZ and RY can't be released - always rigid for 2D in-plane solution x- axial load, y - transverse load, - z bending moment about axis
                        break;
                    }
                    default: // Exception
                        {
                            fTemp_A_UXRX = float.MaxValue;
                            fTemp_B_UXRX = float.MaxValue;
                            fTemp_A_UYRZ = float.MaxValue;
                            fTemp_B_UYRZ = float.MaxValue;
                            fTemp_Ma_UYRZ = float.MaxValue;
                            fTemp_Mb_UYRZ = float.MaxValue;
                            break;
                        }
                }
            }
            //else
            //{
            //    // Default
            //    fTemp_A_UXRX = 0.0f;
            //    fTemp_B_UXRX = 0.0f;
            //    fTemp_A_UYRZ = 0.0f;
            //    fTemp_B_UYRZ = 0.0f;
            //    fTemp_Ma_UYRZ = 0.0f;
            //    fTemp_Mb_UYRZ = 0.0f;
            //}
        }
コード例 #4
0
ファイル: CFemNode.cs プロジェクト: 777ondro/sw-en
        // Function returns list of FEM 1D elements which includes given node
        // Do we need to store whole elements object (array of elements indexes should be enough) !!!
        public ArrayList GetFoundedMembers(CFemNode Node, CE_1D[] ElemArray, int iElemNo)
        {
            int j = 0;
            ArrayList ElemTempList = new ArrayList();

            for (int i = 0; i < iElemNo; i++)
            {
                if ((ElemArray[i].NodeStart == Node) || (ElemArray[i].NodeEnd == Node))
                {
                    ElemTempList.Add(i); // Add Element to Element List
                    j++;
                }
            }

            return ElemTempList;
        }