void MakeFemMeshSample2() { // rectangle FemMesh 생성 FemMesh fMesh = new FemMesh(); FemMesh.CreateRectangleQuad4(200, 200, 30, 30, Material.Copper, out fMesh); // 고정점 설정 fMesh.FixAll(new Point3D(0, 0), new Point3D(200, 0), .1); // 힘 적용 fMesh.SetForce(new Point3D(100, 200), new Point3D(120, 200), .1, new Vector3D(0, -100, 0)); // fem mesh 객체 추가 model1.Entities.Add(fMesh); model1.Invalidate(); // 솔버에 fem mesh를 추가해서 해석. Solver s1 = new Solver(fMesh); model1.DoWork(s1); model1.Invalidate(); // fem mesh plot mode 설정 fMesh.PlotMode = FemMesh.plotType.U; fMesh.NodalAverages = true; // 등고선 계산해서 표시하고, legend 설정 fMesh.ComputePlot(model1, model1.ActiveViewport.Legends[0]); }
void MakeFemMeshSample() { Line l1 = new Line(0, 0, 100, 0); Line l2 = new Line(100, 0, 100, 30); Line l3 = new Line(100, 30, 80, 30); Arc a1 = new Arc(80, 50, 0, 20, Utility.DegToRad(180), Utility.DegToRad(270)); Line l4 = new Line(60, 50, 60, 80); Line l5 = new Line(60, 80, 30, 80); Line l6 = new Line(30, 80, 30, 31); Arc a2 = new Arc(29, 31, 0, 1, Utility.DegToRad(270), Utility.DegToRad(360)); Line l7 = new Line(29, 30, 26, 30); Arc a3 = new Arc(26, 31, 0, 1, Utility.DegToRad(180), Utility.DegToRad(270)); Line l8 = new Line(25, 31, 25, 80); Line l9 = new Line(25, 80, 15, 80); Line l10 = new Line(15, 80, 15, 31); Arc a4 = new Arc(14, 31, 0, 1, Utility.DegToRad(270), Utility.DegToRad(360)); Line l11 = new Line(14, 30, 11, 30); Arc a5 = new Arc(11, 31, 0, 1, Utility.DegToRad(180), Utility.DegToRad(270)); Line l12 = new Line(10, 31, 10, 80); Line l13 = new Line(10, 80, 0, 80); Line l14 = new Line(0, 80, 0, 0); Circle c1 = new Circle(20, 15, 0, 5); Circle c2 = new Circle(35, 15, 0, 5); Circle c3 = new Circle(50, 15, 0, 5); Circle c4 = new Circle(65, 15, 0, 5); devDept.Eyeshot.Entities.Region reg = new devDept.Eyeshot.Entities.Region(new ICurve[] { new CompositeCurve(l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, a1, a2, a3, a4, a5), c1, c2, c3, c4 }, Plane.XY); Mesh m = UtilityEx.Triangulate(reg, 3); Material copper = Material.Copper; copper.ElementThickness = 6; copper.ElementType = elementType.PlaneStress; FemMesh fMesh = m.ConvertToFemMesh(copper, true); fMesh.FixAll(new Point3D(0, 0), new Point3D(100, 0), .1); fMesh.SetForce(new Point3D(0, 70), new Point3D(50, 70), .1, new Vector3D(-1, 0, 0)); model1.Entities.Add(fMesh); model1.Invalidate(); Solver s1 = new Solver(fMesh); model1.DoWork(s1); model1.Invalidate(); fMesh.PlotMode = FemMesh.plotType.U; fMesh.NodalAverages = true; fMesh.ComputePlot(model1, model1.ActiveViewport.Legends[0]); model1.ZoomFit(); }