protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Point3d point = Point3d.Origin;

            if (!DA.GetData(0, ref point))
            {
                return;
            }

            double topVal = 0;

            if (!DA.GetData(1, ref topVal))
            {
                return;
            }

            double bottomVal = 0;

            if (!DA.GetData(2, ref bottomVal))
            {
                return;
            }

            // convert geometry
            Geometry.FdPoint3d p = point.FromRhino();

            // create obj
            Loads.TopBotLocationValue obj = new Loads.TopBotLocationValue(p, topVal, bottomVal);

            // return
            DA.SetData(0, obj);
        }
 /// <summary>
 /// Internal constructor accessed by GH components and Dynamo nodes.
 /// </summary>
 public LoadLocationValue(Geometry.FdPoint3d loadPosition, double val)
 {
     this.X     = loadPosition.X;
     this.Y     = loadPosition.Y;
     this.Z     = loadPosition.Z;
     this.Value = val;
 }
Beispiel #3
0
 /// <summary>
 /// Construct Thickness object at point with value.
 /// </summary>
 public Thickness(Geometry.FdPoint3d point, double val)
 {
     this.X     = point.X;
     this.Y     = point.Y;
     this.Z     = point.Z;
     this.Value = val;
 }
Beispiel #4
0
        /// <summary>
        /// Create a default timber shell with panels using a continuous analytical model.
        /// </summary>
        /// <param name="region">Panel region.</param>
        /// <param name="timberPlateMaterial">Timber material. See <see cref="FemDesign.Materials.TimberPanelType"/>.</param>
        /// <param name="direction">Timber panel span direction.</param>
        /// <param name="externalEdgeConnection"></param>
        /// <param name="identifier">Name of shell.</param>
        /// <param name="eccentricity"></param>
        /// <param name="panelWidth"></param>
        /// <returns></returns>
        public static Panel DefaultTimberContinuous(Geometry.Region region, Materials.TimberPanelType timberPlateMaterial, Geometry.FdVector3d direction, EdgeConnection externalEdgeConnection = null, string identifier = "TP", ShellEccentricity eccentricity = null, double panelWidth = 1.5)
        {
            if (externalEdgeConnection == null)
            {
                externalEdgeConnection = EdgeConnection.GetDefault();
            }

            if (eccentricity == null)
            {
                eccentricity = ShellEccentricity.GetDefault();
            }

            Geometry.FdPoint3d anchorPoint    = region.Contours[0].Edges[0].Points[0];
            InternalPanel      internalPanel  = new InternalPanel(region);
            InternalPanels     internalPanels = new InternalPanels(internalPanel);
            PanelType          type           = PanelType.Timber;
            string             panelName      = "A";
            double             gap            = 0.01;
            double             orthotropy     = 1;
            bool externalMovingLocal          = externalEdgeConnection.MovingLocal;

            var panel = new Panel(region, anchorPoint, internalPanels, timberPlateMaterial, externalEdgeConnection, type, identifier, panelName, gap, orthotropy, eccentricity, externalMovingLocal, panelWidth);

            panel.LocalX = direction; // Set timber panel span direction

            return(panel);
        }
        public static TopBotLocationValue Define(Autodesk.DesignScript.Geometry.Point point, double topVal, double bottomVal)
        {
            // convert geometry
            Geometry.FdPoint3d p = Geometry.FdPoint3d.FromDynamo(point);

            return(new TopBotLocationValue(p, topVal, bottomVal));
        }
