public LineStressCalculator() { selfWeight = new DistributedSpanLoad(); selfWeight.Direction = LineLoad.LoadDirection.Gravity; selfWeight.Da = 0f; selfWeight.Db = 1f; }
public AssignedLineLoads(Item item) : base(item) { if (!(item is LineElement)) { throw new InvalidItemException(); } weight = new DistributedSpanLoad(); weight.Da = 0; weight.Db = 1; weight.Direction = LineLoad.LoadDirection.Gravity; weight.La = 1; weight.Lb = 1; }
/// <summary> /// Executes the command. /// Creates, gets parameters and add a Distributed line load to the selected line elements. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { DistributedSpanLoad load = new DistributedSpanLoad(); //services.GetProperties(Title, load, false); if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(load) == System.Windows.Forms.DialogResult.OK) { List<Item> selection = services.GetSelection(); foreach (Item item in selection) { if (item is LineElement) ((LineElement)item).Loads.Add((DistributedSpanLoad)load.Clone()); } } }
/// <summary> /// Executes the command. /// Creates, gets parameters and add a Distributed line load to the selected line elements. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(this) == System.Windows.Forms.DialogResult.OK) { DistributedSpanLoad newLoad = new DistributedSpanLoad(); newLoad.Da = 0; newLoad.Db = 1; newLoad.Direction = direction; newLoad.La = load; newLoad.Lb = load; newLoad.Type = type; List<Item> selection = services.GetSelection(); foreach (Item item in selection) { if (item is LineElement) ((LineElement)item).Loads.Add((DistributedSpanLoad)newLoad.Clone()); } } }
private void readLineDistributedForces(XmlNode node) { uint id = uint.Parse(readAttribute(node, "Frame", "0")); string lcName = readAttribute(node, "LoadCase", "").Trim(); lcName = (lcName.Length > 0) ? lcName : Culture.Get("Case"); LoadCase lCase = model.LoadCases[lcName]; LineElement obj = model.LineList[id]; if (obj != null && lCase != null) { AssignedLoads loads = obj.Loads; DistributedSpanLoad load = new DistributedSpanLoad(); load.Type = (LineLoad.LoadType)Enum.Parse(typeof(LineLoad.LoadType), readAttribute(node, "Type", load.Type.ToString())); string coordSys = readAttribute(node, "CoordSys", "GLOBAL"); string dir = readAttribute(node, "Dir", load.Direction.ToString()); load.Direction = GetLoadDirection(coordSys, dir); load.Da = float.Parse(readAttribute(node, "RelDistA", load.Da.ToString())); load.Db = float.Parse(readAttribute(node, "RelDistB", load.Db.ToString())); load.La = float.Parse(readAttribute(node, "FOverLA", load.La.ToString())); load.Lb = float.Parse(readAttribute(node, "FOverLB", load.Lb.ToString())); loads.Add(load, lCase); } }
private void addUniformForceDeflection(LineElement line, float lineLength, DistributedSpanLoad load, float a, float b, float c, float[,] controlPoints, float dirComponent, float scale, float EI) { float W, w; float RA; float c1, c3, c5, c6; float x = 0.0f, deflection = 0.0f, angle = 0.0f; w = -1f * Math.Sign(load.La) * Math.Min(Math.Abs(load.La), Math.Abs(load.Lb)); W = w * b; RA = W * (1.0f - (2.0f * a + b) / (2.0f * lineLength)); // Calculo de las constantes c6 = w * (float)Math.Pow(b, 3) * (b + 2.0f * a) / 48.0f; c5 = (w * b * (float)Math.Pow(lineLength - a - b / 2.0f, 3) / (6.0f * lineLength)) - RA * (float)Math.Pow(lineLength, 2) / 6.0f - c6 / lineLength; c1 = c3 = w * (float)Math.Pow(b, 3) / 24.0f + c5; // Flechas, angulos for (int i = 0; i < controlPoints.GetLength(0); i++) { x = controlPoints[i, 0] * lineLength; deflection = addUniformForceDeflection(load, x, lineLength, ref angle, a, b, c, W, w, RA, c1, c3, c5, c6) * scale / EI; controlPoints[i, 1] += (deflection * dirComponent); controlPoints[i, 2] += angle * dirComponent / EI; } }
private void addTriangularForceDeflection(LineElement line, float lineLength, DistributedSpanLoad load, float a, float b, float c, float[,] controlPoints, float dirComponent, float scale, float EI) { float q; float RA; float c1, c2, d1, d2, e1, e2; float x = 0.0f, deflection = 0.0f, angle = 0.0f; if ((load.La - load.Lb) == 0) return; // Define load orientation +/-, left/right bool isLeft = false; if (Math.Abs(load.La) > Math.Abs(load.Lb)) isLeft = true; if (isLeft) { q = load.Lb - load.La; // Swap a and c float swapAC = a; a = c; c = swapAC; } else q = load.La - load.Lb; RA = (q * b / 2f) * (1f - (a + 2f * b / 3f) / lineLength); // Calculo de las constantes c2 = d2 = 0f; e1 = (q * b * (float)Math.Pow(lineLength - a - 2f * b / 3f, 3) / 12f - RA * (float)Math.Pow(lineLength, 3) / 6f - 7f * q * (float)Math.Pow(b, 4) / 810f - q * a * (float)Math.Pow(b, 3) / 72f) / lineLength; e2 = q * a * (float)Math.Pow(b, 3) / 72 + 7f * q * (float)Math.Pow(b, 4) / 810f; c1 = d1 = e1 + q * (float)Math.Pow(b, 3) / 72; // Flechas, angulos for (int i = 0; i < controlPoints.GetLength(0); i++) { if (isLeft) x = (1f - controlPoints[i, 0]) * lineLength; else x = controlPoints[i, 0] * lineLength; deflection = addTriangularForceDeflection(load, lineLength, x, ref angle, RA, a, b, q, c1, c2, d1, d2, e1, e2) * scale / EI; controlPoints[i, 1] += (deflection * dirComponent); controlPoints[i, 2] += angle * dirComponent / EI; } }
/// <summary> /// Distributes a DistributedSpanLoad between the line element where it is and a new adjacent line element. /// </summary> /// <param name="newLineLoads">The AssignedLoads object of the new Line Element</param> /// <param name="lc">The Load Case to which the load belongs.</param> /// <param name="x">The dividing point of the two line elements [0, 1]</param> /// <param name="load">The Load to distribute in two elements</param> /// <returns>true if the load was moved to the new Line Element (so the caller removes it). false otherwise.</returns> private static bool RelocateDistributedLoads(AssignedLoads newLineLoads, LoadCase lc, float x, DistributedSpanLoad load) { if (load.Da < x && load.Db < x) { load.Da = load.Da / x; load.Db = load.Db / x; return false; } if (load.Da >= x && load.Db >= x) { load = (DistributedSpanLoad)load.Clone(); load.Id = 0; load.Da = (load.Da - x) / (1 - x); load.Db = (load.Db - x) / (1 - x); newLineLoads.Add(load, lc); return true; } if (load.Da > load.Db) { float tmp = load.Db; load.Db = load.Da; load.Da = tmp; tmp = load.Lb; load.Lb = load.La; load.La = tmp; } DistributedSpanLoad nLoad = (DistributedSpanLoad)load.Clone(); nLoad.Id = 0; load.Da = load.Da / x; load.Db = 1f; load.Lb = (load.La) + (x - load.Da) * (load.Lb - load.La) / (load.Db - load.Da); nLoad.Da = 0; nLoad.Db = (nLoad.Db - x) / (1 - x); nLoad.La = load.Lb; newLineLoads.Add(nLoad, lc); return false; }