/// <summary> /// Executes the command. /// Creates, gets parameters and add a Concentrated 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) { ConcentratedSpanLoad load = new ConcentratedSpanLoad(); //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((ConcentratedSpanLoad)load.Clone()); } } }
private void readLinePointForces(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; ConcentratedSpanLoad load = new ConcentratedSpanLoad(); 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.D = float.Parse(readAttribute(node, "RelDist", load.D.ToString())); load.L = float.Parse(readAttribute(node, "Force", load.LoadInt.ToString())); loads.Add(load, lCase); } }
private float addConcentratedMomentDeflection(ConcentratedSpanLoad load, float x, float lineLength, ref float angle, float a, float b, float RA, float M, float c1, float c3, float c4) { float flecha = 0.0f; if (x < a) { flecha = -RA * (float)Math.Pow(x, 3) / 6f + c1 * x; angle = -RA * (float)Math.Pow(x, 2) / 2f + c1; } else { flecha = -RA * (float)Math.Pow(x, 3) / 6f + M * (float)Math.Pow(x, 2) / 2f + c3 * x + c4; angle = -RA * (float)Math.Pow(x, 2) / 2f + M * x + c3; } return flecha; }
private void addConcentratedMomentDeflection(LineElement line, float lineLength, ConcentratedSpanLoad load, float[,] controlPoints, float dirComponent, float scale, float EI) { float a, b; float RA, M; float c1, c3, c4; float x = 0.0f, deflection = 0.0f, angle = 0.0f; ConcentratedSpanLoad csl = (ConcentratedSpanLoad)load; a = csl.D * lineLength; b = lineLength - a; M = csl.L; RA = M / lineLength; c3 = M * (-lineLength * lineLength / 3f - a * a / 2f) / lineLength; c1 = a * M + c3; c4 = M * a * a / 2f; // Flechas, angulos for (int i = 0; i < controlPoints.GetLength(0); i++) { x = controlPoints[i, 0] * lineLength; deflection = addConcentratedMomentDeflection(load, x, lineLength, ref angle, a, b, RA, M, c1, c3, c4) * scale / EI; controlPoints[i, 1] += (deflection * dirComponent); controlPoints[i, 2] += angle * dirComponent / EI; } }
private float addConcentratedForceDeflection(ConcentratedSpanLoad load, float x, float lineLength, ref float angle, float a, float b, float RA, float P, float c1, float c3) { float flecha = 0.0f; if (x < a) { flecha = RA * (float)Math.Pow(x, 3) / 6f + c1 * x; angle = RA * (float)Math.Pow(x, 2) / 2f + c1; } else { flecha = RA * (float)Math.Pow(x, 3) / 6f - P * (float)Math.Pow(x - a, 3) / 6f + c3 * x; angle = RA * (float)Math.Pow(x, 2) / 2f - P * (float)Math.Pow(x - a, 2) / 2f + c3; } return flecha; }
private void addConcentratedForceDeflection(LineElement line, float lineLength, ConcentratedSpanLoad load, float[,] controlPoints, float dirComponent, float scale, float EI) { float a, b; float RA, P; float c1, c3; float x = 0.0f, deflection = 0.0f, angle = 0.0f; ConcentratedSpanLoad csl = (ConcentratedSpanLoad)load; a = csl.D * lineLength; b = lineLength - a; P = -csl.L; RA = P * (1f - a / lineLength); c1 = c3 = P * a * (lineLength - a) * (a - 2f * lineLength) / (6f * lineLength); // Flechas, angulos for (int i = 0; i < controlPoints.GetLength(0); i++) { x = controlPoints[i, 0] * lineLength; deflection = addConcentratedForceDeflection(load, x, lineLength, ref angle, a, b, RA, P, c1, c3) * scale / EI; controlPoints[i, 1] += (deflection * dirComponent); controlPoints[i, 2] += angle * dirComponent / EI; } }
/// <summary> /// Relocates a ConcentratedSpanLoad 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 RelocateConcentratedLoads(AssignedLoads newLineLoads, LoadCase lc, float x, ConcentratedSpanLoad load) { if (x > load.D) { load.D = load.D / x; return false; } else { load = (ConcentratedSpanLoad)load.Clone(); load.Id = 0; load.D = (load.D - x) / (1f - x); newLineLoads.Add(load, lc); return true; } }