Beispiel #6
0
        /// <summary>
        /// Construct timber panel with "Continuous" analytical model.
        /// </summary>
        /// <param name="region">Region of shell containing panels.</param>
        /// <param name="anchorPoint"></param>
        /// <param name="internalPanels"></param>
        /// <param name="externalEdgeConnection">Default value for shell border EdgeConnections. Can be overwritten by EdgeConnection for each specific edge in Region.</param>
        /// <param name="timberApplicationData"></param>
        /// <param name="type">Type of panel.</param>
        /// <param name="identifier">Name of shell.</param>
        /// <param name="panelName">Name of panel.</param>
        /// <param name="gap">Gap between panels.</param>
        /// <param name="orthotropy">Orthotropy.</param>
        /// <param name="ecc">ShellEccentricity.</param>
        /// <param name="externalMovingLocal">EdgeConnection LCS changes along edge?</param>
        internal Panel(Geometry.Region region, Geometry.FdPoint3d anchorPoint, InternalPanels internalPanels, Materials.TimberPanelType timberApplicationData, EdgeConnection externalEdgeConnection, PanelType type, string identifier, string panelName, double gap, double orthotropy, ShellEccentricity ecc, bool externalMovingLocal, double panelWidth)
        {
            this.EntityCreated();

            // elements
            this.Region           = region;
            this.CoordinateSystem = region.CoordinateSystem;
            this.AnchorPoint      = anchorPoint;
            this.InternalPanels   = internalPanels;
            this.TimberPanelData  = timberApplicationData;

            // set external rigidity
            this.SetExternalEdgeConnections(externalEdgeConnection);

            // set internal rigidity - not relevant for a panel with continuous analytical model

            // attributes
            this.Type                    = type;
            this.Identifier              = identifier;
            this.PanelName               = panelName;
            this.Gap                     = gap;
            this.Alignment               = ecc.Alignment;
            this.AlignOffset             = ecc.Eccentricity;
            this.EccentricityCalculation = ecc.EccentricityCalculation;
            this.EccentricityByCracking  = ecc.EccentricityByCracking;
            this.ExternalMovingLocal     = externalMovingLocal;
            this.PanelWidth              = panelWidth;
        }
Beispiel #7
0
        /// <summary>
        /// Construct standard panel with "Continuous" analytical model.
        /// </summary>
        /// <param name="region">Region of shell containing panels.</param>
        /// <param name="localX">Direction of panels.</param>
        /// <param name="anchorPoint"></param>
        /// <param name="externalRigidity">Default value for shell border EdgeConnections. Can be overwritten by EdgeConnection for each specific edge in Region.</param>
        /// <param name="type">Type of panel.</param>
        /// <param name="complexMaterial">Guid reference to material.</param>
        /// <param name="complexSection">Guid reference to complex section.</param>
        /// <param name="identifier">Name of shell.</param>
        /// <param name="panelName">Name of panel.</param>
        /// <param name="gap">Gap between panels.</param>
        /// <param name="orthotropy">Orthotropy.</param>
        /// <param name="ecc">ShellEccentricity.</param>
        /// <param name="externalMovingLocal">EdgeConnection LCS changes along edge?</param>
        internal Panel(Geometry.Region region, Geometry.FdPoint3d anchorPoint, InternalPanels internalPanels, EdgeConnection externalEdgeConnection, PanelType type, Materials.Material material, Sections.Section section, string identifier, string panelName, double gap, double orthotropy, ShellEccentricity ecc, bool externalMovingLocal)
        {
            this.EntityCreated();

            // elements
            this.Region           = region;
            this.CoordinateSystem = region.CoordinateSystem;
            this.AnchorPoint      = anchorPoint;
            this.InternalPanels   = internalPanels;
            this.ExternalRigidity = externalEdgeConnection.Rigidity;

            // set edge connections
            this.SetExternalEdgeConnections(externalEdgeConnection);

            // attributes
            this.Type                    = type;
            this.Material                = material; // note that material and section are not added directly to complexMaterial and complexSection fields.
            this.Section                 = section;
            this.Identifier              = identifier;
            this.PanelName               = panelName;
            this.Gap                     = gap;
            this.Orthotropy              = orthotropy;
            this.Alignment               = ecc.Alignment;
            this.AlignOffset             = ecc.Eccentricity;
            this.EccentricityCalculation = ecc.EccentricityCalculation;
            this.EccentricityByCracking  = ecc.EccentricityByCracking;
            this.ExternalMovingLocal     = externalMovingLocal;
        }
