protected override void SolveInstance(IGH_DataAccess DA) { // get data string name = null, type = "static", durationClass = "permanent"; if (!DA.GetData(0, ref name)) { return; } if (!DA.GetData(1, ref type)) { // pass } if (!DA.GetData(2, ref durationClass)) { // pass } if (name == null || type == null || durationClass == null) { return; } LoadCaseType _type = FemDesign.GenericClasses.EnumParser.Parse <LoadCaseType>(type); LoadCaseDuration _durationClass = FemDesign.GenericClasses.EnumParser.Parse <LoadCaseDuration>(durationClass); FemDesign.Loads.LoadCase obj = new FemDesign.Loads.LoadCase(name, _type, _durationClass); // return DA.SetData(0, obj); }
public static LoadCase CreateLoadCase(string name, string type = "static", string durationClass = "permanent") { LoadCaseType _type = FemDesign.GenericClasses.EnumParser.Parse <LoadCaseType>(type); LoadCaseDuration _durationClass = FemDesign.GenericClasses.EnumParser.Parse <LoadCaseDuration>(durationClass); LoadCase loadCase = new LoadCase(name, _type, _durationClass); return(loadCase); }
/// <summary> /// Internal constructor accessed by static methods. /// </summary> public PointLoad(Geometry.FdPoint3d point, Geometry.FdVector3d force, LoadCase loadCase, string comment, ForceLoadType type) { this.EntityCreated(); this.LoadCase = loadCase.Guid; this.Comment = comment; this.LoadType = type; this.Direction = force.Normalize(); this.Load = new LoadLocationValue(point, force.Length()); }
/// <summary> /// Check if LoadCase in LoadGroup. /// </summary> public bool LoadCaseInLoadGroup(LoadCase loadCase) { foreach (ModelLoadCaseInGroup elem in this.ModelLoadCase) { if (elem.Guid == loadCase.Guid) { return(true); } } return(false); }
/// <summary> /// Check if LoadCase in LoadCombination. /// </summary> private bool LoadCaseInLoadCombination(LoadCase loadCase) { foreach (ModelLoadCase elem in this.ModelLoadCase) { if (elem.Guid == loadCase.Guid) { return(true); } } return(false); }
/// <summary> /// Add LoadCase to LoadCombination. /// </summary> private void AddLoadCase(LoadCase loadCase, double gamma) { if (this.LoadCaseInLoadCombination(loadCase)) { // pass } else { this.ModelLoadCase.Add(new ModelLoadCase(loadCase.Guid, gamma)); } }
public List <LoadCase> LoadCase = new List <LoadCase>(); // List of complete load cases /// <summary> /// Add LoadCase to group. /// </summary> public void AddLoadCase(LoadCase loadCase) { if (LoadCaseInLoadGroup(loadCase)) { // pass } else { ModelLoadCase.Add(new ModelLoadCaseInGroup(loadCase.Guid, this)); LoadCase.Add(loadCase); } }
public LineLoad(Geometry.Edge edge, Geometry.FdVector3d constantForce, LoadCase loadCase, ForceLoadType loadType, string comment = "", bool constLoadDir = true, bool loadProjection = false) { this.EntityCreated(); this.LoadCase = loadCase.Guid; this.Comment = comment; this.ConstantLoadDirection = constLoadDir; this.LoadProjection = loadProjection; this.LoadType = loadType; this.Edge = edge; this.Normal = edge.CoordinateSystem.LocalZ; // Note that LineLoad normal and Edge normal are not necessarily the same. this.SetStartAndEndForces(constantForce, constantForce); }
protected override void SolveInstance(IGH_DataAccess DA) { // get data Point3d point = Point3d.Origin; Vector3d force = Vector3d.Zero; FemDesign.Loads.LoadCase loadCase = null; string comment = null; if (!DA.GetData(0, ref point)) { return; } if (!DA.GetData(1, ref force)) { return; } if (!DA.GetData(2, ref loadCase)) { return; } if (!DA.GetData(3, ref comment)) { // pass } if (force == null || loadCase == null) { return; } ; // Convert geometry FemDesign.Geometry.FdPoint3d fdPoint = point.FromRhino(); FemDesign.Geometry.FdVector3d _force = force.FromRhino(); PointLoad obj = new FemDesign.Loads.PointLoad(fdPoint, _force, loadCase, comment, ForceLoadType.Force); DA.SetData(0, obj); }
/// <summary> /// Create variable SurfaceLoad /// </summary> /// <param name="region"></param> /// <param name="direction"></param> /// <param name="loadLocationValue"></param> /// <param name="loadCase"></param> /// <param name="loadProjection">False: Intensity meant along action line (eg. dead load). True: Intensity meant perpendicular to direction of load (eg. snow load).</param> /// <param name="comment"></param> /// <returns></returns> public static SurfaceLoad Variable(Geometry.Region region, Geometry.FdVector3d direction, List <LoadLocationValue> loadLocationValue, LoadCase loadCase, bool loadProjection = false, string comment = "") { if (loadLocationValue.Count != 3) { throw new System.ArgumentException("loadLocationValue must contain 3 items"); } return(new SurfaceLoad(region, loadLocationValue, direction, loadCase, loadProjection, comment)); }
/// <summary> /// Create uniform SurfaceLoad /// </summary> /// <param name="region"></param> /// <param name="force"></param> /// <param name="loadCase"></param> /// <param name="loadProjection">False: Intensity meant along action line (eg. dead load). True: Intensity meant perpendicular to direction of load (eg. snow load).</param> /// <param name="comment"></param> /// <returns></returns> public static SurfaceLoad Uniform(Geometry.Region region, Geometry.FdVector3d force, LoadCase loadCase, bool loadProjection = false, string comment = "") { return(new SurfaceLoad(region, force, loadCase, loadProjection, comment)); }
/// <summary> /// Variable surface load /// </summary> public SurfaceLoad(Geometry.Region region, List <LoadLocationValue> loads, Geometry.FdVector3d loadDirection, LoadCase loadCase, bool loadProjection = false, string comment = "") { this.EntityCreated(); this.LoadCase = loadCase.Guid; this.Comment = comment; this.LoadProjection = loadProjection; this.LoadType = ForceLoadType.Force; this.Region = region; this.Direction = loadDirection; foreach (LoadLocationValue _load in loads) { this.Loads.Add(_load); } }
/// <summary> /// Uniform surface load /// </summary> /// <param name="region"></param> /// <param name="load"></param> /// <param name="loadCase"></param> /// <param name="loadProjection">False: Intensity meant along action line (eg. dead load). True: Intensity meant perpendicular to direction of load (eg. snow load).</param> /// <param name="comment"></param> public SurfaceLoad(Geometry.Region region, Geometry.FdVector3d load, LoadCase loadCase, bool loadProjection = false, string comment = "") : this(region, new List <LoadLocationValue> { new LoadLocationValue(region.Contours[0].Edges[0].Points[0], load.Length()) }, load.Normalize(), loadCase, loadProjection, comment) { }
/// <summary> /// Construct a uniform or variable line stress load /// </summary> /// <param name="edge">Underlying edge of line load. Line or Arc.</param> /// <param name="direction">Direction of load.</param> /// <param name="topBotLocVal">List of 2 top bottom location values</param> public LineStressLoad(Geometry.Edge edge, Geometry.FdVector3d direction, List <TopBotLocationValue> topBotLocVals, LoadCase loadCase, string comment) { this.EntityCreated(); this.Edge = edge; this.Direction = direction; this.TopBotLocVal = topBotLocVals; this.LoadCase = loadCase.Guid; this.Comment = comment; }
/// <summary> /// Find the corresponding LoadCase instance stored in the load group based on the guid of the modelLoadCaseInGroup instance /// </summary> /// <param name="modelLoadCaseInGroup">Model load case to find corresponding complete LoadCase instance of</param> /// <returns>The LoadCase that has the same guid</returns> public LoadCase GetCorrespondingCompleteLoadCase(ModelLoadCaseInGroup modelLoadCaseInGroup) { LoadCase correspodningLoadCase = LoadCase.Find(i => i.Guid == modelLoadCaseInGroup.Guid); return(correspodningLoadCase); }
public static SurfaceLoad Variable(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector direction, List <LoadLocationValue> loadLocationValue, LoadCase loadCase, string comment = "") { if (loadLocationValue.Count != 3) { throw new System.ArgumentException("loads must contain 3 items"); } Geometry.Region region = Geometry.Region.FromDynamo(surface); Geometry.FdVector3d loadDirection = Geometry.FdVector3d.FromDynamo(direction).Normalize(); SurfaceLoad surfaceLoad = SurfaceLoad.Variable(region, loadDirection, loadLocationValue, loadCase, false, comment); return(surfaceLoad); }
public static SurfaceLoad Uniform(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector force, LoadCase loadCase, string comment = "") { Geometry.Region region = Geometry.Region.FromDynamo(surface); Geometry.FdVector3d _force = Geometry.FdVector3d.FromDynamo(force); SurfaceLoad surfaceLoad = SurfaceLoad.Uniform(region, _force, loadCase, false, comment); return(surfaceLoad); }
public static LineLoad MomentUniform(Autodesk.DesignScript.Geometry.Curve curve, Autodesk.DesignScript.Geometry.Vector force, LoadCase loadCase, [DefaultArgument("true")] bool constLoadDir, string comment = "") { // convert geometry Geometry.Edge edge = Geometry.Edge.FromDynamoLineOrArc1(curve); Geometry.FdVector3d _startForce = Geometry.FdVector3d.FromDynamo(force); Geometry.FdVector3d _endForce = _startForce; // check zero vector if (_startForce.IsZero()) { throw new System.ArgumentException($"Force is zero."); } return(new LineLoad(edge, _startForce, _endForce, loadCase, ForceLoadType.Moment, comment, constLoadDir, loadProjection: false)); }
public static PointLoad Moment(Autodesk.DesignScript.Geometry.Point point, Autodesk.DesignScript.Geometry.Vector moment, LoadCase loadCase, string comment = "") { var p0 = Geometry.FdPoint3d.FromDynamo(point); var v0 = Geometry.FdVector3d.FromDynamo(moment); PointLoad pointLoad = new PointLoad(p0, v0, loadCase, comment, ForceLoadType.Moment); return(pointLoad); }
/// <summary> /// Construct surface temperature load by region, top value and bottom value. /// </summary> /// <param name="region">Region</param> /// <param name="direction">Direction of load</param> /// <param name="topVal">Top value, temperature in celsius</param> /// <param name="bottomVal">Bottom value, temperature in celsius</param> /// <param name="loadCase">LoadCase.</param> /// <param name="comment">Comment.</param> public SurfaceTemperatureLoad(Geometry.Region region, Geometry.FdVector3d direction, double topVal, double bottomVal, LoadCase loadCase, string comment) { this.EntityCreated(); this.Region = region; this.LocalZ = direction; this.TopBotLocVal = new List <TopBotLocationValue> { new TopBotLocationValue(region.CoordinateSystem.Origin, topVal, bottomVal) }; this.LoadCase = loadCase.Guid; this.Comment = comment; }
public static PressureLoad Define(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector direction, double z0, double q0, double qh, LoadCase loadCase, string comment = "") { // get fdGeometry Geometry.Region region = Geometry.Region.FromDynamo(surface); // normalize direction Geometry.FdVector3d _loadDirection = Geometry.FdVector3d.FromDynamo(direction).Normalize(); // create SurfaceLoad PressureLoad _pressureLoad = new PressureLoad(region, _loadDirection, z0, q0, qh, loadCase, comment, false, ForceLoadType.Force); return(_pressureLoad); }
/// <summary> /// Pressure load /// </summary> /// <param name="region"></param> /// <param name="loadDirection">Vector. Direction of force.</param> /// <param name="z0">Surface level of soil/water (on the global Z axis).</param> /// <param name="q0">Load intensity at the surface level.</param> /// <param name="qh">Increment of load intensity per meter (along the global Z axis).</param> /// <param name="loadCase">LoadCase.</param> /// <param name="comment">Comment.</param> /// <param name="loadProjection"></param> /// <param name="loadType"></param> public PressureLoad(Geometry.Region region, Geometry.FdVector3d loadDirection, double z0, double q0, double qh, LoadCase loadCase, string comment, bool loadProjection, ForceLoadType loadType) { // base this.EntityCreated(); this.LoadCase = loadCase.Guid; this.Comment = comment; this.LoadProjection = loadProjection; this.LoadType = loadType; this.Region = region; this.Direction = loadDirection; // specific this.Z0 = z0; this.Q0 = q0; this.Qh = qh; }
public static LineTemperatureLoad Define(Autodesk.DesignScript.Geometry.Curve curve, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,1)")] Autodesk.DesignScript.Geometry.Vector direction, List <TopBotLocationValue> topBottomLocationValues, LoadCase loadCase, string comments = "") { // convert geometry Geometry.Edge edge = Geometry.Edge.FromDynamoLineOrArc1(curve); Geometry.FdVector3d v = Geometry.FdVector3d.FromDynamo(direction); // return return(new LineTemperatureLoad(edge, v, topBottomLocationValues, loadCase, comments)); }
public static SurfaceTemperatureLoad Define(Autodesk.DesignScript.Geometry.Surface surface, Autodesk.DesignScript.Geometry.Vector direction, List <TopBotLocationValue> tempLocValue, LoadCase loadCase, string comment = "") { // convert geometry Geometry.Region region = Geometry.Region.FromDynamo(surface); Geometry.FdVector3d dir = Geometry.FdVector3d.FromDynamo(direction); // return return(new SurfaceTemperatureLoad(region, dir, tempLocValue, loadCase, comment)); }
/// <summary> /// Construct a surface temperature load by region and temperature location values (top/bottom) /// </summary> /// <param name="region">Region</param> /// <param name="direction">Direction of load</param> /// <param name="tempLocValue">List of top bottom location value. List should have 1 or 3 elements.></param> /// <param name="loadCase">LoadCase.</param> /// <param name="comment">Comment.</param> public SurfaceTemperatureLoad(Geometry.Region region, Geometry.FdVector3d direction, List <TopBotLocationValue> tempLocValue, LoadCase loadCase, string comment) { this.EntityCreated(); this.Region = region; this.LocalZ = direction; this.TopBotLocVal = tempLocValue; this.LoadCase = loadCase.Guid; this.Comment = comment; }
public static LineLoad Moment(Autodesk.DesignScript.Geometry.Curve curve, Autodesk.DesignScript.Geometry.Vector startForce, Autodesk.DesignScript.Geometry.Vector endForce, LoadCase loadCase, [DefaultArgument("true")] bool constLoadDir, string comment = "") { // convert geometry Geometry.Edge edge = Geometry.Edge.FromDynamoLineOrArc1(curve); Geometry.FdVector3d _startForce = Geometry.FdVector3d.FromDynamo(startForce); Geometry.FdVector3d _endForce = Geometry.FdVector3d.FromDynamo(endForce); return(new LineLoad(edge, _startForce, _endForce, loadCase, ForceLoadType.Moment, comment, constLoadDir, loadProjection: false)); }