Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorShoulderPerPoint.cs
===================================================================
diff -u -r4052 -r4412
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorShoulderPerPoint.cs (.../DesignCalculatorShoulderPerPoint.cs) (revision 4052)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorShoulderPerPoint.cs (.../DesignCalculatorShoulderPerPoint.cs) (revision 4412)
@@ -53,21 +53,26 @@
/// The kernel data input.
/// The kernel data output.
/// The dam kernel input.
- /// The design scenario.
/// The calculation messages.
/// The design calculations.
///
public static void PerformDesignCalculationShoulderPerPoint
(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput,
IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput,
- DesignScenario designScenario,
List calculationMessages, List designCalculations)
{
var designResults = new List();
Location location = damKernelInput.Location;
SoilGeometryProbability subSoilScenario = damKernelInput.SubSoilScenario;
- SurfaceLine2 surfaceLine = designScenario.GetMostRecentSurfaceLine(subSoilScenario.SoilProfile1D, subSoilScenario.SoilProfile2D);
- damKernelInput.Location.SurfaceLine = surfaceLine;
+ DesignScenario designScenario = location.CurrentScenario;
+ SurfaceLine2 surfaceLine = designScenario.GetMostRecentSurfaceLine(subSoilScenario.SoilProfile1D,
+ subSoilScenario.SoilProfile2D);
+ if (surfaceLine == null)
+ {
+ surfaceLine = location.SurfaceLine;
+ }
+ surfaceLine = surfaceLine.FullDeepClone();
+ location.SurfaceLine = surfaceLine;
try
{
List locationCalculationMessages;
@@ -128,7 +133,7 @@
newSurfaceLine = surfaceLineShoulderAdapter.ConstructNewSurfaceLine(desiredShoulderLength, desiredShoulderHeight, true);
}
- damKernelInput.Location.SurfaceLine = newSurfaceLine;
+ location.SurfaceLine = newSurfaceLine;
kernelWrapper.Prepare(damKernelInput, 0, out kernelDataInput, out kernelDataOutput);
kernelWrapper.Execute(kernelDataInput, kernelDataOutput, out locationCalculationMessages);
// Process output