public void ShearWallCalculatesPMMDiagram()
        {
            double f_c_prime                         = 6;
            double f_c_prime_psi                     = f_c_prime * 1000;
            RebarMaterialFactory factory             = new RebarMaterialFactory();
            string         RebarSpecificationId      = "A615Grade60";
            IRebarMaterial LongitudinalRebarMaterial = factory.GetMaterial(RebarSpecificationId);
            double         h_total                   = 20 * 12;
            double         t_w                       = 12;
            double         N_curtains                = 2;
            double         s                         = 12;
            double         c_edge                    = 0;

            BoundaryZone BoundaryZoneTop    = new BoundaryZone(3, 3, "No8", 6, 3, 3);
            BoundaryZone BoundaryZoneBottom = new BoundaryZone(3, 3, "No8", 6, 3, 3);
            string       WallRebarSizeId    = "No4";


            FlexuralCompressionFiberPosition p    = FlexuralCompressionFiberPosition.Top;
            ConcreteMaterial             Concrete = new ConcreteMaterial(f_c_prime_psi, ConcreteTypeByWeight.Normalweight, null);
            ConfinementReinforcementType ConfinementReinforcementType = KodestructAci.ConfinementReinforcementType.Ties;

            CrossSectionRectangularShape shape = new CrossSectionRectangularShape(Concrete, null, t_w, h_total);

            List <KodestructAci.RebarPoint> LongitudinalBars = GetLongitudinalBars(shape.SliceableShape as ISectionRectangular, h_total, t_w, WallRebarSizeId, N_curtains, s, c_edge,
                                                                                   BoundaryZoneTop, BoundaryZoneBottom, LongitudinalRebarMaterial);

            KodestructAci.IConcreteFlexuralMember fs = new KodestructAci14.ConcreteSectionFlexure(shape, LongitudinalBars, null, ConfinementReinforcementType);

            IConcreteSectionWithLongitudinalRebar Section = fs as IConcreteSectionWithLongitudinalRebar;
            ConcreteSectionCompression            column  = new ConcreteSectionCompression(Section, ConfinementReinforcementType, null);
            //Convert axial force to pounds
            List <PMPair> Pairs         = column.GetPMPairs(p);
            var           PairsAdjusted = Pairs.Select(pair => new PMPair(pair.P / 1000.0, pair.M / 1000.0 / 12.0));

            string Filename = Path.Combine(Path.GetTempPath(), "PMInteractionShearWall.csv");

            using (CsvFileWriter writer = new CsvFileWriter(Filename))
            {
                foreach (var pair in PairsAdjusted)
                {
                    CsvRow row = new CsvRow();
                    row.Add(pair.M.ToString());
                    row.Add(pair.P.ToString());
                    writer.WriteRow(row);
                }
            }
        }
        private List <KodestructAci.RebarPoint> GetLongitudinalBars(ISectionRectangular shape, double h_total, double t_w,
                                                                    string RebarSizeId, double N_curtains, double s, double c_edge,
                                                                    BoundaryZone BoundaryZoneTop, BoundaryZone BoundaryZoneBottom, IRebarMaterial LongitudinalRebarMaterial)
        {
            List <KodestructAci.RebarPoint> BzTopBars    = GetBoundaryZoneBars(BoundaryZoneTop, LongitudinalRebarMaterial, new Point2D(0.0, shape.H / 2.0 - BoundaryZoneTop.h / 2.0), true);
            List <KodestructAci.RebarPoint> BzBottomBars = GetBoundaryZoneBars(BoundaryZoneBottom, LongitudinalRebarMaterial, new Point2D(0.0, BoundaryZoneTop.h / 2.0 - shape.H / 2.0), false);

            List <KodestructAci.RebarPoint> retBars = null;

            if (N_curtains != 0)
            {
                List <KodestructAci.RebarPoint> WallBars = GetWallBars(h_total, t_w, RebarSizeId, N_curtains, s,
                                                                       BoundaryZoneTop.h, BoundaryZoneBottom.h, c_edge, LongitudinalRebarMaterial);
                retBars = BzTopBars.Concat(BzBottomBars).Concat(WallBars).ToList();
            }
            else
            {
                retBars = BzTopBars.Concat(BzBottomBars).ToList();
            }

            return(retBars);
        }
        private List <KodestructAci.RebarPoint> GetBoundaryZoneBars(BoundaryZone BoundaryZone, IRebarMaterial LongitudinalRebarMaterial, Point2D BzCentroid, bool IsTop)
        {
            Point2D topPoint;
            Point2D botPoint;

            if (IsTop == true)
            {
                topPoint = new Point2D(0, BzCentroid.Y + (BoundaryZone.h / 2.0 - BoundaryZone.c_cntrEdge));
                botPoint = new Point2D(0, BzCentroid.Y - (BoundaryZone.h / 2.0 - BoundaryZone.c_cntrInterior));
            }
            else
            {
                topPoint = new Point2D(0, BzCentroid.Y + (BoundaryZone.h / 2.0 - BoundaryZone.c_cntrInterior));
                botPoint = new Point2D(0, BzCentroid.Y - (BoundaryZone.h / 2.0 - BoundaryZone.c_cntrEdge));
            }



            RebarLine Line = new RebarLine(BoundaryZone.A_s,
                                           botPoint, topPoint, LongitudinalRebarMaterial, false, false, (int)BoundaryZone.N_Bar_Rows - 1);

            return(Line.RebarPoints);
        }
        private CrossSectionIShape GetIShape(IConcreteMaterial Material, double h_total, double t_w, BoundaryZone BoundaryZoneTop, BoundaryZone BoundaryZoneBottom)
        {
            double d      = h_total;
            double b_fTop = BoundaryZoneTop.b == 0 ? t_w : BoundaryZoneTop.b;
            double b_fBot = BoundaryZoneBottom.b == 0 ? t_w : BoundaryZoneBottom.b;
            double t_fTop = BoundaryZoneTop.h;
            double t_fBot = BoundaryZoneBottom.h;

            return(new CrossSectionIShape(Material, null, d, b_fTop, b_fBot, t_fTop, t_fBot, t_w));
        }