Ejemplo n.º 1
0
        private static WMesh2D_Mesh Mesh_SinglePole(WRim2D Rim, ref GLCommon GLC, ref List <WPoint2D>[] Ptts, string Name)
        {
            WMFuncs2D.Mesh_Curves(ref Rim.Curves, GLC.Mesh_Length);  /////Mesh每条线
            WMesh2D_Mesh Mesh = Mesh2D_MeshFree.Mesh_SingleRim(ref Rim.Curves, Name, ref GLC.MP);

            if (Mesh == null)
            {
                return(null);
            }
            int R = (int)(Rim.Color.R * 0.8);
            int G = (int)(Rim.Color.G * 0.8);
            int B = (int)(Rim.Color.B * 0.8);

            Mesh.Color = Color.FromArgb(255, R, G, B);
            Mesh.Trace = 2;
            PotentNs_App(ref Mesh.Nodes, ref Ptts, GLC.Potent_Lmax);
            int Quan_E = Mesh.QEs;

            for (int i = 0; i < Quan_E; i++)
            {
                Mesh.Elements.Add(new WElement2D(Mesh.Elements[i].Kind * (-1),
                                                 Mesh.Elements[i].N1,
                                                 Mesh.Elements[i].N2,
                                                 Mesh.Elements[i].N3,
                                                 Mesh.Elements[i].N4));
            }
            return(Mesh);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Mesh内部区域
        /// </summary>
        private static WMesh2D_Mesh Mesh_InnerFree(WRim2D Rim, ref GLCommon GLC, string Name)
        {
            WMFuncs2D.Mesh_Curves(ref Rim.Curves, GLC.Mesh_Length);  /////Mesh每条线
            WMesh2D_Mesh Mesh = Mesh2D_MeshFree.Mesh_SingleRim(ref Rim.Curves, Name, ref GLC.MP);

            if (Mesh == null)
            {
                return(null);
            }
            int R = (int)(Rim.Color.R * 0.8);
            int G = (int)(Rim.Color.G * 0.8);
            int B = (int)(Rim.Color.B * 0.8);

            Mesh.Color = Color.FromArgb(255, R, G, B);
            Mesh.Trace = 3;
            return(Mesh);
        }
Ejemplo n.º 3
0
        private static void Out_toMesh(ref List <int>[] Rims, ref WMesh2D_Para MP, ref WEntity2D[] Poles, ref WMesh2D_Mesh Mesh)
        {
            WEntity2D[]    Rim_Curves;
            WMesh2D_Mesh[] Meshs_t = new WMesh2D_Mesh[Rims.Length];
            for (int i = 0; i < Rims.Length; i++)
            {
                Rim_Curves = new WEntity2D[Rims[i].Count];
                for (int j = 0; j < Rims[i].Count; j++)
                {
                    Rim_Curves[j] = (WEntity2D)Poles[Rims[i][j]];
                }
                Meshs_t[i] = Mesh2D_MeshFree.Mesh_SingleRim(ref Rim_Curves, Convert.ToString(i), ref MP);
            }

            Mesh = Meshs_t[0];
            for (int i = 1; i < Rims.Length; i++)
            {
                Mesh = Mesh2D_Merge_Mesh2Mesh.Mesh_Combine(Mesh, Meshs_t[i], "Pole");
            }
            Meshs_t = null;
        }
Ejemplo n.º 4
0
        private static WMesh2D_Mesh Mesh_FreeRim(ref WEntity2D[] WBs, ref WEntity2D[] Ws, ref GLCommon GLC, string Name)
        {
            WMesh2D_Mesh Mesh_Glass = new WMesh2D_Mesh(Name);

            /////
            WEntity2D[]  Bds  = new WEntity2D[0];                                            /////所有的内部边界线
            List <int>[] Rims = Find_BdsRims(ref WBs, ref Ws, ref GLC, ref Bds, Mesh_Glass); /////找到所有的边界线及所有的区域
            /////逐个Rim分别Mesh
            WElement2D[]    Es = new WElement2D[0];
            WEntity2D[]     Rim;
            List <int>      Ns = new List <int>();
            List <WPoint2D> Ps = new List <WPoint2D>();

            /////
            for (int i = 0; i < Rims.Length; i++)
            {
                Rim = new WEntity2D[Rims[i].Count];
                for (int j = 0; j < Rim.Length; j++)
                {
                    Rim[j] = Bds[Rims[i][j]];
                }

                Es = Mesh2D_SingleLayerMesh.Do_Mesh(ref Rim, i.ToString(), ref GLC.MP);
                if (Es == null || Es.Length == 0)
                {
                    for (int j = 0; j < Rim.Length; j++)
                    {
                        for (int k = 0; k < ((WCurve2D)Rim[j]).Nodes.Count - 1; k++)
                        {
                            Ps.Add(((WCurve2D)Rim[j]).Nodes[k]);
                            Ns.Add(((WCurve2D)Rim[j]).Nodes_num[k]);
                        }
                    }
                    Es = Mesh2D_MeshFree.Mesh_SingleRim(ref Ns, ref Ps, ref GLC.MP, i.ToString());
                }
                if (Es == null || Es.Length == 0)
                {
                    continue;
                }
                Mesh_Glass.Add_Es(ref Es);
            }
            if (Mesh_Glass.QEs == 0)
            {
                return(null);
            }
            else
            {
                for (int i = 0; i < Bds.Length; i++)
                {
                    if (Bds[i].Trace != -2)
                    {
                        continue;
                    }
                    Es = new WElement2D[0];
                    WMFuncs2D.E2sID_App(ref ((WCurve2D)Bds[i]).Nodes_num, ref Es, 0, true);  /////Beam单元生成
                    if (Es == null || Es.Length == 0)
                    {
                        continue;
                    }
                    Mesh_Glass.Add_Es(ref Es);                                               /////Beam单元输出
                }
            }
            /////
            int Nt = 0;

            for (int i = 0; i < WBs.Length; i++)
            {
                if (((WCurve2D)WBs[i]).Meshed_Check == true)
                {
                    continue;
                }
                ((WCurve2D)WBs[i]).Nodes = new List <WPoint2D>();
                for (int j = 0; j < Bds.Length; j++)
                {
                    Nt = ((WCurve2D)Bds[j]).Trace;
                    if (Nt != i)
                    {
                        continue;
                    }
                    for (int k = 0; k < ((WCurve2D)Bds[j]).Nodes.Count - 1; k++)
                    {
                        ((WCurve2D)WBs[i]).Nodes.Add(((WCurve2D)Bds[j]).Nodes[k]);
                    }
                }
                ((WCurve2D)WBs[i]).Nodes.Add(new WPoint2D(((WCurve2D)WBs[i]).EndPoint.X, ((WCurve2D)WBs[i]).EndPoint.Y));
            }
            //////
            return(Mesh_Glass);
        }