コード例 #1
0
        public static LevelDictionary <PointDrift> GetDesignBoundaryCornerDrifts(LevelDataDictionary <RigidAnalysis> analyses)
        {
            var drifts = new LevelDictionary <PointDrift>();

            List <BuildingLevelLateral2> sortedLevels =
                analyses.Select(l => l.Value.LateralLevel).OrderBy(l => l.Level.Elevation).ToList();

            for (var i = 0; i < sortedLevels.Count; i++)
            {
                BuildingLevel level = sortedLevels[i].Level;

                RigidAnalysis analysis = analyses[level];

                List <PointDrift> driftsAtLevel =
                    DisplacementsWithUnknownDrifts(level, analysis.Responses.NodalLoadCaseResults.Values.SelectMany(r => r));

                var storyHeight = sortedLevels[i].Height;

                if (i == 0)
                {
                    // Lowest level; compare to ground
                    driftsAtLevel.ForEach(d =>
                    {
                        d.Drift             = (Unitless)Result.Abs(d.Displacement / storyHeight);
                        d.CoordinateBelow   = d.Coordinate;
                        d.DisplacementBelow = new Length(0, LengthUnit.Inch);
                    });
                }
                else
                {
                    // Elevated level; compare to level below
                    List <PointDrift> driftsAtLevelBelow = drifts[sortedLevels[i - 1].Level];

                    driftsAtLevel.ForEach(d =>
                    {
                        PointDrift driftBelow = d.GetMatchingDriftAtLevelBelow(driftsAtLevelBelow);

                        d.Drift             = (Unitless)Result.Abs((d.Displacement - driftBelow.Displacement) / storyHeight);
                        d.CoordinateBelow   = driftBelow.Coordinate;
                        d.DisplacementBelow = driftBelow.Displacement;
                    });
                }

                drifts.Add(level, driftsAtLevel);
            }

            return(drifts);
        }
コード例 #2
0
        public static Table GenerateShearWallForceStiffnessTable(RigidAnalysis analysis)
        {
            var table = new Table("Rigid Analysis Wall Force Determination");

            table.AddColumn("level", ColumnDataType.Text);
            table.AddColumn("load_category", ColumnDataType.Text);
            table.AddColumn("load_case", ColumnDataType.Text);
            table.AddColumn("wall_panel", ColumnDataType.Text);
            table.AddColumn("R", ColumnDataType.Number, "R (k/in)", 1);
            table.AddColumn("d", ColumnDataType.Number, "d (in)", 1);
            table.AddColumn("Rd", ColumnDataType.Number, "$R d$ (k-ft/in)", 0);
            table.AddColumn("Rd2", ColumnDataType.Number, "$R d^2$ (k-ft^2/in)", 0);
            table.AddColumn("direct_force", ColumnDataType.Number, "Direct Force $F_v$ (lb)", 0);
            table.AddColumn("torsional_force", ColumnDataType.Number, "Torsional Force $F_t$ (lb)", 0);
            table.AddColumn("total_force", ColumnDataType.Number, "Total Force $F_v + F_t$ (lb)", 0);

            table.SetExpression("Rd", "R * d");
            table.SetExpression("Rd2", "R * d * d");
            table.SetExpression("total_force", "direct_force + torsional_force");

            table.SortByColumns("load_case", SortOrder.Ascending, "level", SortOrder.Descending, "wall_panel",
                                SortOrder.Ascending);

            foreach (AnalyticalWallLateral wall in analysis.Walls)
            {
                ShearWallPanelRigidAnalysisParameters stiffnessAtWall = analysis.WallStiffnesses[wall.UniqueId];
                ShearWallPanelResponseCollection      resultsAtWall   = analysis.Responses.WallLoadCaseResults[wall.UniqueId];

                foreach (ShearWallPanelResponse response in resultsAtWall)
                {
                    DataRow row = table.NewRow();

                    row["level"]           = wall.TopLevel.Name;
                    row["load_category"]   = response.LoadCase.LoadPatternType;
                    row["load_case"]       = response.LoadCase;
                    row["wall_panel"]      = wall.UniqueId;
                    row["R"]               = stiffnessAtWall.K.ConvertTo(ForcePerLengthUnit.KipPerInch);
                    row["d"]               = stiffnessAtWall.SignedOffsetFromCenterOfRigidity.ConvertTo(LengthUnit.Foot);
                    row["direct_force"]    = response.DirectShear.ConvertTo(ForceUnit.Pound);
                    row["torsional_force"] = response.TorsionalShear.ConvertTo(ForceUnit.Pound);

                    table.AddRow(row);
                }
            }

            return(table);
        }