private void BuildFESystem() { this.FEsystem = new StatSystem(); this.FEsystem.PointMergeTolerance = this.systemSettings.mergeTolerance_m; this.FEsystem.MergeNewNodes = true; sStatConverter conv = new sStatConverter(); foreach (IFrameSet bs in this.frameSets) { foreach (sFrame b in bs.frames) { StatCrossSection cs = conv.ToStatCrossSection(b, bs.AsMinuteDensity); StatNode n0 = this.FEsystem.AddNode(conv.ToCVector(b.node0)); StatNode n1 = this.FEsystem.AddNode(conv.ToCVector(b.node1)); C_vector uv = conv.ToCVector(b.upVector); StatBeam sb = this.FEsystem.AddBeam(n0, n1, cs, uv); b.extraData = sb; sb.ExtraData = b; } } foreach (sNode sn in this.nodes) { StatNode n = null; if (sn.boundaryCondition != null) { //n = this.FEsystem.AddNode(sn.location.X, sn.location.Y, sn.location.Z); n = FindStatNode(sn, this.systemSettings.mergeTolerance_m); if (sn.boundaryCondition.supportType == eSupportType.FIXED) { n.SupportType = BOUNDARYCONDITIONS.ALL; } else if (sn.boundaryCondition.supportType == eSupportType.PINNED) { n.SupportType = BOUNDARYCONDITIONS.TRANSLATIONS; } else if (sn.boundaryCondition.supportType == eSupportType.CUSTOM) { } } if (sn.pointLoads != null && sn.pointLoads.Count > 0) { n = FindStatNode(sn, this.systemSettings.mergeTolerance_m); } if (n != null) { sn.extraData = n; n.ExtraData = sn; } } }
public StatNode FindStatNode(sNode jn, double tol) { StatNode clnode = null; foreach (StatNode n in this.FEsystem.Nodes) { C_vector jv = new C_vector(jn.location.X, jn.location.Y, jn.location.Z); if (jv.DistanceTo(n.p) < tol) { clnode = n; break; } } return(clnode); }
public sXYZ TosXYZ(C_vector cv) { return(new sXYZ(cv.x, cv.y, cv.z)); }