Exemplo n.º 1
0
        public void AnchorageLengthTest_CalculateWithMultipleCoefficients_Success()
        {
            var reinforcementPosition = AnchoringHelper.CreateReinforcementPosition();
            var reinforcement         = new Reinforcement(10, 500, false);

            var barFormCoefficient                 = new BarFormCoefficient(reinforcementPosition, reinforcement);
            var coverCoefficient                   = new CoverCoefficient(reinforcementPosition, reinforcement);
            var transversePressureCoefficient      = new TransversePressureCoefficient(reinforcementPosition, 5);
            var transverseReinforcementCoefficient =
                new TransverseReinforcementCoefficient(reinforcementPosition, reinforcement, TypeEnum.Beam, 5);
            var weldedTransverseBarCoefficient = new WeldedTransverseBarCoefficient();

            var coefficients = new List <ICoefficient>();

            coefficients.Add(barFormCoefficient);
            coefficients.Add(coverCoefficient);
            coefficients.Add(transversePressureCoefficient);
            coefficients.Add(transverseReinforcementCoefficient);
            coefficients.Add(weldedTransverseBarCoefficient);

            var anchorageLength = new AnchorageLength(reinforcement, reinforcementPosition,
                                                      ConcreteClassEnum.C25_30, TypeEnum.Beam, BondConditionEnum.Good, coefficients);

            anchorageLength.CalculateAnchorageLengths();

            Assert.AreEqual(375.738, Math.Round(anchorageLength.BasicRequiredAnchorageLength, 3),
                            "BasicRequiredAnchorageLength not calculated properly.");
            Assert.AreEqual(112.721, Math.Round(anchorageLength.MinimumAnchorageLength, 3),
                            "MinimumAnchorageLength not calculated properly.");
            Assert.AreEqual(128.878, Math.Round(anchorageLength.DesignAnchorageLength, 3),
                            "DesignAnchorageLength not calculated properly.");
        }
Exemplo n.º 2
0
        // GET: Reinforcement
        public ActionResult ReinforcementAnchoring()
        {
            Reinforcement         reinforcement         = null;
            ReinforcementPosition reinforcementPosition = null;
            //ConcreteClass concreteClass = null;

            ICoefficient barFormCoefficient = new BarFormCoefficient(
                reinforcementPosition, reinforcement);
            ICoefficient coverCoefficient = new CoverCoefficient(
                reinforcementPosition, reinforcement);
            ICoefficient transverseReinforcementCoefficient = new TransverseReinforcementCoefficient(
                reinforcementPosition, reinforcement, TypeEnum.Beam, 0);
            ICoefficient weldedTransverseBarCoefficient = new WeldedTransverseBarCoefficient();
            ICoefficient transversePressureCoefficient  =
                new TransversePressureCoefficient(reinforcementPosition, 0);

            var coefficients = new List <ICoefficient>();

            coefficients.Add(barFormCoefficient);
            coefficients.Add(coverCoefficient);
            coefficients.Add(transverseReinforcementCoefficient);
            coefficients.Add(weldedTransverseBarCoefficient);
            coefficients.Add(transversePressureCoefficient);

            var anchorageLength = new AnchoringAnchorageLength();

            var reinforcementAnchoringViewModel = new ReinforcementAnchoringViewModel();

            return(View("ReinforcementAnchoring", reinforcementAnchoringViewModel));
        }
Exemplo n.º 3
0
        public void CoverCoefficientTest_Calculate_Success()
        {
            var reinforcementPosition = AnchoringHelper.CreateReinforcementPosition();
            var bar = new Bar(10);

            var coverCoefficient = new CoverCoefficient(reinforcementPosition, bar);

            coverCoefficient.Calculate();

            Assert.AreEqual(0.925, Math.Round(coverCoefficient.Coefficient, 3), "Coefficient not calculated properly.");
        }
Exemplo n.º 4
0
        public void CoverCoefficientTest_Constructor_Success()
        {
            var reinforcementPosition = AnchoringHelper.CreateReinforcementPosition();
            var bar = new Bar(12);

            var coverCoefficient = new CoverCoefficient(reinforcementPosition, bar);

            Assert.IsNotNull(coverCoefficient, "CoverCoefficient should be created.");
            Assert.IsNotNull(coverCoefficient.ReinforcementPosition,
                             "ReinforcementPosition should be set at construction time.");
            Assert.IsNotNull(coverCoefficient.Bar,
                             "Bar should be set at construction time.");
        }
