/// <summary> /// Assembles the section based on the input arguments. /// </summary> /// <param name="sectionResult">The section result to assemble.</param> /// <param name="failureMechanism">The <see cref="MacroStabilityInwardsFailureMechanism"/> the section result belongs to.</param> /// <param name="assessmentSection">The <see cref="IAssessmentSection"/> the section belongs to.</param> /// <returns>A <see cref="FailureMechanismSectionAssemblyResultWrapper"/>.</returns> /// <exception cref="ArgumentNullException">Thrown when any argument is <c>null</c>.</exception> /// <exception cref="AssemblyException">Thrown when the section could not be assembled.</exception> public static FailureMechanismSectionAssemblyResultWrapper AssembleSection(AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult, MacroStabilityInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) { if (sectionResult == null) { throw new ArgumentNullException(nameof(sectionResult)); } if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } if (assessmentSection == null) { throw new ArgumentNullException(nameof(assessmentSection)); } MacroStabilityInwardsCalculationScenario[] calculationScenarios = failureMechanism.Calculations .OfType <MacroStabilityInwardsCalculationScenario>() .ToArray(); return(FailureMechanismSectionAssemblyResultFactory.AssembleSection( sectionResult, assessmentSection, new MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy(sectionResult, calculationScenarios, failureMechanism), failureMechanism.GeneralInput.ApplyLengthEffectInSection, failureMechanism.MacroStabilityInwardsProbabilityAssessmentInput.GetN(sectionResult.Section.Length))); }
/// <summary> /// Assembles the failure mechanism based on its input arguments. /// </summary> /// <param name="failureMechanism">The <see cref="MacroStabilityInwardsFailureMechanism"/> to assemble.</param> /// <param name="assessmentSection">The <see cref="IAssessmentSection"/> the <paramref name="failureMechanism"/> /// belongs to.</param> /// <returns>A <see cref="FailureMechanismAssemblyResultWrapper"/> with the assembly result.</returns> /// <exception cref="ArgumentNullException">Thrown when any argument is <c>null</c>.</exception> /// <exception cref="AssemblyException">Thrown when the failure mechanism could not be assembled.</exception> public static FailureMechanismAssemblyResultWrapper AssembleFailureMechanism(MacroStabilityInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) { if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } if (assessmentSection == null) { throw new ArgumentNullException(nameof(assessmentSection)); } Func <AdoptableWithProfileProbabilityFailureMechanismSectionResult, FailureMechanismSectionAssemblyResultWrapper> performSectionAssemblyFunc = sr => AssembleSection(sr, failureMechanism, assessmentSection); return(FailureMechanismAssemblyResultFactory.AssembleFailureMechanism( failureMechanism.MacroStabilityInwardsProbabilityAssessmentInput.GetN(assessmentSection.ReferenceLine.Length), failureMechanism.SectionResults.Select(sr => AssemblyToolHelper.AssembleFailureMechanismSection(sr, performSectionAssemblyFunc)) .ToArray(), failureMechanism.GeneralInput.ApplyLengthEffectInSection, failureMechanism.AssemblyResult)); }
/// <summary> /// Creates a new instance of <see cref="MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy"/>. /// </summary> /// <param name="sectionResult">The <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResult"/> to get the probabilities for.</param> /// <param name="calculationScenarios">All the <see cref="MacroStabilityInwardsCalculationScenario"/> of the failure mechanism. </param> /// <param name="failureMechanism">The failure mechanism the calculation scenarios belong to.</param> /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception> public MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy( AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult, IEnumerable <MacroStabilityInwardsCalculationScenario> calculationScenarios, MacroStabilityInwardsFailureMechanism failureMechanism) { if (sectionResult == null) { throw new ArgumentNullException(nameof(sectionResult)); } if (calculationScenarios == null) { throw new ArgumentNullException(nameof(calculationScenarios)); } if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } this.sectionResult = sectionResult; this.calculationScenarios = calculationScenarios; this.failureMechanism = failureMechanism; }