Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r1174 -r1197 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1174) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1197) @@ -45,13 +45,6 @@ /// public List Execute(DamProjectData damProjectData) { - IKernelWrapper kernelWrapper = KernelWrapperHelper.CreateKernelWrapper(damProjectData.DamProjectCalculationSpecification.CurrentSpecification); - - if (kernelWrapper == null) - { - throw new NotImplementedException(Resources.DesignCalculatorKernelNotImplemented); - } - damProjectData.DesignCalculations = new List(); var calculationMessages = new List(); for (int locationIndex = 0; locationIndex < damProjectData.Dike.Locations.Count; locationIndex++) @@ -62,7 +55,6 @@ var soiProfileProbability = location.Segment.SoilProfileProbabilities[subSoilScenarioIndex]; for (int designScenarioIndex = 0; designScenarioIndex < location.Scenarios.Count; designScenarioIndex++) { - // Prepare input DesignScenario designScenario = location.Scenarios[designScenarioIndex]; var damKernelInput = new DamKernelInput(); @@ -79,6 +71,14 @@ SynchronizeScenarioDataWithLocationData(designScenario, location); IKernelDataInput kernelDataInput; IKernelDataOutput kernelDataOutput; + + // Create kernelwrapper + IKernelWrapper kernelWrapper = KernelWrapperHelper.CreateKernelWrapper(damProjectData.DamProjectCalculationSpecification.CurrentSpecification); + if (kernelWrapper == null) + { + throw new NotImplementedException(Resources.DesignCalculatorKernelNotImplemented); + } + PrepareResult prepareResult = kernelWrapper.Prepare(damKernelInput, 0, out kernelDataInput, out kernelDataOutput); // Sometimes the kernelDataInput is not created (p.e when soilprofileprobablility is meant for