Ejemplo n.º 1
0
        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)e3D_DOF.eUX] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e3D_DOF.eUX]; // !!! 3D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e3D_DOF.eUY] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e3D_DOF.eUY]; // !!! 3D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e3D_DOF.eUZ] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e3D_DOF.eUZ]; // !!! 3D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e3D_DOF.eRX] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e3D_DOF.eRX]; // !!! 3D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e3D_DOF.eRY] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e3D_DOF.eRY]; // !!! 3D Environment enum
                            m_arrFemNodes[i].m_ArrNodeDOF[(int)e3D_DOF.eRZ] = TopoModel.m_arrNSupports[i2].m_bRestrain[(int)e3D_DOF.eRZ]; // !!! 3D 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
                    }
                }
            }

            // Releases !!!! - copied from 2D solution, check implementation in 3D !!!

            //  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 (!object.ReferenceEquals(null, TopoModel.m_arrNLoads))
            {
                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)e3D_E_F.eFX] = oTemp.Value_FX;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFY] = oTemp.Value_FY;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFZ] = oTemp.Value_FZ;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMX] = oTemp.Value_MX;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMY] = oTemp.Value_MY;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMZ] = oTemp.Value_MZ;

                                        /*
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFX] = TopoModel.m_arrNLoads[i].Value_FX;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFY] = TopoModel.m_arrNLoads[i].Value_FY;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFZ] = TopoModel.m_arrNLoads[i].Value_FZ;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMX] = TopoModel.m_arrNLoads[i].Value_MX;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMY] = TopoModel.m_arrNLoads[i].Value_MY;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_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)e3D_E_F.eFX] = oTemp.NLoadType == ENLoadType.eNLT_Fx ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFY] = oTemp.NLoadType == ENLoadType.eNLT_Fy ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eFZ] = oTemp.NLoadType == ENLoadType.eNLT_Fz ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMX] = oTemp.NLoadType == ENLoadType.eNLT_Mx ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_E_F.eMY] = oTemp.NLoadType == ENLoadType.eNLT_My ? oTemp.Value : 0.0f;
                                        m_arrFemNodes[k].m_VDirNodeLoad.FVectorItems[(int)e3D_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 (!object.ReferenceEquals(null, TopoModel.m_arrMLoads))
            {
                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, fTemp_Ma_UXRX = 0f, fTemp_Mb_UXRX = 0f;
                                float fTemp_A_UYRZ = 0f, fTemp_B_UYRZ = 0f, fTemp_Ma_UYRZ = 0f, fTemp_Mb_UYRZ = 0f;
                                float fTemp_A_UZRY = 0f, fTemp_B_UZRY = 0f, fTemp_Ma_UZRY = 0f, fTemp_Mb_UZRY = 0f;

                                // 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
                                // Use member PRINCIPAL coordinate system
                                CMLoadPart objAux = new CMLoadPart(TopoModel, m_arrFemMembers, i, k,
                                    out fTemp_A_UXRX, out fTemp_Ma_UXRX, out fTemp_A_UYRZ, out fTemp_Ma_UYRZ, out fTemp_A_UZRY, out fTemp_Ma_UZRY,
                                    out fTemp_B_UXRX, out fTemp_Mb_UXRX, out fTemp_B_UYRZ, out fTemp_Mb_UYRZ, out fTemp_B_UZRY, out fTemp_Mb_UZRY
                                );

                                // Add values of temporary 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)e3D_E_F.eFX] += fTemp_A_UXRX;
                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e3D_E_F.eMX] += fTemp_Ma_UXRX;

                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e3D_E_F.eFY] += fTemp_A_UYRZ; // !!! Signs - nutne skontrolovat znamienka podla smeru lokalnych osi a orientacie zatazenia
                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e3D_E_F.eMZ] += fTemp_Ma_UYRZ;

                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e3D_E_F.eFZ] += fTemp_A_UZRY; // !!! Signs - nutne skontrolovat znamienka podla smeru lokalnych osi a orientacie zatazenia
                                m_arrFemMembers[k].m_VElemPEF_LCS_StNode.FVectorItems[(int)e3D_E_F.eMY] += fTemp_Ma_UZRY;

                                // End Node
                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e3D_E_F.eFX] += fTemp_B_UXRX;
                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e3D_E_F.eMX] += fTemp_Mb_UXRX;

                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e3D_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)e3D_E_F.eMZ] += fTemp_Mb_UYRZ;

                                m_arrFemMembers[k].m_VElemPEF_LCS_EnNode.FVectorItems[(int)e3D_E_F.eFZ] += fTemp_B_UZRY; //-fTemp_B_UZRY;  // 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)e3D_E_F.eMY] += fTemp_Mb_UZRY;
                            }
                        }
                    }
                }
            }

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

            foreach (CE_1D Elem in m_arrFemMembers)
            {
                Elem.SetGetPEF_GCS();
            }
        }
Ejemplo n.º 2
0
        // public CCrSc_0_20 objCrScHollow = new CCrSc_0_20(200, 10);
        // public CCrSc_0_22 objCrScHollow = new CCrSc_0_22(200, 10);
        // public CCrSc_0_23 objCrScHollow = new CCrSc_0_23(200, 100, 5);
        // public CCrSc_0_24 objCrScHollow = new CCrSc_0_24(100, 10);
        // public CCrSc_0_25 objCrScHollow = new CCrSc_HL(200, 100, 10, 5);
        // public CCrSc_0_26 objCrScHollow = new CCrSc_0_26(200,10);
        // public CCrSc_0_27 objCrScHollow = new CCrSc_0_27(200, 10);
        // public CCrSc_0_28 objCrScHollow = new CCrSc_0_28(200, 10);
        // public CCrSc_0_50 objCrScSolid = new CCrSc_0_50(200,100,10,5);
        // public CCrSc_0_50 objCrScSolid = new CCrSc_0_50(200, 100, 150, 10, 15, 5, 70);
        // public CCrSc_0_52 objCrScSolid = new CCrSc_0_52(200, 100, 10, 5, 30);
        // public CCrSc_0_52 objCrScSolid = new CCrSc_0_52(200, 100, 150, 10, 15, 5, 30, 70);
        // public CCrSc_0_54 objCrScSolid = new CCrSc_0_54(200, 100, 10, 5,30,50);
        // public CCrSc_0_56 objCrScSolid = new CCrSc_0_56(200, 100, 10, 5,130);
        // public CCrSc_0_56 objCrScSolid = new CCrSc_0_56(200, 100, 30, 10, 5, 20, 130);
        // public CCrSc_0_58 objCrScSolid = new CCrSc_0_58(200, 100, 10, 5);
        // public CCrSc_0_58 objCrScSolid = new CCrSc_0_58(200, 100, 150, 10, 15, 5, 30, 70);
        // public CCrSc_0_60 objCrScSolid = new CCrSc_0_60(200,100,10);
        // public CCrSc_0_61 objCrScSolid = new CCrSc_0_61(100,10);
        // public CCrSc_3_00 objCrScSolid = new CCrSc_3_00(0,200,90,11.3f,7.5f,7.5f,4.5f,159.1f);
        // public CCrSc_3_00 objCrScSolid = new CCrSc_3_00(1, 200, 90, 11.3f, 7.5f, 4.5f, 159.1f);
        // public CCrSc_3_00 objCrScSolid = new CCrSc_3_00(2, 200, 90, 11.3f, 7.5f, 7.5f, 159.1f);
        // public CCrSc_3_01 objCrScSolid = new CCrSc_3_01(0, 200, 90, 120, 11.3f, 11.3f, 7.5f, 7.5f, 4.5f, 159.1f);
        // public CCrSc_3_01 objCrScSolid = new CCrSc_3_01(1, 200, 90, 120, 11.3f, 11.3f, 7.5f, 4.5f, 80.0f);
        // public CCrSc_3_01 objCrScSolid = new CCrSc_3_01(2, 200, 80, 100, 10, 8, 12, 10, 5, 5, 80);
        // public CCrSc_3_02 objCrScSolid = new CCrSc_3_02(0,300, 100, 16, 10, 10, 8, 232, 27);
        // public CCrSc_3_02 objCrScSolid = new CCrSc_3_02(2,300, 100, 12.5f, 10, 10, 250, 30);
        // public CCrSc_3_03 objCrScSolid = new CCrSc_3_03(150, 10, 15, 10, 50);
        // public CCrSc_3_04 objCrScSolid = new CCrSc_3_04(250, 150, 20, 15, 20, 50, 75);
        // public CCrSc_3_05 objCrScHollow = new CCrSc_3_05(200,10);
        // public CCrSc_3_06 objCrScHollow = new CCrSc_3_06(200, 100, 20);
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(0, 200, 100, 10, 30); // Both radii, coincident centres
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(1, 200, 100, 10, 5, 30); // Both radii, incoincident centres
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(2, 500, 300, 20, 50); // Outside radius = 0
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(3, 500, 300, 30); // Outside radius = 0, coincident centres
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(0, 400, 150, 20); // Both radii, coincident centres
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(2, 500, 300, 20); // Outside radius = 0
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(3, 500, 300, 30); // Inside radius = 0, coincident centres
        // public CCrSc_3_07 objCrScHollow = new CCrSc_3_07(5, 400, 150, 20); // No radii, Outside radius = 0, Inside radius = 0
        // public CCrSc_3_08 objCrScSolid = new CCrSc_3_08(0, 120, 100, 12.5f, 15, 100, 10, 10, 5, 90);
        // public CCrSc_3_08 objCrScSolid = new CCrSc_3_08(1, 120, 100, 12.5f, 15, 100, 10, 10, 5, 95);
        // public CCrSc_3_08 objCrScSolid = new CCrSc_3_08(2, 120, 100, 12.5f, 15, 100, 10, 5, 105);
        // public CCrSc_3_08 objCrScSolid = new CCrSc_3_08(3, 120, 100, 12.5f, 15, 100, 10, 5, 95);
        public CTest1()
        {
            // !!!!!! Vytvarat len ODKAZY na objekty "ref", aby sa zbytocne nevytvarali lokalne kopie

            // Materials
            // Materials List - Materials Array - Fill Data of Materials Array

            arrMat[0] = new CMat_00(); // Vytvarat priamo pre konkretne typy materialov (uzivatelsky, ocel, beton, drevo, hlinik)
            arrMat[1] = new CMat_02_00();
            arrMat[2] = new CMat_03_00();
            arrMat[3] = new CMat_05_00();
            arrMat[4] = new CMat_09_00();

            // CrSc
            // CrSc List - CrSc Array - Fill Data of Cross-sections Array

            arrCrSc[0] = new CRSC.CCrSc_3_07(3, 500, 300, 30);
            arrCrSc[1] = new CRSC.CCrSc_0_05(100, 50);
            arrCrSc[2] = new CRSC.CCrSc_3_04(250, 150, 20, 15, 20, 50, 75);

            arrCrSc[0].m_Mat = arrMat[0];
            arrCrSc[1].m_Mat = arrMat[1];
            arrCrSc[2].m_Mat = arrMat[4];

            // Nodes
            // Nodes List - Nodes Array

            arrNodes[0] = new BaseClasses.CNode(1, 500, 0, 2500, 0);
            arrNodes[1] = new BaseClasses.CNode(2, 2500, 0, 2500, 0);
            arrNodes[2] = new BaseClasses.CNode(3, 5500, 0, 2500, 0);
            arrNodes[3] = new BaseClasses.CNode(4, 500, 0, 500, 0);
            arrNodes[4] = new BaseClasses.CNode(5, 2500, 0, 500, 0);
            arrNodes[5] = new BaseClasses.CNode(6, 5500, 0, 500, 0);

            // Sort by ID
            //Array.Sort(arrNodes, new BaseClasses.CCompare_NodeID());

            // Members
            // Members List - Members Array

            arrMembers[0] = new BaseClasses.CMember(1, arrNodes[0], arrNodes[1], arrCrSc[0], 0);
            arrMembers[1] = new BaseClasses.CMember(2, arrNodes[1], arrNodes[2], arrCrSc[0], 0);
            arrMembers[2] = new BaseClasses.CMember(3, arrNodes[0], arrNodes[3], arrCrSc[1], 0);
            arrMembers[3] = new BaseClasses.CMember(4, arrNodes[1], arrNodes[4], arrCrSc[0], 0);
            arrMembers[4] = new BaseClasses.CMember(5, arrNodes[2], arrNodes[5], arrCrSc[0], 0);
            arrMembers[5] = new BaseClasses.CMember(6, arrNodes[3], arrNodes[4], arrCrSc[2], 0);
            arrMembers[6] = new BaseClasses.CMember(7, arrNodes[4], arrNodes[5], arrCrSc[0], 0);
            arrMembers[7] = new BaseClasses.CMember(8, arrNodes[1], arrNodes[3], arrCrSc[0], 0);
            arrMembers[8] = new BaseClasses.CMember(9, arrNodes[1], arrNodes[5], arrCrSc[1], 0);

            //Sort by ID
            //Array.Sort(arrMembers, new BaseClasses.CCompare_MemberID());

            // Nodal Supports - fill values

            // Set values
            bool[] bSupport1 = { true, false, true, false, true, false };
            bool[] bSupport2 = { false, false, true, false, true, false };
            bool[] bSupport3 = { true, false, false, false, false, false };

            // Create Support Objects
            // Pozn. Jednym z parametrov by malo byt pole ID uzlov v ktorych je zadefinovana tato podpora
            // objekt podpory bude len jeden a dotknute uzly budu vediet ze na ich podpora existuje a ake je konkretne ID jej nastaveni
            arrNSupports[0] = new BaseClasses.CNSupport(6,1, arrNodes[0], bSupport1, 0);
            arrNSupports[1] = new BaseClasses.CNSupport(6,2, arrNodes[2], bSupport2, 0);
            arrNSupports[2] = new BaseClasses.CNSupport(6,3, arrNodes[5], bSupport3, 0);

            // Sort by ID
            Array.Sort(arrNSupports, new BaseClasses.CCompare_NSupportID());

            // Member Releases / hinges - fill values

            // Pozn. Jednym z parametrov by malo byt pole ID prutov v ktorych je zadefinovany klb
            // objekt klbu bude len jeden a dotknute pruty budu vediet ze na ich klb existuje, v ktorom uzle (start 1 / End 2) a ake je konkretne ID jeho nastaveni

            // Set values
            //bool[] bMembRelase1 = { true, false, false, false, false, false };
            //bool[] bMembRelase2 = { false, false, true, false, false, false };
            //bool[] bMembRelase3 = { false, false, false, false, true, false };
            bool? [] bMembRelase4 = { true, false, true, false, true, false };

            // Create Release / Hinge Objects
            arrMembers[7].CnRelease1 = new BaseClasses.CNRelease(6,bMembRelase4, 0);
            arrMembers[8].CnRelease2 = new BaseClasses.CNRelease(6,bMembRelase4, 0);

            // Nodal Forces - fill values

            // Pozn. Jednym z parametrov by malo byt pole ID uzlov v ktorych je zadefinovane uzlove zatazenie
            // objekt zatazenia bude len jeden a dotknute uzly budu vediet ze na ich dane zatazenie existuje a ake je konkretne ID jeho vlastnosti

            arrNLoads[0] = new BaseClasses.CNLoadSingle(arrNodes[1], ENLoadType.eNLT_Fx, 40.0f, true, 0);
            arrNLoads[1] = new BaseClasses.CNLoadSingle(arrNodes[4], ENLoadType.eNLT_Fx, -60.0f, true, 0);
            arrNLoads[2] = new BaseClasses.CNLoadSingle(arrNodes[5], ENLoadType.eNLT_Fz, 80.0f, true, 0);
        }
Ejemplo n.º 3
0
        public CExample_2D_11()
        {
            m_eSLN = ESLN.e2DD_1D; // 1D members in 2D model
            m_eNDOF = (int)ENDOF.e2DEnv; // DOF in 2D
            m_eGCS = EGCS.eGCSLeftHanded; // Global coordinate system

            m_arrNodes = new BaseClasses.CNode[5];
            m_arrMembers = new CMember[4];
            m_arrMat = new CMat_00[1];
            m_arrCrSc = new CRSC.CCrSc[1];
            m_arrNSupports = new BaseClasses.CNSupport[3];
            m_arrNReleases = new BaseClasses.CNRelease[1];
            m_arrNLoads = new BaseClasses.CNLoad[1];
            m_arrMLoads = new BaseClasses.CMLoad[4];
            m_arrLoadCases = new BaseClasses.CLoadCase[1];
            m_arrLoadCombs = new BaseClasses.CLoadCombination[1];

            // Auxiliary
            // Load
            float fF1 = 45000f;   // Unit [N]
            float fF2 = 55000f;   // Unit [N]
            float fM = 60000000f;   // Unit [Nm]
            float fq = 22f;   // Unit [N/m]

            // Geometry
            float fa = 2.8f,
                  fb = 5.6f,
                  fc = 4.2f;     // Unit [m]

            // Materials
            // Materials List - Materials Array - Fill Data of Materials Array
            m_arrMat[0] = new CMat_00();

            m_arrMat[0].m_fE = 10000000f;          // Unit [Pa]
            m_arrMat[0].m_fNu = 0.3f;              // Unit [-]
            m_arrMat[0].m_fG = 4000000;            // Unit [Pa]

            // Cross-sections
            // CrSc List - CrSc Array - Fill Data of Cross-sections Array
            m_arrCrSc[0] = new CRSC.CCrSc_0_00();

            m_arrCrSc[0].FA_g = 0.12f;   // Unit [m^2]
            m_arrCrSc[0].FI_y = 0.0016f; // Unit [m^4]
            m_arrCrSc[0].FI_z = 0.0016f; // Unit [m^4]
            m_arrCrSc[0].m_Mat = m_arrMat[0]; // Set CrSc Material

            // Nodes
            // Nodes List - Nodes Array

            // Nodes
            // Node 1
            m_arrNodes[0] = new CNode();
            m_arrNodes[0].ID = 1;
            m_arrNodes[0].X = fa + fb;
            m_arrNodes[0].Y = fc;
            m_arrNodes[0].Z = 0f;

            // Node 2
            m_arrNodes[1] = new CNode();
            m_arrNodes[1].ID = 2;
            m_arrNodes[1].X = fb;
            m_arrNodes[1].Y = 0f;
            m_arrNodes[1].Z = 0f;

            // Node 3
            m_arrNodes[2] = new CNode();
            m_arrNodes[2].ID = 3;
            m_arrNodes[2].X = 0f;
            m_arrNodes[2].Y = 0f;
            m_arrNodes[2].Z = 0f;

            // Node 4
            m_arrNodes[3] = new CNode();
            m_arrNodes[3].ID = 4;
            m_arrNodes[3].X = 0f;
            m_arrNodes[3].Y = -fa;
            m_arrNodes[3].Z = 0f;

            // Node 5
            m_arrNodes[4] = new CNode();
            m_arrNodes[4].ID = 5;
            m_arrNodes[4].X = 0f;
            m_arrNodes[4].Y = fc;
            m_arrNodes[4].Z = 0f;

            // Sort by ID
            //Array.Sort(m_arrNodes, new BaseClasses.CCompare_NodeID());

            // Members
            // Members List - Members Array

            // Member 1 - 1-2
            m_arrMembers[0] = new CMember();
            m_arrMembers[0].ID = 1;
            m_arrMembers[0].NodeStart = m_arrNodes[0];
            m_arrMembers[0].NodeEnd = m_arrNodes[1];
            m_arrMembers[0].CrScStart = m_arrCrSc[0];

            // Member 2 - 2-3
            m_arrMembers[1] = new CMember();
            m_arrMembers[1].ID = 2;
            m_arrMembers[1].NodeStart = m_arrNodes[1];
            m_arrMembers[1].NodeEnd = m_arrNodes[2];
            m_arrMembers[1].CrScStart = m_arrCrSc[0];

            // Member 3 - 3-4
            m_arrMembers[2] = new CMember();
            m_arrMembers[2].ID = 3;
            m_arrMembers[2].NodeStart = m_arrNodes[2];
            m_arrMembers[2].NodeEnd = m_arrNodes[3];
            m_arrMembers[2].CrScStart = m_arrCrSc[0];

            // Member 4 - 3-5
            m_arrMembers[3] = new CMember();
            m_arrMembers[3].ID = 4;
            m_arrMembers[3].NodeStart = m_arrNodes[2];
            m_arrMembers[3].NodeEnd = m_arrNodes[4];
            m_arrMembers[3].CrScStart = m_arrCrSc[0];

            //Sort by ID
            //Array.Sort(m_arrMembers, new BaseClasses.CCompare_MemberID());

            // Nodal Supports - fill values
            // Support 1 - NodeIDs: 1,4
            m_arrNSupports[0] = new CNSupport(m_eNDOF);
            m_arrNSupports[0].ID = 1;
            m_arrNSupports[0].m_bRestrain[0] = true; // true - 1 restraint (infinity) / false - 0 - free (zero rigidity)
            m_arrNSupports[0].m_bRestrain[1] = true;
            m_arrNSupports[0].m_bRestrain[2] = true;
            m_arrNSupports[0].m_iNodeCollection = new int[2];
            m_arrNSupports[0].m_iNodeCollection[0] = 1;
            m_arrNSupports[0].m_iNodeCollection[1] = 4;

            // Support 2 - NodeIDs: 3
            m_arrNSupports[1] = new CNSupport(m_eNDOF);
            m_arrNSupports[1].ID = 2;
            m_arrNSupports[1].m_bRestrain[0] = true; // true - 1 restraint (infinity) / false - 0 - free (zero rigidity) - support in GCS X-axis
            m_arrNSupports[1].m_bRestrain[1] = false;
            m_arrNSupports[1].m_bRestrain[2] = false;
            m_arrNSupports[1].m_iNodeCollection = new int[1];
            m_arrNSupports[1].m_iNodeCollection[0] = 3;

            // Support 3 - NodeIDs: 5
            m_arrNSupports[2] = new CNSupport(m_eNDOF);
            m_arrNSupports[2].ID = 3;
            m_arrNSupports[2].m_bRestrain[0] = true; // true - 1 restraint (infinity) / false - 0 - free (zero rigidity) - support in GCS X and Y-axis
            m_arrNSupports[2].m_bRestrain[1] = true;
            m_arrNSupports[2].m_bRestrain[2] = false;
            m_arrNSupports[2].m_iNodeCollection = new int[1];
            m_arrNSupports[2].m_iNodeCollection[0] = 5;

            // Sort by ID
            Array.Sort(m_arrNSupports, new BaseClasses.CCompare_NSupportID());

            // Member releases
            bool?[] bRelTemp = new bool?[m_eNDOF];
            bRelTemp[0] = true; // true - 1 restraint (infinity rigidity) / false - 0 - free (zero rigidity) - support in LCS X and Y-axis
            bRelTemp[1] = true;
            bRelTemp[2] = false;

            CNRelease NRelease1 = new CNRelease(m_eNDOF, m_arrNodes[1], m_arrMembers[0], bRelTemp, 0);
            NRelease1.m_iNodeCollection = new int[1];
            NRelease1.m_iNodeCollection[0] = 2;
            NRelease1.m_iMembCollection = new int[2];
            NRelease1.m_iMembCollection[0] = 1;
            NRelease1.m_iMembCollection[1] = 2;
            m_arrNReleases[0] = NRelease1;
            m_arrMembers[0].CnRelease2 = m_arrNReleases[0]; // Release at end node
            m_arrMembers[1].CnRelease1 = m_arrNReleases[0]; // Release at start node

            // Nodal loads
            // Load 1 - NodeIDs: 2
            CNLoadSingle NLoad0 = new CNLoadSingle();
            NLoad0.INLoad_ID = 1;
            NLoad0.NLoadType = ENLoadType.eNLT_Fy;
            NLoad0.INodeCollection = new int[1];
            NLoad0.INodeCollection[0] = 2;
            NLoad0.Value = fF2; // Positive

            m_arrNLoads[0] = NLoad0;

            // Member loads
            // Load 1 and 2 - MemberIDs: 1

            float fAlpha_1 = (236.3099f / 360f) * 2 * MATH.MathF.fPI;  // Radians
            float fF1x = Math.Abs(fF1 * (float)Math.Cos(fAlpha_1));    // Force in local coordinate system of member + possitive orientation  in x-axis
            float fF1y = fF1 * (float)Math.Sin(fAlpha_1);              // Force in local coordinate system of member + negative orientation in y-axis

            CMLoad_11 MLoad_F1x = new CMLoad_11(fF1x, 0.5f * m_arrMembers[0].FLength);
            MLoad_F1x.ID = 1;
            MLoad_F1x.MLoadTypeDistr = EMLoadTypeDistr.eMLT_FS_H_12;
            MLoad_F1x.MLoadType = EMLoadType.eMLT_F;
            MLoad_F1x.EDirPPC = EMLoadDirPCC1.eMLD_PCC_FXX_MXX;
            MLoad_F1x.IMemberCollection = new int[1];
            MLoad_F1x.IMemberCollection[0] = 1;

            m_arrMLoads[0] = MLoad_F1x;

            CMLoad_11 MLoad_F1y = new CMLoad_11(fF1y, 0.5f * m_arrMembers[0].FLength);
            MLoad_F1y.ID = 2;
            MLoad_F1y.MLoadTypeDistr = EMLoadTypeDistr.eMLT_FS_H_12;
            MLoad_F1y.MLoadType = EMLoadType.eMLT_F;
            MLoad_F1y.EDirPPC = EMLoadDirPCC1.eMLD_PCC_FYU_MZV;
            MLoad_F1y.IMemberCollection = new int[1];
            MLoad_F1y.IMemberCollection[0] = 1;

            m_arrMLoads[1] = MLoad_F1y;

            // Load 3 - MemberIDs: 3
            CMLoad_21 MLoad_q = new CMLoad_21(fq);
            MLoad_q.ID = 3;
            MLoad_q.MLoadTypeDistr = EMLoadTypeDistr.eMLT_QUF_W_21;
            MLoad_q.MLoadType = EMLoadType.eMLT_F;
            MLoad_q.EDirPPC = EMLoadDirPCC1.eMLD_PCC_FYU_MZV;
            MLoad_q.IMemberCollection = new int[1];
            MLoad_q.IMemberCollection[0] = 2;

            m_arrMLoads[2] = MLoad_q;

            // Load 4 - MemberIDs: 4
            CMLoad_11 MLoad_M = new CMLoad_11(-fM, 0.5f * m_arrMembers[3].FLength);
            MLoad_M.ID = 4;
            MLoad_M.MLoadTypeDistr = EMLoadTypeDistr.eMLT_FS_H_12;
            MLoad_M.MLoadType = EMLoadType.eMLT_M;
            MLoad_M.EDirPPC = EMLoadDirPCC1.eMLD_PCC_FYU_MZV;
            MLoad_M.IMemberCollection = new int[1];
            MLoad_M.IMemberCollection[0] = 4;

            m_arrMLoads[3] = MLoad_M;

            // Load Cases
            // Load Case 1
            m_arrLoadCases[0] = new CLoadCase();
            m_arrLoadCases[0].ID = 1;

            // Load Combinations
            // Load Combination 1
            m_arrLoadCombs[0] = new CLoadCombination();
            m_arrLoadCombs[0].ID = 1;
        }