Exemplo n.º 5
0
        public void AnchorageLengthTest_CalculateWithCoverCoefficient_Success()
        {
            var reinforcementPosition = AnchoringHelper.CreateReinforcementPosition();
            var reinforcement         = new Reinforcement(10, 500, false);

            var coverCoefficient = new CoverCoefficient(reinforcementPosition, reinforcement);

            var coefficients = new List <ICoefficient>();

            coefficients.Add(coverCoefficient);

            var anchorageLength = new AnchorageLength(reinforcement, reinforcementPosition,
                                                      ConcreteClassEnum.C25_30, TypeEnum.Beam, BondConditionEnum.Good, coefficients);

            anchorageLength.CalculateAnchorageLengths();

            Assert.AreEqual(375.738, Math.Round(anchorageLength.BasicRequiredAnchorageLength, 3),
                            "BasicRequiredAnchorageLength not calculated properly.");
            Assert.AreEqual(112.721, Math.Round(anchorageLength.MinimumAnchorageLength, 3),
                            "MinimumAnchorageLength not calculated properly.");
            Assert.AreEqual(347.558, Math.Round(anchorageLength.DesignAnchorageLength, 3),
                            "DesignAnchorageLength not calculated properly.");
        }
Exemplo n.º 6
0
        public ActionResult CalculateReinforcementAnchoring(ReinforcementAnchoringViewModel reinforcementAnchoringViewModel)
        {
            var antyCoefficients = new List <Type>();

            if (!reinforcementAnchoringViewModel.CalculateBarFormCoefficient)
            {
                antyCoefficients.Add(typeof(BarFormCoefficient));
            }
            if (!reinforcementAnchoringViewModel.CalculateCoverCoefficient)
            {
                antyCoefficients.Add(typeof(CoverCoefficient));
            }
            if (!reinforcementAnchoringViewModel.CalculateTransverseReinforcementCoefficient)
            {
                antyCoefficients.Add(typeof(TransverseReinforcementCoefficient));
            }
            if (!reinforcementAnchoringViewModel.CalculateWeldedTransverseBarCoefficient)
            {
                antyCoefficients.Add(typeof(WeldedTransverseBarCoefficient));
            }
            if (!reinforcementAnchoringViewModel.CalculateTransversePressureCoefficient)
            {
                antyCoefficients.Add(typeof(TransversePressureCoefficient));
            }

            var reinforcement = new Reinforcement(
                reinforcementAnchoringViewModel.ReinforcementDiameter ?? 0,
                reinforcementAnchoringViewModel.PressInReinforcement ?? 0,
                reinforcementAnchoringViewModel.IsPairOfBars);
            var reinforcementPosition = new ReinforcementPosition(
                reinforcementAnchoringViewModel.AreAnchoragesInTension,
                reinforcementAnchoringViewModel.AnchorageType,
                reinforcementAnchoringViewModel.SideCoverDistance ?? 0,
                reinforcementAnchoringViewModel.BottomCoverDistance ?? 0,
                reinforcementAnchoringViewModel.DistanceBetweenBars ?? 0,
                reinforcementAnchoringViewModel.TransverseBarPosition);

            ICoefficient barFormCoefficient = new BarFormCoefficient(
                reinforcementPosition, reinforcement);
            ICoefficient coverCoefficient = new CoverCoefficient(
                reinforcementPosition, reinforcement);
            ICoefficient transverseReinforcementCoefficient = new TransverseReinforcementCoefficient(
                reinforcementPosition, reinforcement, reinforcementAnchoringViewModel.Type,
                reinforcementAnchoringViewModel.TransverseReinforcementArea ?? 0);
            ICoefficient weldedTransverseBarCoefficient = new WeldedTransverseBarCoefficient();
            ICoefficient transversePressureCoefficient  = new TransversePressureCoefficient(
                reinforcementPosition, reinforcementAnchoringViewModel.TransversePressure ?? 0);

            var coefficients = new List <ICoefficient>();

            coefficients.Add(barFormCoefficient);
            coefficients.Add(coverCoefficient);
            coefficients.Add(transverseReinforcementCoefficient);
            coefficients.Add(weldedTransverseBarCoefficient);
            coefficients.Add(transversePressureCoefficient);

            var filteredCoefficients =
                coefficients.Where(c => !antyCoefficients.Contains(c.GetType())).ToList();

            var anchorageLength = new AnchorageLength(reinforcement, reinforcementPosition,
                                                      reinforcementAnchoringViewModel.ConcreteClassName,
                                                      reinforcementAnchoringViewModel.Type,
                                                      reinforcementAnchoringViewModel.BondCondition,
                                                      filteredCoefficients, reinforcementAnchoringViewModel.TransversePressure ?? 0);

            anchorageLength.CalculateAnchorageLengths();

            reinforcementAnchoringViewModel.AnchoringAnchorageLength = new AnchoringAnchorageLength()
            {
                AnchorageLength = anchorageLength
            };

            reinforcementAnchoringViewModel.ShowResults = true;

            return(View("ReinforcementAnchoring", reinforcementAnchoringViewModel));
        }