private void addToShearMomentDiagram(LineElement line, DirectionalLineLoad load, float[,] controlPoints, LineForceComponent component, float scale) { if (load == null) return; float dirComponent = 0f, position; // Get Load direction in Local Coordinate frame Vector3 dir = getLocalDir(line, load.Direction); switch (component) { case LineForceComponent.Axial: case LineForceComponent.Torsion: dirComponent = dir.X; break; case LineForceComponent.Shear22: case LineForceComponent.Moment33: dirComponent = dir.Y; break; case LineForceComponent.Shear33: case LineForceComponent.Moment22: dirComponent = dir.Z; break; } int i; switch (component) { case LineForceComponent.Shear22: case LineForceComponent.Shear33: for (i = 0; i < controlPoints.GetLength(0); i++) { position = controlPoints[i,0] * line.Length; controlPoints[i, 1] += addToShearDiagram(load, dirComponent, position, line.Length) * scale; } break; case LineForceComponent.Moment33: dirComponent = -dirComponent; for (i = 0; i < controlPoints.GetLength(0); i++) { position = controlPoints[i,0] * line.Length; controlPoints[i, 1] += addToMomentDiagram(load, dirComponent, position, line.Length) * scale; } break; case LineForceComponent.Moment22: for (i = 0; i < controlPoints.GetLength(0); i++) { position = controlPoints[i,0] * line.Length; controlPoints[i, 1] += addToMomentDiagram(load, dirComponent, position, line.Length) * scale; } break; default: break; } }
private void store(OleDbConnection cn, uint itemId, string loadCase, DirectionalLineLoad obj) { string sql = ""; string dir = obj.Direction.ToString(); string dirFrame = "GLOBAL"; if (obj.Direction != LineLoad.LoadDirection.Gravity) { dirFrame = dir.Substring(0, dir.Length - 1).ToUpper(); dir = dir.Substring(dir.Length - 1); } if (obj is ConcentratedSpanLoad) { ConcentratedSpanLoad point = (ConcentratedSpanLoad)obj; sql = "INSERT INTO [Frame Loads - Point] " + "(Frame,LoadCase,CoordSys,Type,Dir,DistType,RelDist,AbsDist,Force) VALUES " + "(" + itemId + ",\"" + loadCase + "\",\"" + dirFrame + "\",\"" + point.Type + "\"," + "\"" + dir + "\",\"RelDist\"," + point.D + ",0," + point.LoadInt + ");"; } else if (obj is DistributedSpanLoad) { DistributedSpanLoad dist = (DistributedSpanLoad)obj; sql = "INSERT INTO [Frame Loads - Distributed] " + "(Frame,LoadCase,CoordSys,Type,Dir,DistType,RelDistA,RelDistB,AbsDistA,AbsDistB,FOverLA,FOverLB) VALUES " + "(" + itemId + ",\"" + loadCase + "\",\"" + dirFrame + "\",\"" + dist.Type + "\"," + "\"" + dir + "\",\"RelDist\"," + dist.Da + "," + dist.Db + ",0,0," + dist.LoadAInt + "," + dist.LoadBInt + ");"; } if (sql.Length > 0) new OleDbCommand(sql, cn).ExecuteNonQuery(); }
private void addLoadDeflection(LineElement line, float lineLength, DirectionalLineLoad load, float[,] controlPoints, DeformationAxis component, float scale, float EI) { if (load == null) return; Vector3 dir = getLocalDir(line, load.Direction); float dirComponent = 0.0f; switch (component) { case DeformationAxis.Local2: dirComponent = dir.Y; break; case DeformationAxis.Local3: dirComponent = dir.Z; break; } if (load is ConcentratedSpanLoad) { if (load.Type == LineLoad.LoadType.Force) addConcentratedForceDeflection(line, lineLength, (ConcentratedSpanLoad)load, controlPoints, dirComponent, scale, EI); else addConcentratedMomentDeflection(line, lineLength, (ConcentratedSpanLoad)load, controlPoints, dirComponent, scale, EI); } else if (load is DistributedSpanLoad) { DistributedSpanLoad dsl = (DistributedSpanLoad)load; float a, b, c; a = dsl.Da * lineLength; b = (dsl.Db - dsl.Da) * lineLength; c = (1.0f - dsl.Db) * lineLength; if (load.Type == LineLoad.LoadType.Force) { addUniformForceDeflection(line, lineLength, dsl, a, b, c, controlPoints, dirComponent, scale, EI); addTriangularForceDeflection(line, lineLength, dsl, a, b, c, controlPoints, dirComponent, scale, EI); } else { // TODO: Partial Uniform and Triangular Moments Deflection calculator } } }