Beispiel #8
0
        private static Slab CreateDummySlab()
        {
            string input    = "Shells/EdgeConnection-model.struxml";
            var    template = Model.DeserializeFromFilePath(input);

            var p1 = new Geometry.FdPoint3d(0, 0, 0);
            var p2 = new Geometry.FdPoint3d(1, 0, 0);
            var p3 = new Geometry.FdPoint3d(1, 1, 0);
            var p4 = new Geometry.FdPoint3d(0, 1, 0);

            var edges = new List <Geometry.Edge> {
                new Geometry.Edge(p1, p2, Geometry.FdCoordinateSystem.Global()),
                new Geometry.Edge(p2, p3, Geometry.FdCoordinateSystem.Global()),
                new Geometry.Edge(p3, p4, Geometry.FdCoordinateSystem.Global()),
                new Geometry.Edge(p4, p1, Geometry.FdCoordinateSystem.Global())
            };
            var contour = new Geometry.Contour(edges);
            var region  = new Geometry.Region(new List <Geometry.Contour> {
                contour
            }, Geometry.FdCoordinateSystem.Global());
            var slab = Slab.Plate("S", template.Materials.Material[0], region, EdgeConnection.GetDefault(), ShellEccentricity.GetDefault(), ShellOrthotropy.GetDefault(), new List <Thickness> {
                new Thickness(Geometry.FdPoint3d.Origin(), 0.2)
            });

            return(slab);
        }
Beispiel #9
0
 /// <summary>
 /// Construct Edge of circle type.
 /// </summary>
 public Edge(double _radius, Geometry.FdPoint3d _centerPoint, Geometry.FdCoordinateSystem _coordinateSystem)
 {
     this.Type   = "circle";
     this.Radius = _radius;
     this.Points.Add(_centerPoint);
     this.Normal           = _coordinateSystem.LocalZ;
     this.CoordinateSystem = _coordinateSystem;
 }
Beispiel #10
0
 /// <summary>
 /// Construct Edge of line type by points and coordinate system.
 /// </summary>
 public Edge(Geometry.FdPoint3d _startPoint, Geometry.FdPoint3d _endPoint, Geometry.FdCoordinateSystem _coordinateSystem)
 {
     this.Type = "line";
     this.Points.Add(_startPoint);
     this.Points.Add(_endPoint);
     this.Normal           = _coordinateSystem.LocalY;
     this.CoordinateSystem = _coordinateSystem;
 }
 /// <summary>
 /// Construct top bottom location value by point, top value and bottom value.
 /// </summary>
 public TopBotLocationValue(Geometry.FdPoint3d point, double topVal, double bottomVal)
 {
     this.X         = point.X;
     this.Y         = point.Y;
     this.Z         = point.Z;
     this.TopVal    = topVal;
     this.BottomVal = bottomVal;
 }
Beispiel #12
0
 /// <summary>
 /// Construct Edge of arc2 type.
 /// </summary>
 public Edge(Geometry.FdPoint3d _startPoint, Geometry.FdPoint3d _midPoint, Geometry.FdPoint3d _endPoint, Geometry.FdCoordinateSystem _coordinateSystem)
 {
     this.Type = "arc";
     this.Points.Add(_startPoint);
     this.Points.Add(_midPoint);
     this.Points.Add(_endPoint);
     this.CoordinateSystem = _coordinateSystem;
 }
Beispiel #13
0
 /// <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());
 }
Beispiel #14
0
 /// <summary>
 /// Internal constructor.
 /// </summary>
 /// <param name="origo">Origo of storey.</param>
 /// <param name="direction">Direction of storey x'-axis. Optional, default value isGCS x-axis.</param>
 /// <param name="dimensionX">Dimension in x'-direction.</param>
 /// <param name="dimensionY">Dimension in y'-direction.</param>
 /// <param name="name">Name of storey.</param>
 public Storey(Geometry.FdPoint3d origo, Geometry.FdVector3d direction, double dimensionX, double dimensionY, string name)
 {
     this.EntityCreated();
     this.Origo      = origo;
     this.Direction  = direction;
     this.DimensionX = dimensionX;
     this.DimensionY = dimensionY;
     this.Name       = name;
 }
Beispiel #15
0
        public static Axis Define(Autodesk.DesignScript.Geometry.Line line, [DefaultArgument("")] string prefix, int id, [DefaultArgument("false")] bool idIsLetter)
        {
            // convert geometry
            Geometry.FdPoint3d p0 = Geometry.FdPoint3d.FromDynamo(line.StartPoint);
            Geometry.FdPoint3d p1 = Geometry.FdPoint3d.FromDynamo(line.EndPoint);

            //
            return(new Axis(p0, p1, prefix, id, idIsLetter));
        }
