public override void RunCombination(int combinationIndex, Combination combination, CalculationContext context) { LocalGlobalLoadConverter converter = new LocalGlobalLoadConverter(); converter.Bearing = Bearing; converter.LocalAxial = AxialForce[combinationIndex]; converter.LocalMajorShear = MajorShearForce[combinationIndex]; converter.LocalMinorShear = MinorShearForce[combinationIndex]; converter.Run(context.Output); localAxialForce[combinationIndex] = converter.GlobalAxial; localMajorShearForce[combinationIndex] = converter.GlobalMajorShear; localMinorShearForce[combinationIndex] = converter.GlobalMinorShear; }
public void TestConversion(double bearing, double localMajorShear, double localMinorShear, double localAxial, double expectedMajorShear, double expectedMinorShear, double expectedAxial) { LocalGlobalLoadConverter calc = new LocalGlobalLoadConverter(); calc.Bearing = bearing; calc.LocalMajorShear = localMajorShear; calc.LocalMinorShear = localMinorShear; calc.LocalAxial = localAxial; calc.Run(new OutputBuilder()); Assert.IsTrue(calc.Calculated, "Calc failed to complete."); Assert.AreEqual(expectedMajorShear, calc.GlobalMajorShear, Math.Abs(expectedMajorShear) * 0.001); Assert.AreEqual(expectedMinorShear, calc.GlobalMinorShear, Math.Abs(expectedMinorShear) * 0.001); Assert.AreEqual(expectedAxial, calc.GlobalAxial, Math.Abs(expectedAxial) * 0.001); }