Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/PLLinesCreator.cs =================================================================== diff -u -r927 -r958 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/PLLinesCreator.cs (.../PLLinesCreator.cs) (revision 927) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/PLLinesCreator.cs (.../PLLinesCreator.cs) (revision 958) @@ -63,6 +63,7 @@ /// public class PLLinesCreator { + protected readonly Dictionary cachedSoilProfiles1D = new Dictionary(); private const double cUpliftFactorEquilibrium = 1.0; private const double cOffsetPhreaticLineBelowSurface = 0.01; private ModelParametersForPLLines modelParametersForPLLines = new ModelParametersForPLLines(); @@ -223,17 +224,27 @@ /// private SoilProfile1D GetSoilProfileBelowPoint(double xCoordinate) { + if (cachedSoilProfiles1D.ContainsKey(xCoordinate)) + { + return cachedSoilProfiles1D[xCoordinate]; + } + SoilProfile1D soilProfile; switch (SoilProfileType) { case SoilProfileType.ProfileType1D: - var soilProfile = new SoilProfile1D(); + soilProfile = new SoilProfile1D(); soilProfile.Assign(this.SoilProfile); + cachedSoilProfiles1D[xCoordinate] = soilProfile; return soilProfile; case SoilProfileType.ProfileType2D: - return SoilProfile2D.GetSoilProfile1D(xCoordinate); //#Bka: real prof2D must be passed to Creator like 1D + soilProfile = SoilProfile2D.GetSoilProfile1D(xCoordinate); + cachedSoilProfiles1D[xCoordinate] = soilProfile; + return soilProfile; //#Bka: real prof2D must be passed to Creator like 1D case SoilProfileType.ProfileTypeStiFile: var geometry2DTo1DConverter = new Geometry2DTo1DConverter(this.SoilGeometry2DName, this.SurfaceLine, this.DikeEmbankmentMaterial, this.SoilList, -this.XSoilGeometry2DOrigin); - return geometry2DTo1DConverter.Convert(xCoordinate); + soilProfile = geometry2DTo1DConverter.Convert(xCoordinate); + cachedSoilProfiles1D[xCoordinate] = soilProfile; + return soilProfile; default: return null; }