Beispiel #16
0
        public static Storey Define(string name, Autodesk.DesignScript.Geometry.Point origo, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.XAxis()")] Autodesk.DesignScript.Geometry.Vector direction, double dimensionX = 50, double dimensionY = 30)
        {
            // convert geometry
            Geometry.FdPoint3d  p = Geometry.FdPoint3d.FromDynamo(origo);
            Geometry.FdVector3d v = Geometry.FdVector3d.FromDynamo(direction);

            // return
            return(new Storey(p, v, dimensionX, dimensionY, name));
        }
Beispiel #17
0
 /// <summary>
 /// Internal constructor.
 /// </summary>
 /// <param name="startPoint">Start point of axis.</param>
 /// <param name="endPoint">End point of axis.</param>
 /// <param name="prefix">Prefix of axis identifier.</param>
 /// <param name="id">Number of axis identifier.</param>
 /// <param name="idIsLetter">Is identifier numbering a letter?</param>
 public Axis(Geometry.FdPoint3d startPoint, Geometry.FdPoint3d endPoint, string prefix, int id, bool idIsLetter)
 {
     this.EntityCreated();
     this.StartPoint = startPoint;
     this.EndPoint   = endPoint;
     this.Prefix     = prefix;
     this.Id         = id;
     this.IdIsLetter = idIsLetter;
 }
Beispiel #18
0
 /// <summary>
 /// Construct Edge of arc1 type.
 /// </summary>
 public Edge(double radius, double startAngle, double endAngle, Geometry.FdPoint3d centerPoint, Geometry.FdVector3d xAxis, Geometry.FdCoordinateSystem coordinateSystem)
 {
     this.Type       = "arc";
     this.Radius     = radius;
     this.StartAngle = startAngle;
     this.EndAngle   = endAngle;
     this.Points.Add(centerPoint);
     this.Normal           = coordinateSystem.LocalZ;
     this.XAxis            = xAxis;
     this.CoordinateSystem = coordinateSystem;
 }
Beispiel #19
0
        /// <summary>
        /// Create a default concrete shell with panels using a continuous analytical model.
        /// </summary>
        /// <param name="region">Panel region.</param>
        /// <param name="externalEdgeConnection"></param>
        /// <param name="material"></param>
        /// <param name="section"></param>
        /// <param name="identifier">Name of shell.</param>
        /// <param name="orthotropy"></param>
        /// <param name="ecc"></param>
        /// <returns></returns>
        public static Panel DefaultContreteContinuous(Geometry.Region region, EdgeConnection externalEdgeConnection, Materials.Material material, Sections.Section section, string identifier, double orthotropy, ShellEccentricity ecc)
        {
            Geometry.FdPoint3d anchorPoint    = region.Contours[0].Edges[0].Points[0];
            InternalPanel      internalPanel  = new InternalPanel(region);
            InternalPanels     internalPanels = new InternalPanels(internalPanel);
            PanelType          type           = PanelType.Concrete;
            string             panelName      = "A";
            double             gap            = 0.003;
            bool externalMovingLocal          = externalEdgeConnection.MovingLocal;

            return(new Panel(region, anchorPoint, internalPanels, externalEdgeConnection, type, material, section, identifier, panelName, gap, orthotropy, ecc, externalMovingLocal));
        }
        public static ConnectedPoints Define(Autodesk.DesignScript.Geometry.Point firstPoint, Autodesk.DesignScript.Geometry.Point secondPoint, Releases.Motions motions, Releases.Rotations rotations, System.Guid[] references, string identifier)
        {
            // convert geometry
            Geometry.FdPoint3d p1 = Geometry.FdPoint3d.FromDynamo(firstPoint);
            Geometry.FdPoint3d p2 = Geometry.FdPoint3d.FromDynamo(secondPoint);

            // rigidity
            Releases.RigidityDataType2 rigidity = new Releases.RigidityDataType2(motions, rotations);

            // references
            GuidListType[] refs = new GuidListType[references.Length];
            for (int idx = 0; idx < refs.Length; idx++)
            {
                refs[idx] = new GuidListType(references[idx]);
            }

            return(new ConnectedPoints(p1, p2, rigidity, refs, identifier));
        }
Beispiel #21
0
        private void Initialize(Geometry.FdPoint3d start, Geometry.FdPoint3d end, Guid baseObject, PtcShapeType shape, PtcLosses losses, PtcManufacturingType manufacturing, PtcStrandLibType strand, JackingSide jackingSide, double jackingStress, int numberOfStrands, string identifier)
        {
            StartPoint = start;
            EndPoint   = end;

            BaseObject     = baseObject;
            StrandType     = strand;
            StrandTypeGuid = strand.Guid;
            Name           = $"{identifier}.{++instances}";

            Losses          = losses;
            NumberOfStrands = numberOfStrands;
            JackingSide     = jackingSide;
            JackingStress   = jackingStress;
            ShapeBasePoints = shape;
            Manufacturing   = manufacturing;

            EntityCreated();
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Point3d point = Point3d.Origin;

            Releases.Motions                motions               = null;
            Releases.Rotations              rotations             = null;
            Releases.MotionsPlasticLimits   motionsPlasticLimit   = null;
            Releases.RotationsPlasticLimits rotationsPlasticLimit = null;
            string identifier = "S";

            if (!DA.GetData(0, ref point))
            {
                return;
            }
            if (!DA.GetData(1, ref motions))
            {
                return;
            }
            if (!DA.GetData(2, ref rotations))
            {
                return;
            }
            DA.GetData(3, ref motionsPlasticLimit);
            DA.GetData(4, ref rotationsPlasticLimit);
            DA.GetData(5, ref identifier);
            if (point == null || motions == null || rotations == null || identifier == null)
            {
                return;
            }

            // Convert geometry
            Geometry.FdPoint3d fdPoint = point.FromRhino();

            var obj = new Supports.PointSupport(fdPoint, motions, motionsPlasticLimit, rotations, rotationsPlasticLimit, identifier);

            DA.SetData(0, obj);
        }
Beispiel #23
0
        static void Main()
        {
            // EXAMPLE 9: READ RESULTS
            // This example will show you how to model a simple supported beam,
            // and read some of the results.

            // This example was last updated 2022-07-01, using the ver. 21.2.0 FEM-Design API.

            #region DEFINE GEOMETRY
            // Define geometry
            var p1  = new Geometry.FdPoint3d(2.0, 2.0, 0);
            var p2  = new Geometry.FdPoint3d(10, 2.0, 0);
            var mid = p1 + (p2 - p1) * 0.5;


            // Create elements
            var edge = new Geometry.Edge(p1, p2, Geometry.FdVector3d.UnitZ());
            Materials.MaterialDatabase materialsDB = Materials.MaterialDatabase.DeserializeStruxml("materials.struxml");
            Sections.SectionDatabase   sectionsDB  = Sections.SectionDatabase.DeserializeStruxml("sections.struxml");

            var material = materialsDB.MaterialByName("C35/45");
            var section  = sectionsDB.SectionByName("Concrete sections, Rectangle, 300x900");

            var bar = new Bars.Bar(
                edge,
                Bars.BarType.Beam,
                material,
                sections: new Sections.Section[] { section },
                connectivities: new Bars.Connectivity[] { Bars.Connectivity.GetRigid() },
                eccentricities: new Bars.Eccentricity[] { Bars.Eccentricity.GetDefault() },
                identifier: "B");
            bar.BarPart.LocalY = Geometry.FdVector3d.UnitY();
            var elements = new List <GenericClasses.IStructureElement>()
            {
                bar
            };
            #endregion

            #region DEFINE SUPPORTS
            // Create supports
            var s1 = new Supports.PointSupport(
                point: p1,
                motions: Releases.Motions.RigidPoint(),
                rotations: Releases.Rotations.Free()
                );

            var s2 = new Supports.PointSupport(
                point: p2,
                motions: new Releases.Motions(yNeg: 1e10, yPos: 1e10, zNeg: 1e10, zPos: 1e10),
                rotations: Releases.Rotations.Free()
                );
            var supports = new List <GenericClasses.ISupportElement>()
            {
                s1, s2
            };
            #endregion

            #region DEFINE LOAD CASES/COMBINATIONS
            // Create load cases
            var deadload  = new Loads.LoadCase("Deadload", Loads.LoadCaseType.DeadLoad, Loads.LoadCaseDuration.Permanent);
            var liveload  = new Loads.LoadCase("Liveload", Loads.LoadCaseType.Static, Loads.LoadCaseDuration.Permanent);
            var loadcases = new List <Loads.LoadCase>()
            {
                deadload, liveload
            };


            // Create load combinations
            var slsFactors = new List <double>()
            {
                1.0, 1.0
            };
            var SLS        = new Loads.LoadCombination("SLS", Loads.LoadCombType.ServiceabilityCharacteristic, loadcases, slsFactors);
            var ulsFactors = new List <double>()
            {
                1.35, 1.5
            };
            var ULS = new Loads.LoadCombination("ULS", Loads.LoadCombType.UltimateOrdinary, loadcases, ulsFactors);
            var loadCombinations = new List <Loads.LoadCombination>()
            {
                SLS, ULS
            };


            // Create loads
            var pointForce  = new Loads.PointLoad(mid, new Geometry.FdVector3d(0.0, 0.0, -5.0), liveload, null, Loads.ForceLoadType.Force);
            var pointMoment = new Loads.PointLoad(p2, new Geometry.FdVector3d(0.0, 5.0, 0.0), liveload, null, Loads.ForceLoadType.Moment);

            var lineLoadStart = new Geometry.FdVector3d(0.0, 0.0, -2.0);
            var lineLoadEnd   = new Geometry.FdVector3d(0.0, 0.0, -4.0);
            var lineLoad      = new Loads.LineLoad(edge, lineLoadStart, lineLoadEnd, liveload, Loads.ForceLoadType.Force, "", constLoadDir: true, loadProjection: true);

            var loads = new List <GenericClasses.ILoadElement>()
            {
                pointForce,
                pointMoment,
                lineLoad
            };
            #endregion

            #region ASSEMBLE
            // Add to model
            Model model = new Model(Country.S);
            model.AddElements(elements);
            model.AddSupports(supports);
            model.AddLoadCases(loadcases);
            model.AddLoadCombinations(loadCombinations);
            model.AddLoads(loads);
            #endregion

            #region SETTINGS

            // define the file name
            string fileName = "SimpleBeam.struxml";
            fileName = Path.GetFullPath(fileName);

            // Define the Units
            // it is an optional operation and it can be omitted
            // Default Units can be seen looking at FemDesign.Results.UnitResults.Default()

            var units = new FemDesign.Results.UnitResults(Results.Length.m, Results.Angle.deg, Results.SectionalData.mm, Results.Force.daN, Results.Mass.kg, Results.Displacement.cm, Results.Stress.MPa);

            // Select the results to extract
            var resultTypes = new List <Results.ResultType>
            {
                Results.ResultType.PointSupportReaction,
                Results.ResultType.NodalDisplacement
            };

            var bscPathsFromResultTypes = Calculate.Bsc.BscPathFromResultTypes(resultTypes, fileName, units);
            #endregion

            #region ANALYSIS
            // Running the analysis
            FemDesign.Calculate.Analysis analysisSettings = new FemDesign.Calculate.Analysis(null, null, null, null, calcCase: true, false, false, calcComb: true, false, false, false, false, false, false, false, false, false);

            var fdScript = FemDesign.Calculate.FdScript.Analysis(fileName, analysisSettings, bscPathsFromResultTypes, null, true);


            var app = new FemDesign.Calculate.Application();
            app.RunFdScript(fdScript, false, true);
            model.SerializeModel(fileName);

            // Read model and results
            model = Model.DeserializeFromFilePath(fdScript.StruxmlPath);
            #endregion

            #region EXTRACT RESULTS

            IEnumerable <Results.IResult> results = Enumerable.Empty <Results.IResult>();

            foreach (var cmd in fdScript.CmdListGen)
            {
                string path     = cmd.OutFile;
                var    _results = Results.ResultsReader.Parse(path);
                results = results.Concat(_results);
            }
            #endregion

            #region DO SOMETHING WITH RESULTS
            // Display Results on Screen
            // The results are grouped by their type
            var resultGroups = results.GroupBy(t => t.GetType()).ToList();
            foreach (var resultGroup in resultGroups)
            {
                Console.WriteLine(resultGroup.Key.Name);
                Console.WriteLine();
                foreach (var result in resultGroup)
                {
                    Console.WriteLine(result);
                }
                Console.WriteLine();
                Console.WriteLine();
            }


            // Select a specific result
            Console.WriteLine("Vertical Reaction Forces");
            var zReactions = results.Where(t => t.GetType() == typeof(Results.PointSupportReaction)).Cast <Results.PointSupportReaction>();
            foreach (var zReaction in zReactions)
            {
                Console.WriteLine($"Node {zReaction.Id}: {zReaction.Fz} {units.Force}");
            }
            #endregion

            // ENDING THE PROGRAM
            Console.WriteLine("\nPress any key to close console.");
            Console.ReadKey();
        }
Beispiel #24
0
        static void Main()
        {
            // PRACTICAL EXAMPLE: CREATE POST-TENSIONED CABLES
            // This example will show you how to add post-tensioned cables to your concrete beam.

            // This example was last updated 2022-05-03, using the ver. 21.1.0 FEM-Design API.


            // DEFINE GEOMETRY
            var p1   = new Geometry.FdPoint3d(0.0, 2.0, 0);
            var p2   = new Geometry.FdPoint3d(10, 2.0, 0);
            var edge = new Geometry.Edge(p1, p2, Geometry.FdVector3d.UnitY());

            // CREATE BEAM
            Materials.MaterialDatabase materialsDB = Materials.MaterialDatabase.DeserializeStruxml("materials.struxml");
            Sections.SectionDatabase   sectionsDB  = Sections.SectionDatabase.DeserializeStruxml("sections.struxml");

            var material = materialsDB.MaterialByName("C35/45");
            var section  = sectionsDB.SectionByName("Concrete sections, Rectangle, 300x900");

            var bar = new Bars.Bar(
                edge,
                Bars.BarType.Beam,
                material,
                sections: new Sections.Section[] { section },
                connectivities: new Bars.Connectivity[] { Bars.Connectivity.GetRigid() },
                eccentricities: new Bars.Eccentricity[] { Bars.Eccentricity.GetDefault() },
                identifier: "B");


            // CREATE POST-TENSIONED CABLE
            var shape = new Reinforcement.PtcShapeType(
                start: new Reinforcement.PtcShapeStart(0.0, 0.0),
                intermediates: new List <Reinforcement.PtcShapeInner>()
            {
                new Reinforcement.PtcShapeInner(0.4, -0.20, 0.0, 0.1),
                new Reinforcement.PtcShapeInner(0.6, -0.20, 0.0),
            },
                end: new Reinforcement.PtcShapeEnd(0.0, 0.0, 0.9)
                );

            var losses = new Reinforcement.PtcLosses(
                curvatureCoefficient: 0.05,
                wobbleCoefficient: 0.007,
                anchorageSetSlip: 0.0,
                elasticShortening: 0.0,
                creepStress: 0.0,
                shrinkageStress: 0.0,
                relaxationStress: 0.0);

            var manufacturing = new Reinforcement.PtcManufacturingType(
                positions: new List <double>()
            {
                0.3, 0.7
            },
                shiftX: 0.0,
                shiftZ: 0.1);

            var strandData = new Reinforcement.PtcStrandLibType(
                name: "Custom ptc material",
                f_pk: 1860.0,
                a_p: 150.0,
                e_p: 195000.0,
                rho: 7.810,
                relaxationClass: 2,
                rho_1000: 0.1);

            var ptc = new Reinforcement.Ptc(
                bar,
                shape,
                losses,
                manufacturing,
                strandData,
                jackingSide: Reinforcement.JackingSide.Start,
                jackingStress: 1000.0,
                numberOfStrands: 3,
                identifier: "PTC");

            var elements = new List <GenericClasses.IStructureElement>()
            {
                bar,
                ptc
            };


            // CREATE AND OPEN MODEL
            Model  model = new Model(Country.S, elements);
            string path  = "output/post_tensioned_cable.struxml";

            if (!Directory.Exists("output"))
            {
                Directory.CreateDirectory("output");
            }
            model.SerializeModel(path);

            var app = new Calculate.Application();

            app.OpenStruxml(Path.GetFullPath(path), false);
        }
Beispiel #25
0
        static void Main()
        {
            // EXAMPLE 1: CREATING A SIMPLE BEAM
            // This example will show you how to model a simple supported beam,
            // and how to save it for export to FEM-Design.Before running,
            // make sure you have a window with FEM-Design open.

            // This example was last updated 2022-04-27, using the ver. 21.1.0 FEM-Design API.


            // Define geometry
            var p1  = new Geometry.FdPoint3d(2.0, 2.0, 0);
            var p2  = new Geometry.FdPoint3d(10, 2.0, 0);
            var mid = p1 + (p2 - p1) * 0.5;

            // Create elements
            var edge = new Geometry.Edge(p1, p2, Geometry.FdVector3d.UnitZ());

            Materials.MaterialDatabase materialsDB = Materials.MaterialDatabase.DeserializeStruxml("materials.struxml");
            Sections.SectionDatabase   sectionsDB  = Sections.SectionDatabase.DeserializeStruxml("sections.struxml");

            var material = materialsDB.MaterialByName("C35/45");
            var section  = sectionsDB.SectionByName("Concrete sections, Rectangle, 300x900");

            var bar = new Bars.Bar(
                edge,
                Bars.BarType.Beam,
                material,
                sections: new Sections.Section[] { section },
                connectivities: new Bars.Connectivity[] { Bars.Connectivity.GetRigid() },
                eccentricities: new Bars.Eccentricity[] { Bars.Eccentricity.GetDefault() },
                identifier: "B");

            bar.BarPart.LocalY = Geometry.FdVector3d.UnitY();
            var elements = new List <GenericClasses.IStructureElement>()
            {
                bar
            };


            // Create supports
            var s1 = new Supports.PointSupport(
                point: p1,
                motions: Releases.Motions.RigidPoint(),
                rotations: Releases.Rotations.Free()
                );

            var s2 = new Supports.PointSupport(
                point: p2,
                motions: new Releases.Motions(yNeg: 1e10, yPos: 1e10, zNeg: 1e10, zPos: 1e10),
                rotations: Releases.Rotations.Free()
                );
            var supports = new List <GenericClasses.ISupportElement>()
            {
                s1, s2
            };


            // Create load cases
            var deadload  = new Loads.LoadCase("Deadload", Loads.LoadCaseType.DeadLoad, Loads.LoadCaseDuration.Permanent);
            var liveload  = new Loads.LoadCase("Liveload", Loads.LoadCaseType.Static, Loads.LoadCaseDuration.Permanent);
            var loadcases = new List <Loads.LoadCase>()
            {
                deadload, liveload
            };


            // Create load combinations
            var slsFactors = new List <double>()
            {
                1.0, 1.0
            };
            var SLS        = new Loads.LoadCombination("SLS", Loads.LoadCombType.ServiceabilityCharacteristic, loadcases, slsFactors);
            var ulsFactors = new List <double>()
            {
                1.35, 1.5
            };
            var ULS = new Loads.LoadCombination("ULS", Loads.LoadCombType.UltimateOrdinary, loadcases, ulsFactors);
            var loadCombinations = new List <Loads.LoadCombination>()
            {
                SLS, ULS
            };


            // Create loads
            var pointForce  = new Loads.PointLoad(mid, new Geometry.FdVector3d(0.0, 0.0, -5.0), liveload, null, Loads.ForceLoadType.Force);
            var pointMoment = new Loads.PointLoad(p2, new Geometry.FdVector3d(0.0, 5.0, 0.0), liveload, null, Loads.ForceLoadType.Moment);

            var lineLoadStart = new Geometry.FdVector3d(0.0, 0.0, -2.0);
            var lineLoadEnd   = new Geometry.FdVector3d(0.0, 0.0, -4.0);
            var lineLoad      = new Loads.LineLoad(edge, lineLoadStart, lineLoadEnd, liveload, Loads.ForceLoadType.Force, "", constLoadDir: true, loadProjection: true);

            var loads = new List <GenericClasses.ILoadElement>()
            {
                pointForce,
                pointMoment,
                lineLoad
            };


            // Add to model
            Model model = new Model(Country.S);

            model.AddElements(elements);
            model.AddSupports(supports);
            model.AddLoadCases(loadcases);
            model.AddLoadCombinations(loadCombinations);
            model.AddLoads(loads);


            // Save model then open in FEM-Design
            string path = System.IO.Path.GetFullPath("simple_model.struxml");

            model.SerializeModel(path);

            var app = new Calculate.Application();

            app.OpenStruxml(path, true);
        }