Index: dam failuremechanisms/damPiping/trunk/src/DamPiping.sln =================================================================== diff -u -r326 -r327 --- dam failuremechanisms/damPiping/trunk/src/DamPiping.sln (.../DamPiping.sln) (revision 326) +++ dam failuremechanisms/damPiping/trunk/src/DamPiping.sln (.../DamPiping.sln) (revision 327) @@ -26,12 +26,9 @@ {9C749AA4-CFBF-4906-9057-4F4C771788B2} = {9C749AA4-CFBF-4906-9057-4F4C771788B2} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Deltares.DamPiping.UpliftLocationDeterminator", "Deltares.DamPiping.UpliftLocationDeterminator\Deltares.DamPiping.UpliftLocationDeterminator.csproj", "{C73DEAE1-1269-4C22-A973-B25502AFD504}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Deltares.DamUplift", "Deltares.DamUplift\Deltares.DamUplift.csproj", "{C73DEAE1-1269-4C22-A973-B25502AFD504}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Deltares.DamPiping.UpliftLocationDeterminatorTests", "Tests\Deltares.DamPiping.UpliftLocationDeterminatorTests\Deltares.DamPiping.UpliftLocationDeterminatorTests.csproj", "{F6D70668-2CAB-4D07-85B0-B4295D230A6A}" - ProjectSection(ProjectDependencies) = postProject - {C73DEAE1-1269-4C22-A973-B25502AFD504} = {C73DEAE1-1269-4C22-A973-B25502AFD504} - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Deltares.DamUpliftTests", "Tests\Deltares.DamUpliftTests\Deltares.DamUpliftTests.csproj", "{F6D70668-2CAB-4D07-85B0-B4295D230A6A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingCharacteristicPointType.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingCharacteristicPointType.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingCharacteristicPointType.cs (revision 327) @@ -0,0 +1,20 @@ +namespace Deltares.DamUplift +{ + public enum PipingCharacteristicPointType + { + None, + SurfaceLevelOutside, + DikeToeAtRiver, + DikeTopAtRiver, + TrafficLoadOutside, + TrafficLoadInside, + ShoulderBaseInside, + DikeTopAtPolder, + DikeToeAtPolder, // Teen dijk binnenwaarts + DitchDikeSide, // Insteek sloot dijkzijde + BottomDitchDikeSide, // Slootbodem dijkzijde + BottomDitchPolderSide, // Slootbodem polderzijde + DitchPolderSide, // Insteek sloot polderzijde + SurfaceLevelInside, + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping/Deltares.DamPiping.csproj =================================================================== diff -u -r321 -r327 --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping/Deltares.DamPiping.csproj (.../Deltares.DamPiping.csproj) (revision 321) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping/Deltares.DamPiping.csproj (.../Deltares.DamPiping.csproj) (revision 327) @@ -44,10 +44,10 @@ + Properties\GlobalAssemblyInfo.cs - Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Vector3D.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Vector3D.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Vector3D.cs (revision 327) @@ -0,0 +1,247 @@ +using System; +using System.ComponentModel; +using System.Globalization; + + +namespace Deltares.DamUplift +{ + [TypeConverter(typeof(Vector3D))] + public class Vector3D : ExpandableObjectConverter + { + private double x; + private double y; + private double z; + + public double X + { + get + { + return this.x; + } + set + { + this.x = value; + } + } + + public double Y + { + get + { + return this.y; + } + set + { + this.y = value; + } + } + + public double Z + { + get + { + return this.z; + } + set + { + this.z = value; + } + } + + public Vector3D() + { + this.x = this.y = this.z = 0.0; + } + + public Vector3D(double aX, double aY, double aZ) + { + this.x = aX; + this.y = aY; + this.z = aZ; + } + + public Vector3D(Point3D aPoint) + { + this.x = aPoint.X; + this.y = aPoint.Y; + this.z = aPoint.Z; + } + + public Vector3D(double aValue1, Vector3D aVector1, double aValue2, Vector3D aVector2) + { + this.x = aValue1 * aVector1.x + aValue2 * aVector2.x; + this.y = aValue1 * aVector1.y + aValue2 * aVector2.y; + this.z = aValue1 * aVector1.z + aValue2 * aVector2.z; + } + + public Vector3D(double aValue1, Vector3D aVector1, double aValue2, Vector3D aVector2, double aValue3, Vector3D aVector3, double aValue4, Vector3D aVector4) + { + this.x = aValue1 * aVector1.X + aValue2 * aVector2.X + aValue3 * aVector3.X + aValue4 * aVector4.X; + this.y = aValue1 * aVector1.Y + aValue2 * aVector2.Y + aValue3 * aVector3.Y + aValue4 * aVector4.Y; + this.z = aValue1 * aVector1.Z + aValue2 * aVector2.Z + aValue3 * aVector3.Z + aValue4 * aVector4.Z; + } + + public Vector3D(Vector3D aVector) + { + this.x = aVector.x; + this.y = aVector.y; + this.z = aVector.z; + } + + public static Vector3D operator -(Vector3D aVector) + { + return new Vector3D(-aVector.x, -aVector.y, -aVector.z); + } + + public static Vector3D operator +(Vector3D aVector2, Vector3D aVector1) + { + return new Vector3D(aVector2.x + aVector1.x, aVector2.y + aVector1.y, aVector2.z + aVector1.z); + } + + public static Vector3D operator -(Vector3D aVector2, Vector3D aVector1) + { + return new Vector3D(aVector2.x - aVector1.x, aVector2.y - aVector1.y, aVector2.z - aVector1.z); + } + + public static Vector3D operator *(double aValue, Vector3D aVector) + { + return new Vector3D(aValue * aVector.x, aValue * aVector.y, aValue * aVector.z); + } + + public static Vector3D operator *(Vector3D aVector, double aValue) + { + return new Vector3D(aValue * aVector.x, aValue * aVector.y, aValue * aVector.z); + } + + public static double operator ~(Vector3D aVector) + { + return Math.Sqrt(aVector.x * aVector.x + aVector.y * aVector.y + aVector.z * aVector.z); + } + + public static double operator |(Vector3D aVector2, Vector3D aVector1) + { + return aVector2.x * aVector1.x + aVector2.y * aVector1.y + aVector2.z * aVector1.z; + } + + public static Vector3D operator *(Vector3D aVector1, Vector3D aVector2) + { + return new Vector3D(aVector1.y * aVector2.z - aVector1.z * aVector2.y, aVector1.z * aVector2.x - aVector1.x * aVector2.z, aVector1.x * aVector2.y - aVector1.y * aVector2.x); + } + + public static Point3D operator *(Point3D aPoint, Vector3D aVector) + { + return new Point3D(aPoint.Y * aVector.z - aPoint.Z * aVector.y, aPoint.Z * aVector.x - aPoint.X * aVector.z, aPoint.X * aVector.y - aPoint.Y * aVector.x); + } + + public static Point3D operator +(Point3D aPoint, Vector3D aVector) + { + return new Point3D(aPoint.X + aVector.X, aPoint.Y + aVector.Y, aPoint.Z + aVector.Z); + } + + public static Point3D operator +(Vector3D aVector, Point3D aPoint) + { + return new Point3D(aVector.X + aPoint.X, aVector.Y + aPoint.Y, aVector.Z + aPoint.Z); + } + + public static Point3D operator -(Point3D aPoint, Vector3D aVector) + { + return new Point3D(aPoint.X - aVector.X, aPoint.Y - aVector.Y, aPoint.Z - aVector.Z); + } + + public static Vector3D operator !(Vector3D aVector) + { + Vector3D vector3D = new Vector3D(aVector); + vector3D.Normalize(); + return vector3D; + } + + public void Init(double aX, double aY, double aZ) + { + this.x = aX; + this.y = aY; + this.z = aZ; + } + + public void Init(Vector3D aVector) + { + this.x = aVector.x; + this.y = aVector.y; + this.z = aVector.z; + } + + public void Normalize() + { + double num = Math.Sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + if (num == 0.0) + return; + this.x = this.x / num; + this.y = this.y / num; + this.z = this.z / num; + } + + public Vector3D Add(Vector3D aVector) + { + this.x += aVector.x; + this.y += aVector.y; + this.z += aVector.z; + return this; + } + + public bool IsZero() + { + if (Math.Abs(this.x - 0.0) < 0.001 && Math.Abs(this.y - 0.0) < 0.001) + return Math.Abs(this.z - 0.0) < 0.001; + return false; + } + + public Vector3D RotateVectorAroundAxis(Vector3D aAxis, double aFi) + { + Vector3D vector3D1 = (this | aAxis) * aAxis; + Vector3D vector3D2 = this - vector3D1; + Vector3D vector3D3 = aAxis * vector3D2; + double num1 = Math.Cos(aFi); + double num2 = Math.Sin(aFi); + this.Init(vector3D2 * num1 + vector3D3 * num2 + vector3D1); + return this; + } + + public bool FromString(string aString, params char[] aSeparator) + { + string[] strArray = aString.Split(aSeparator); + if (strArray.Length != 3) + return false; + this.x = Convert.ToDouble(strArray[0]); + this.y = Convert.ToDouble(strArray[1]); + this.z = Convert.ToDouble(strArray[2]); + return true; + } + + public string ToStringSep(char aSeparator) + { + return this.x.ToString() + (object)aSeparator + this.y.ToString() + (object)aSeparator + this.z.ToString(); + } + + public string ToStringSep(IFormatProvider aFormatProvider, char aSeparator) + { + return this.x.ToString(aFormatProvider) + (object)aSeparator + this.y.ToString(aFormatProvider) + (object)aSeparator + this.z.ToString(aFormatProvider); + } + + public override bool Equals(object aObject) + { + Vector3D vector3D = aObject as Vector3D; + if (Math.Abs(this.x - vector3D.x) < 0.001 && Math.Abs(this.y - vector3D.y) < 0.001) + return Math.Abs(this.z - vector3D.z) < 0.001; + return false; + } + + public override object ConvertTo(ITypeDescriptorContext aContext, CultureInfo aCulture, object aValue, Type aDestinationType) + { + return (object)""; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingPoint.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingPoint.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingPoint.cs (revision 327) @@ -0,0 +1,71 @@ +namespace Deltares.DamUplift +{ + /// + /// Class to hold points (3D) for the Piping kernel + /// + public class PipingPoint + { + /// + /// Initializes a new instance of the class. + /// + public PipingPoint() + { + Type = PipingCharacteristicPointType.None; + } + + /// + /// Initializes a new instance of the class. + /// + /// The point. + /// + public PipingPoint(PipingPoint point, PipingCharacteristicPointType type = PipingCharacteristicPointType.None) + { + X = point.X; + Y = point.Y; + Z = point.Z; + Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + /// The x. + /// The y. + /// The z. + /// + public PipingPoint(double x, double y, double z, PipingCharacteristicPointType type = PipingCharacteristicPointType.None) + { + X = x; + Y = y; + Z = z; + Type = type; + } + + /// + /// Gets or sets the x. + /// + /// + /// The x. + /// + public double X { get; set; } + + /// + /// Gets or sets the y. + /// + /// + /// The y. + /// + public double Y { get; set; } + + /// + /// Gets or sets the z. + /// + /// + /// The z. + /// + public double Z { get; set; } + + public PipingCharacteristicPointType Type { get; set; } + + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.BlighCalculator/Deltares.DamPiping.BlighCalculator.csproj =================================================================== diff -u -r325 -r327 --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.BlighCalculator/Deltares.DamPiping.BlighCalculator.csproj (.../Deltares.DamPiping.BlighCalculator.csproj) (revision 325) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.BlighCalculator/Deltares.DamPiping.BlighCalculator.csproj (.../Deltares.DamPiping.BlighCalculator.csproj) (revision 327) @@ -41,9 +41,7 @@ - - Properties\GlobalAssemblyInfo.cs - + Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Helper.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Helper.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Helper.cs (revision 327) @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Deltares.DamUplift +{ + public class Helper + { + public static string Translate(string textId, string id = "") + { + return textId + ": " + id; + } + + public static bool AlmostEquals(double double1, double double2, double precision) + { + if (Double.IsNaN(double1) && Double.IsNaN(double2)) + return true; + if (Double.IsNaN(double1) || Double.IsNaN(double2)) + return false; + return Math.Abs(double1 - double2) <= precision; + } + public static bool AlmostEquals(double double1, double double2) + { + return AlmostEquals(double1, double2, 1E-07); + } + + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.BlighCalculator/Properties/GlobalAssemblyInfo.cs =================================================================== diff -u -r267 -r327 --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.BlighCalculator/Properties/GlobalAssemblyInfo.cs (.../GlobalAssemblyInfo.cs) (revision 267) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.BlighCalculator/Properties/GlobalAssemblyInfo.cs (.../GlobalAssemblyInfo.cs) (revision 327) @@ -1,20 +1,20 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("DamPipingBlighCalculator")] +[assembly: AssemblyTitle("DamPiping")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Deltares")] -[assembly: AssemblyProduct("DamPipingBlighCalculator")] +[assembly: AssemblyProduct("DamPiping")] [assembly: AssemblyCopyright("Copyright © Deltares 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] \ No newline at end of file +[assembly: ComVisible(false)] + Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.ExitPointDeterminator/Properties/GlobalAssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingSurfaceLine.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingSurfaceLine.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingSurfaceLine.cs (revision 327) @@ -0,0 +1,362 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Deltares.DamUplift.Properties; + +namespace Deltares.DamUplift +{ + /// + /// PipingSurfaceLine Exception class + /// + public class PipingSurfaceLineException : Exception + { + /// + /// Initializes a new instance of the class. + /// + /// The message that describes the error. + public PipingSurfaceLineException(string message) : base(message) { } + } + + /// + /// Class to hold the surface line for the Piping kernel + /// + public class PipingSurfaceLine + { + private List points = new List(); + + /// + /// Gets or sets the name. + /// + /// + /// The name. + /// + public string Name {get; set;} + + /// + /// Gets or sets the points. + /// + /// + /// The points. + /// + public List Points + { + get + { + return points; + } + set + { + points = value; + } + } + + /// + /// Determines whether this instance has ditch. + /// + /// + public bool HasDitch() + { + var i = 0; + var foundDitch = false; + while (!foundDitch && i < Points.Count) + { + foundDitch = points[i].Type == PipingCharacteristicPointType.BottomDitchDikeSide; + i++; + } + return foundDitch; + } + + /// + /// Gets the ditch dike side. + /// + /// + /// The ditch dike side. + /// + public PipingPoint DitchDikeSide + { + get + { + var point = points.Where(x => x.Type == PipingCharacteristicPointType.DitchDikeSide); + return point.FirstOrDefault(); + } + } + + /// + /// Gets the bottom ditch dike side. + /// + /// + /// The bottom ditch dike side. + /// + public PipingPoint BottomDitchDikeSide + { + get + { + var point = points.Where(x => x.Type == PipingCharacteristicPointType.BottomDitchDikeSide); + return point.FirstOrDefault(); + } + } + + /// + /// Gets the bottom ditch polder side. + /// + /// + /// The bottom ditch polder side. + /// + public PipingPoint BottomDitchPolderSide + { + get + { + var point = points.Where(x => x.Type == PipingCharacteristicPointType.BottomDitchPolderSide); + return point.FirstOrDefault(); + } + } + + /// + /// Gets the ditch polder side. + /// + /// + /// The ditch polder side. + /// + public PipingPoint DitchPolderSide + { + get + { + var point = points.Where(x => x.Type == PipingCharacteristicPointType.DitchPolderSide); + return point.FirstOrDefault(); + } + } + + /// + /// Gets the shoulder base inside. + /// + /// + /// The shoulder base inside. + /// + public PipingPoint ShoulderBaseInside + { + get + { + var point = points.Where(x => x.Type == PipingCharacteristicPointType.ShoulderBaseInside); + return point.FirstOrDefault(); + } + } + + /// + /// Gets the dike toe at polder. + /// + /// + /// The dike toe at polder. + /// + public PipingPoint DikeToeAtPolder + { + get + { + var point = points.Where(x => x.Type == PipingCharacteristicPointType.DikeToeAtPolder); + return point.FirstOrDefault(); + } + } + + /// + /// If shoulder is present then the toe of the shoulder (DikeToeAtPolder) is returned + /// Else if present the toe of the dike (ShoulderBaseInside) is returned + /// Else the first point of the surfaceline is returned if present. + /// + /// toe of the dike + public virtual PipingPoint GetDikeToeInward() + { + if (ShoulderBaseInside != null) + { + return ShoulderBaseInside; + } + if (DikeToeAtPolder != null) + { + return DikeToeAtPolder; + } + return Points.FirstOrDefault(); + } + + /// + /// Gets the z at x. + /// + /// The x. + /// + public virtual double GetZatX(double x) + { + for (int i = 0; i < Points.Count - 1; i++) + { + var current = Points[i]; + var next = Points[i + 1]; + + var leftOffset = x - current.X; + var rightOffset = next.X - x; + + if (Math.Abs(leftOffset) < PipingConstants.Accuracy) + { + return current.Z; + } + if (Math.Abs(rightOffset) < PipingConstants.Accuracy) + { + return next.Z; + } + if (leftOffset >= 0 && rightOffset >= 0) + { + var fraction = leftOffset / (leftOffset + rightOffset); + + return (1.0 - fraction) * current.Z + fraction * next.Z; + } + } + + return double.NaN; + } + + /// + /// Intersections the points xz with line xz. + /// + /// The begin. + /// The end. + /// + public IList IntersectionPointsXzWithLineXz(PipingPoint begin, PipingPoint end) + { + var intersectionPointsWithLine = new List(); + + for (int pointIndex = 0; pointIndex < Points.Count - 1; pointIndex++) + { + DoIntersectAndAddToCollection(begin, end, Points[pointIndex], Points[pointIndex + 1], intersectionPointsWithLine); + } + return intersectionPointsWithLine; + } + + /// + /// Validates this instance. + /// + /// + internal void Validate() + { + if (!AreAllCharacteristicPointsOrdered()) + { + var format = Resources.PipingSurfaceLine_Validate_CharacteristicPointXNotAscending; + var message = string.Format(format, Name); + throw new PipingSurfaceLineException(message); + } + if (!IsDitchCorrect()) + { + var format = Resources.PipingSurfaceLine_Validate_DitchIncorrect; + var message = string.Format(format, Name); + throw new PipingSurfaceLineException(message); + } + if (!ArePointsAscending()) + { + var format = Resources.PipingSurfaceLine_Validate_PointXNotAscending; + var message = string.Format(format, Name); + throw new PipingSurfaceLineException(message); + } + } + + /// + /// Checks if points are ascending. + /// + /// true if points are ascending, otherwise false + private bool ArePointsAscending() + { + for (int i = 1; i < points.Count; i++) + { + if (points[i].X < points[i - 1].X) + { + return false; + } + } + return true; + } + + + /// + /// Does the intersect and add to collection. + /// + /// a point1. + /// a point2. + /// The begin. + /// The end. + /// The intersection points with line. + private static void DoIntersectAndAddToCollection(PipingPoint aPoint1, PipingPoint aPoint2, PipingPoint begin, PipingPoint end, ICollection intersectionPointsWithLine) + { + Point2D intersectionPoint2D = null; + Routines2D.DetermineIf2DLinesIntersectStrickly(new Point2D(aPoint1.X, aPoint1.Z), new Point2D(aPoint2.X, aPoint2.Z), new Point2D(begin.X, begin.Z), new Point2D(end.X, end.Z), ref intersectionPoint2D); + if (intersectionPoint2D != null) + { + var intersectionPoint = new PipingPoint(intersectionPoint2D.X, 0, intersectionPoint2D.Y); + if (NoPointSameXzLocation(intersectionPointsWithLine, intersectionPoint)) + { + intersectionPointsWithLine.Add(intersectionPoint); + } + } + } + + /// + /// Determines if there is a point with same xz location. + /// + /// The collection. + /// The point. + /// + private static bool NoPointSameXzLocation(IEnumerable collection, PipingPoint point) + { + return !collection.Any( + p => Math.Abs(p.X - point.X) < PipingConstants.Accuracy && + Math.Abs(p.Z - point.Z) < PipingConstants.Accuracy); + } + + /// + /// Determines whether the ditch (when defined) is defined correct. It is correct if all + /// four points are there and they are in the proper left to right order. + /// + /// + /// true if its is else false + /// + private bool IsDitchCorrect() + { + if (DitchDikeSide != null || BottomDitchDikeSide != null || BottomDitchPolderSide != null || DitchPolderSide != null) + { + // At least on ditch point given, so they must now all exist + if (DitchDikeSide == null || BottomDitchDikeSide == null || BottomDitchPolderSide == null || DitchPolderSide == null) + { + return false; + } + // they must be left to right + if (BottomDitchDikeSide.X < DitchDikeSide.X || BottomDitchPolderSide.X < BottomDitchDikeSide.X || + DitchPolderSide.X < BottomDitchPolderSide.X) + { + return false; + } + } + // no ditch or ditch is ok + return true; + } + + /// + /// Determines whether the characteristic points (when defined) are ordered correct. + /// Note that the ditch is checked separatly. + /// + /// + private bool AreAllCharacteristicPointsOrdered() + { + if (ShoulderBaseInside != null) + { + if (DikeToeAtPolder != null && DikeToeAtPolder.X < ShoulderBaseInside.X) + { + return false; + } + if (DitchDikeSide != null && DitchDikeSide.X < ShoulderBaseInside.X) + { + return false; + } + } + if (DikeToeAtPolder != null) + { + if (DitchDikeSide != null && DitchDikeSide.X < DikeToeAtPolder.X) + { + return false; + } + } + return true; + } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamUpliftTests/Deltares.DamPiping.UpliftLocationDeterminatorTests.csproj =================================================================== diff -u -r326 -r327 --- dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamUpliftTests/Deltares.DamPiping.UpliftLocationDeterminatorTests.csproj (.../Deltares.DamPiping.UpliftLocationDeterminatorTests/Deltares.DamPiping.UpliftLocationDeterminatorTests.csproj) (revision 326) +++ dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamUpliftTests/Deltares.DamPiping.UpliftLocationDeterminatorTests.csproj (.../Deltares.DamUpliftTests/Deltares.DamUpliftTests.csproj) (revision 327) @@ -7,8 +7,8 @@ {F6D70668-2CAB-4D07-85B0-B4295D230A6A} Library Properties - Deltares.DamPiping.UpliftLocationDeterminatorTests - Deltares.DamPiping.UpliftLocationDeterminatorTests + Deltares.DamUpliftTests + Deltares.DamUpliftTests v4.5 512 @@ -45,13 +45,13 @@ - + - + {c73deae1-1269-4c22-a973-b25502afd504} - Deltares.DamPiping.UpliftLocationDeterminator + Deltares.DamUplift Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Routines2D.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Routines2D.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Routines2D.cs (revision 327) @@ -0,0 +1,516 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Deltares.DamUplift +{ + public enum LineIntersection + { + NoIntersection, + Intersects, + Parallel, + } + public static class Routines2D + { +// private const float cCoincideTolerance = 0.0001f; +// private const double cEpsilon = 0.0001; +// + public static double Compute2DDistance(double aX1, double aY1, double aX2, double aY2) + { + double num1 = aX1 - aX2; + double num2 = aY1 - aY2; + return Math.Sqrt(num1 * num1 + num2 * num2); + } + +// public static PointLocation RelativePointPositionToLine(double aLine1X, double aLine1Y, double aLine2X, double aLine2Y, double aPointX, double aPointY) +// { +// double num = Routines2D.CrossProduct(aLine2X - aLine1X, aLine2Y - aLine1Y, aPointX - aLine1X, aPointY - aLine1Y); +// if (Math.Abs(num) < 0.0001) +// return PointLocation.On; +// return num < 0.0 ? PointLocation.Right : PointLocation.Left; +// } +// + public static LineIntersection DetermineIf2DLinesIntersectStrickly(Point2D point1, Point2D point2, Point2D point3, Point2D point4, ref Point2D intersectionPoint) + { + return Routines2D.DetermineIf2DLinesIntersectStrickly(point1, point2, point3, point4, out intersectionPoint, 0.0001); + } + + public static LineIntersection DetermineIf2DLinesIntersectStrickly(Point2D point1, Point2D point2, Point2D point3, Point2D point4, out Point2D intersectionPoint, double tolerance) + { + LineIntersection lineIntersection = Routines2D.DetermineIf2DLinesIntersectWithExtrapolation(Routines2D.CalculateNormalLineConstants(point1, point2), Routines2D.CalculateNormalLineConstants(point3, point4), out intersectionPoint); + switch (lineIntersection) + { + case LineIntersection.Intersects: + if (!Routines2D.DoesPointExistInLine(point1, point2, intersectionPoint, tolerance) || !Routines2D.DoesPointExistInLine(point3, point4, intersectionPoint, tolerance)) + { + intersectionPoint = (Point2D)null; + lineIntersection = LineIntersection.NoIntersection; + break; + } + break; + case LineIntersection.Parallel: + if (!Routines2D.DoLinesAtLeastPartialyOverlap(point1, point2, point3, point4, tolerance)) + { + if (Routines2D.DetermineIfPointsCoincide(point1, point3, tolerance) || Routines2D.DetermineIfPointsCoincide(point1, point4, tolerance)) + { + intersectionPoint = point1; + lineIntersection = LineIntersection.Intersects; + } + if (Routines2D.DetermineIfPointsCoincide(point2, point3, tolerance) || Routines2D.DetermineIfPointsCoincide(point2, point4, tolerance)) + { + intersectionPoint = point2; + lineIntersection = LineIntersection.Intersects; + break; + } + break; + } + break; + } + return lineIntersection; + } + + public static bool DoLinesAtLeastPartialyOverlap(Point2D point1, Point2D point2, Point2D point3, Point2D point4, double tolerance) + { + bool flag = Routines2D.AreLinesParallel(point1, point2, point3, point4, tolerance); + if (!flag) + return false; + if (Math.Abs(point1.X - point2.X) < double.Epsilon) + { + double num1 = Math.Max(point1.Y, point2.Y); + double num2 = Math.Min(point1.Y, point2.Y); + double num3 = Math.Max(point3.Y, point4.Y); + double num4 = Math.Min(point3.Y, point4.Y); + if (num1 <= num4 || num2 >= num3) + flag = false; + } + else + { + double num1 = Math.Max(point1.X, point2.X); + double num2 = Math.Min(point1.X, point2.X); + double num3 = Math.Max(point3.X, point4.X); + double num4 = Math.Min(point3.X, point4.X); + if (num1 <= num4 || num2 >= num3) + flag = false; + } + return flag; + } + + public static bool AreLinesParallel(Point2D point1, Point2D point2, Point2D point3, Point2D point4) + { + return Routines2D.AreLinesParallel(point1, point2, point3, point4, 0.0001); + } + + public static bool AreLinesParallel(Point2D point1, Point2D point2, Point2D point3, Point2D point4, double tolerance) + { + Vector3D vector3D1 = new Vector3D(point2.X, point2.Y, 0.0) - new Vector3D(point1.X, point1.Y, 0.0); + Vector3D vector3D2 = new Vector3D(point4.X, point4.Y, 0.0) - new Vector3D(point3.X, point3.Y, 0.0); + vector3D1.Normalize(); + vector3D2.Normalize(); + return Routines2D.AreLinesParallel(new Point2D(vector3D1.X, vector3D1.Y), new Point2D(vector3D2.X, vector3D2.Y), tolerance); + } + + public static LineIntersection DetermineIf2DLinesIntersectWithExtrapolation(Point2D aPoint1, Point2D aPoint2, Point2D aPoint3, Point2D aPoint4, ref Point2D aIntersectionPoint) + { + return Routines2D.DetermineIf2DLinesIntersectWithExtrapolation(Routines2D.CalculateNormalLineConstants(aPoint1, aPoint2), Routines2D.CalculateNormalLineConstants(aPoint3, aPoint4), out aIntersectionPoint); + } + + public static bool DetermineIfPointsCoincide(Point2D point1, Point2D point2, double tolerance) + { + return Math.Abs(point1.X - point2.X) < tolerance && Math.Abs(point1.Y - point2.Y) < tolerance; + } + + public static bool DoesPointExistInLine(Point2D linePoint1, Point2D linePoint2, Point2D point, double tolerance) + { + double x1 = linePoint1.X; + double y1 = linePoint1.Y; + double x2 = linePoint2.X; + double y2 = linePoint2.Y; + if (linePoint1.X == linePoint2.X && linePoint1.Y == linePoint2.Y) + return Routines2D.Compute2DDistance(point.X, point.Y, x1, y1) < tolerance; + double num1 = Math.Max(x1, x2); + double num2 = Math.Min(x1, x2); + double num3 = Math.Max(y1, y2); + double num4 = Math.Min(y1, y2); + double num5 = num2 - tolerance; + double num6 = num4 - tolerance; + double num7 = num1 + tolerance; + double num8 = num3 + tolerance; + double x3 = point.X; + double y3 = point.Y; + if (x3 <= num5 || x3 >= num7 || (y3 <= num6 || y3 >= num8)) + return false; + double num9 = y1 - y2; + double num10 = x2 - x1; + double num11 = -(num9 * x1 + num10 * y1); + return Math.Abs((num9 * x3 + num10 * y3 + num11) / Routines2D.Compute2DDistance(x1, y1, x2, y2)) < tolerance; + } + +// public static double LinInpolY(double aXStart, double aYStart, double aXEnd, double aYEnd, double aXInterpolation) +// { +// if (Math.Abs(aXEnd - aXStart) < 1E-15) +// return (aYEnd + aYStart) * 0.5; +// return GeneralMathRoutines.LinearInterpolate(aYStart, aYEnd, (aXInterpolation - aXStart) / (aXEnd - aXStart)); +// } +// +// public static double CalculateSquaredDistance(Point2D point, Point2D segmentPoint1, Point2D segmentPoint2) +// { +// Point2D point2D1 = segmentPoint2 - segmentPoint1; +// Point2D point2D2 = point - segmentPoint1; +// Func func = (Func)((first, second) => first.X * second.X + first.Y * second.Y); +// double num1 = func(point2D2, point2D1); +// double num2 = func(point2D1, point2D1); +// Point2D point2D3; +// if (num1 <= 0.0) +// point2D3 = point - segmentPoint1; +// else if (num2 <= num1) +// { +// point2D3 = point - segmentPoint2; +// } +// else +// { +// double num3 = num1 / num2; +// Point2D point2D4 = segmentPoint1 + num3 * point2D1; +// point2D3 = point - point2D4; +// } +// return func(point2D3, point2D3); +// } +// +// public static double CalculateSquaredDistance(Point2D segment1Point1, Point2D segment1Point2, Point2D segment2Point1, Point2D segment2Point2) +// { +// return ((IEnumerable)new double[4] +// { +// Routines2D.CalculateSquaredDistance(segment1Point1, segment2Point1, segment2Point2), +// Routines2D.CalculateSquaredDistance(segment1Point2, segment2Point1, segment2Point2), +// Routines2D.CalculateSquaredDistance(segment2Point1, segment1Point1, segment1Point2), +// Routines2D.CalculateSquaredDistance(segment2Point2, segment1Point1, segment1Point2) +// }).Min(); +// } +// +// public static double CalculateDistanceToLine(double pointX, double pointY, double segmentStartX, double segmentStartY, double segmentEndX, double segmentEndY) +// { +// return Math.Sqrt(Routines2D.CalculateSquaredDistance(new Point2D(pointX, pointY), new Point2D(segmentStartX, segmentStartY), new Point2D(segmentEndX, segmentEndY))); +// } +// +// public static void FindParallelLine(double x1, double y1, double x2, double y2, double distance, out double resultX1, out double resultY1, out double resultX2, out double resultY2) +// { +// if (Math.Abs(distance) > 0.0) +// { +// double num1 = x2 - x1; +// double num2 = y2 - y1; +// double num3 = Routines2D.Compute2DDistance(x1, y1, x2, y2); +// double num4 = distance / num3; +// double num5 = num4 * num1; +// double num6 = num4 * num2; +// x1 -= num6; +// x2 -= num6; +// y1 += num5; +// y2 += num5; +// } +// resultX1 = x1; +// resultX2 = x2; +// resultY1 = y1; +// resultY2 = y2; +// } +// +// public static PointInPolygon CheckIfPointIsInPolygon(List polygon, double x, double y) +// { +// PointInPolygon pointInPolygon = PointInPolygon.OutsidePolygon; +// if (polygon.Count > 0) +// polygon.Add(polygon[0]); +// double count = (double)polygon.Count; +// if (count > 2.0) +// { +// double x1 = polygon[0].X - x; +// double y1 = polygon[0].Y - y; +// if (Math.Abs(x1) < 1E-10 && Math.Abs(y1) < 1E-10) +// return PointInPolygon.OnPolygonEdge; +// double num1 = Math.Atan2(y1, x1); +// double num2 = 0.0; +// for (int index = 1; (double)index < count; ++index) +// { +// double x2 = polygon[index].X - x; +// double y2 = polygon[index].Y - y; +// if (Math.Abs(x2) < 1E-10 && Math.Abs(y2) < 1E-10) +// return PointInPolygon.OnPolygonEdge; +// double num3 = Math.Atan2(y2, x2); +// double num4 = num3 - num1; +// if (num4 < -1.0 * Math.PI) +// num4 += 2.0 * Math.PI; +// if (num4 > Math.PI) +// num4 -= 2.0 * Math.PI; +// if (Math.PI - num4 < 1E-10 || Math.PI + num4 < 1E-10) +// return PointInPolygon.OnPolygonEdge; +// num2 += num4; +// num1 = num3; +// } +// pointInPolygon = num2 > 19.0 * Math.PI / 10.0 || num2 < -19.0 * Math.PI / 10.0 ? PointInPolygon.InsidePolygon : PointInPolygon.OutsidePolygon; +// } +// return pointInPolygon; +// } +// +// public static void GetPointOnLineClosestTo(double aPointX, double aPointY, double aLine1X, double aLine1Y, double aLine2X, double aLine2Y, out double aResultX, out double aResultY) +// { +// double x = Routines2D.Compute2DDistance(aLine1X, aLine1Y, aLine2X, aLine2Y); +// double num = (Math.Pow(Routines2D.Compute2DDistance(aLine1X, aLine1Y, aPointX, aPointY), 2.0) - Math.Pow(Routines2D.Compute2DDistance(aLine2X, aLine2Y, aPointX, aPointY), 2.0) + Math.Pow(x, 2.0)) / (2.0 * x); +// if (num <= 0.0) +// { +// aResultX = aLine1X; +// aResultY = aLine1Y; +// } +// else if (num >= x) +// { +// aResultX = aLine2X; +// aResultY = aLine2Y; +// } +// else +// { +// aResultX = aLine1X + num / x * (aLine2X - aLine1X); +// aResultY = aLine1Y + num / x * (aLine2Y - aLine1Y); +// } +// } +// +// public static List IntersectCircleline(double aX, double aY, double aR, double aX1, double aX2, double aY1, double aY2) +// { +// double num1 = aX2 - aX1; +// double x1 = aX1 - aX; +// double num2 = aY2 - aY1; +// double x2 = aY1 - aY; +// List point2DList = new List(); +// if (Math.Abs(num1) > 1E-08 || Math.Abs(num2) > 1E-08) +// { +// double num3 = num1 * num1 + num2 * num2; +// double num4 = 2.0 * (num1 * x1 + num2 * x2); +// double num5 = x1 * x1 + x2 * x2 - aR * aR; +// double d = num4 * num4 - 4.0 * num3 * num5; +// if (d > 1E-08) +// { +// double num6 = (-num4 + Math.Sqrt(d)) / (2.0 * num3); +// if (num6 >= -1E-08 && num6 <= 1.00000001) +// point2DList.Add(new Point2D(aX1 + num6 * num1, aY1 + num6 * num2)); +// double num7 = (-num4 - Math.Sqrt(d)) / (2.0 * num3); +// if (num7 >= -1E-08 && num7 <= 1.00000001) +// point2DList.Add(new Point2D(aX1 + num7 * num1, aY1 + num7 * num2)); +// } +// else if (Math.Abs(d) <= 1E-08) +// { +// double num6 = -num4 / (2.0 * num3); +// if (num6 >= -1E-08 && num6 <= 1.00000001) +// point2DList.Add(new Point2D(aX1 + num6 * num1, aY1 + num6 * num2)); +// } +// } +// else if (Math.Abs(Math.Pow(x1, 2.0) + Math.Pow(x2, 2.0) - Math.Pow(aR, 2.0)) < 1E-08) +// point2DList.Add(new Point2D(aX1, aY1)); +// return point2DList; +// } +// +// public static Clockwise IsClockWise(IEnumerable aPolygon) +// { +// Point2D[] array = aPolygon.Distinct().ToArray(); +// if (array.Length < 3) +// return Clockwise.NotEnoughUniquePoints; +// double num1 = 0.0; +// for (int index = 0; index < array.Length - 1; ++index) +// { +// double num2 = (array[index + 1].X - array[index].X) * (array[index + 1].Y + array[index].Y); +// num1 += num2; +// } +// double num3 = (array[0].X - array[array.Length - 1].X) * (array[0].Y + array[array.Length - 1].Y); +// int num4 = Math.Sign(num1 + num3); +// if (num4 == 0) +// return Clockwise.PointsOnLine; +// return (double)num4 <= 0.0 ? Clockwise.AntiClockwise : Clockwise.IsClockwise; +// } +// +// public static double ComputeTriangleArea(double aX1, double aY1, double aX2, double aY2, double aX3, double aY3) +// { +// return 0.5 * ((aX3 - aX1) * (aY2 - aY1) - (aY3 - aY1) * (aX2 - aX1)); +// } +// +// public static bool AreEqual(double x1, double x2, double tolerance) +// { +// return Math.Abs(x1 - x2) < tolerance; +// } +// +// public static bool AreEqual(Point2D p1, Point2D p2, int tolerance) +// { +// if (Routines2D.AreEqual(p1.X, p2.X, (double)tolerance)) +// return Routines2D.AreEqual(p1.Y, p2.Y, (double)tolerance); +// return false; +// } +// +// public static bool AreEqual(int x1, int x2, int tolerance) +// { +// return Math.Abs(x1 - x2) < tolerance; +// } +// +// public static bool DetermineIfPointsCoincide(double aX1, double aY1, double aX2, double aY2, double aTolerance) +// { +// if (Math.Abs(aX2 - aX1) < aTolerance) +// return Math.Abs(aY2 - aY1) < aTolerance; +// return false; +// } +// +// public static double Determine2DPolygonArea(List closedPolygon) +// { +// int count = closedPolygon.Count; +// double num = 0.0; +// if (!Routines2D.DetermineIfPointsCoincide(closedPolygon[0], closedPolygon[count - 1], 9.99999974737875E-05)) +// { +// closedPolygon.Add(closedPolygon[0]); +// count = closedPolygon.Count; +// } +// for (int index = 0; index < count - 1; ++index) +// num += Routines2D.CrossProduct(closedPolygon[index].X, closedPolygon[index].Y, closedPolygon[index + 1].X, closedPolygon[index + 1].Y); +// return num / 2.0; +// } +// +// public static Point2D DeterminePolygonCentroid(List closedPolygon) +// { +// int count = closedPolygon.Count; +// if (!Routines2D.DetermineIfPointsCoincide(closedPolygon[0], closedPolygon[count - 1], 9.99999974737875E-05)) +// closedPolygon.Add(closedPolygon[0]); +// else +// --count; +// double num1 = Routines2D.Determine2DPolygonArea(closedPolygon); +// if (num1 > 0.0) +// { +// double num2 = 0.0; +// double num3 = 0.0; +// for (int index = 0; index < count; ++index) +// { +// double num4 = Routines2D.CrossProduct(closedPolygon[index].X, closedPolygon[index].Y, closedPolygon[index + 1].X, closedPolygon[index + 1].Y); +// num2 += (closedPolygon[index].X + closedPolygon[index + 1].X) * num4; +// num3 += (closedPolygon[index].Y + closedPolygon[index + 1].Y) * num4; +// } +// return new Point2D(num2 / (6.0 * num1), num3 / (6.0 * num1)); +// } +// double num5 = 0.0; +// double num6 = 0.0; +// for (int index = 0; index < count; ++index) +// { +// num5 += closedPolygon[index].X; +// num6 += closedPolygon[index].Y; +// } +// return new Point2D(num5 / (double)count, num6 / (double)count); +// } +// +// public static MinMax GetMinMax(List aPointList, ref double aMin, ref double aMax, MinMaxCordinate aMinMaxCoordinate) +// { +// if (aPointList.Count < 2) +// return MinMax.Error; +// aMin = aPointList.Min((Func)(x => +// { +// if (aMinMaxCoordinate != MinMaxCordinate.X) +// return x.Y; +// return x.X; +// })); +// aMax = aPointList.Max((Func)(x => +// { +// if (aMinMaxCoordinate != MinMaxCordinate.X) +// return x.Y; +// return x.X; +// })); +// return MinMax.Calculated; +// } +// +// public static double GetAngle(double x1, double y1, double x2, double y2) +// { +// double aValue1_1 = y2 - y1; +// double aValue1_2 = x2 - x1; +// if (aValue1_2.IsNearEqual(1E-08)) +// return 90.0; +// if (aValue1_1.IsNearEqual(1E-08)) +// return 0.0; +// return Math.Atan(aValue1_1 / aValue1_2) * 180.0 / Math.PI; +// } +// +// public static bool IsPointInRectangularBounds(double aXLeft, double aXRight, double aYTop, double aYBottom, Point2D aPoint) +// { +// bool flag1 = aPoint.X.IsGreaterThanOrEqualTo(aXLeft) && aPoint.X.IsLessThanOrEqualTo(aXRight); +// bool flag2 = aPoint.Y.IsGreaterThanOrEqualTo(aYBottom) && aPoint.Y.IsLessThanOrEqualTo(aYTop); +// if (flag1) +// return flag2; +// return false; +// } +// +// public static double GetMinimumDistanceAmongPoints(List pointList) +// { +// if (pointList.Count < 2) +// return 0.0; +// List doubleList = new List(); +// for (int index1 = 0; index1 < pointList.Count; ++index1) +// { +// for (int index2 = index1 + 1; index2 < pointList.Count; ++index2) +// doubleList.Add(Routines2D.Compute2DDistance(pointList[index1].X, pointList[index1].Y, pointList[index2].X, pointList[index2].Y)); +// } +// doubleList.Sort(); +// return doubleList[0]; +// } +// +// public static Point2D RotateAroundPoint(Point2D rotatePoint, Point2D rotateCenter, double theta) +// { +// double num1 = rotatePoint.X - rotateCenter.X; +// double num2 = rotatePoint.Y - rotateCenter.Y; +// return new Point2D() +// { +// X = Math.Cos(theta) * num1 - Math.Sin(theta) * num2 + rotateCenter.X, +// Y = Math.Sin(theta) * num1 + Math.Cos(theta) * num2 + rotateCenter.Y +// }; +// } +// +// public static bool IsBetween(double x, double x1, double x2) +// { +// if (x1 <= x && x2 >= x) +// return true; +// if (x1 >= x) +// return x2 <= x; +// return false; +// } +// + private static double CrossProduct(double pointAx, double pointAy, double pointBx, double pointBy) + { + return pointAx * pointBy - pointBx * pointAy; + } + + private static Vector3D CalculateNormalLineConstants(Point2D aPoint1, Point2D aPoint2) + { + return new Vector3D() + { + X = aPoint2.Y - aPoint1.Y, + Y = -(aPoint2.X - aPoint1.X), + Z = (aPoint2.Y - aPoint1.Y) * aPoint1.X - (aPoint2.X - aPoint1.X) * aPoint1.Y + }; + } + + private static bool AreLinesParallel(Point2D aLine1Constant, Point2D aLine2Constant, double tolerance) + { + double x1 = aLine1Constant.X; + double y1 = aLine1Constant.Y; + double x2 = aLine2Constant.X; + double y2 = aLine2Constant.Y; + return Math.Abs(Routines2D.CrossProduct(x1, x2, y1, y2)) < tolerance; + } + + private static LineIntersection DetermineIf2DLinesIntersectWithExtrapolation(Vector3D aLine1Constant, Vector3D aLine2Constant, out Point2D aIntersectionPoint) + { + aIntersectionPoint = new Point2D(0.0, 0.0); + double x1 = aLine1Constant.X; + double y1 = aLine1Constant.Y; + double z1 = aLine1Constant.Z; + double x2 = aLine2Constant.X; + double y2 = aLine2Constant.Y; + double z2 = aLine2Constant.Z; + if (Routines2D.AreLinesParallel(new Point2D(x1, x2), new Point2D(y1, y2), 0.0001)) + { + aIntersectionPoint = (Point2D)null; + return LineIntersection.Parallel; + } + double num1 = (y2 * z1 - y1 * z2) / (x1 * y2 - x2 * y1); + double num2 = (z1 * x2 - z2 * x1) / (x2 * y1 - x1 * y2); + aIntersectionPoint.X = num1; + aIntersectionPoint.Y = num2; + return LineIntersection.Intersects; + } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Point3D.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Point3D.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Point3D.cs (revision 327) @@ -0,0 +1,222 @@ +using System; +using System.ComponentModel; +using System.Globalization; + +namespace Deltares.DamUplift +{ + [TypeConverter(typeof(Point3D))] + public class Point3D : ExpandableObjectConverter, IComparable + { + private double x; + private double y; + private double z; + + [Description("Set X coordinate")] + public double X + { + get + { + return this.x; + } + set + { + this.x = value; + } + } + + [Description("Set Y coordinate")] + public double Y + { + get + { + return this.y; + } + set + { + this.y = value; + } + } + + [Description("Set Z coordinate")] + public double Z + { + get + { + return this.z; + } + set + { + this.z = value; + } + } + + public Point3D() + { + this.x = 0.0; + this.y = 0.0; + this.z = 0.0; + } + + public Point3D(Point3D point) + { + this.x = point.X; + this.y = point.Y; + this.z = point.Z; + } + + public Point3D(double aX, double aY, double aZ) + { + this.x = aX; + this.y = aY; + this.z = aZ; + } + + public Point3D(double aValue1, Point3D aPoint1, double aValue2, Point3D aPoint2) + { + this.x = aValue1 * aPoint1.X + aValue2 * aPoint2.X; + this.y = aValue1 * aPoint1.Y + aValue2 * aPoint2.Y; + this.z = aValue1 * aPoint1.Z + aValue2 * aPoint2.Z; + } + + public Point3D(double aValue1, Point3D aPoint1, double aValue2, Point3D aPoint2, double aValue3, Point3D aPoint3) + { + this.x = aValue1 * aPoint1.X + aValue2 * aPoint2.X + aValue3 * aPoint3.X; + this.y = aValue1 * aPoint1.Y + aValue2 * aPoint2.Y + aValue3 * aPoint3.Y; + this.z = aValue1 * aPoint1.Z + aValue2 * aPoint2.Z + aValue3 * aPoint3.Z; + } + + public Point3D(double aValue1, Point3D aPoint1, double aValue2, Point3D aPoint2, double aValue3, Point3D aPoint3, double aValue4, Point3D aPoint4) + { + this.x = aValue1 * aPoint1.X + aValue2 * aPoint2.X + aValue3 * aPoint3.X + aValue4 * aPoint4.X; + this.y = aValue1 * aPoint1.Y + aValue2 * aPoint2.Y + aValue3 * aPoint3.Y + aValue4 * aPoint4.Y; + this.z = aValue1 * aPoint1.Z + aValue2 * aPoint2.Z + aValue3 * aPoint3.Z + aValue4 * aPoint4.Z; + } + + public static Point3D operator +(Point3D aPoint1, Point3D aPoint2) + { + return new Point3D(aPoint1.X + aPoint2.x, aPoint1.Y + aPoint2.y, aPoint1.Z + aPoint2.Z); + } + + public static Point3D operator -(Point3D aPoint1, Point3D aPoint2) + { + return new Point3D(aPoint1.X - aPoint2.x, aPoint1.Y - aPoint2.y, aPoint1.Z - aPoint2.Z); + } + + public static Point3D operator *(double scale, Point3D point) + { + return point * scale; + } + + public static Point3D operator *(Point3D point, double scale) + { + return new Point3D(point.x * scale, point.y * scale, point.z * scale); + } + + public static Point3D operator /(double scale, Point3D point) + { + return point / scale; + } + + public static Point3D operator /(Point3D point, double scale) + { + return point * (1.0 / scale); + } + + public bool Compare(Point3D aPoint, double aDistance) + { + return Math.Pow(this.x - aPoint.X, 2.0) + Math.Pow(this.y - aPoint.Y, 2.0) + Math.Pow(this.z - aPoint.Z, 2.0) <= Math.Pow(aDistance, 2.0); + } + + public void Init(double aX, double aY, double aZ) + { + this.x = aX; + this.y = aY; + this.z = aZ; + } + + public void Init(Point3D aPoint) + { + this.x = aPoint.X; + this.y = aPoint.Y; + this.z = aPoint.Z; + } + + public void Add(Point3D aPoint) + { + this.x += aPoint.X; + this.y += aPoint.Y; + this.z += aPoint.Z; + } + + public void Mul(double aValue) + { + this.x *= aValue; + this.y *= aValue; + this.z *= aValue; + } + + public bool FromString(string aString, params char[] aSeperator) + { + string[] strArray = aString.Split(aSeperator); + if (strArray.Length != 3) + return false; + this.x = Convert.ToDouble(strArray[0]); + this.y = Convert.ToDouble(strArray[1]); + this.z = Convert.ToDouble(strArray[2]); + return true; + } + + public Point2D GetPointXZ() + { + return new Point2D(this.X, this.Z); + } + + public double LengthSquared() + { + return this.DotProduct(this); + } + + public double Length() + { + return Math.Sqrt(this.LengthSquared()); + } + + public double DotProduct(Point3D p) + { + return this.X * p.X + this.Y * p.Y + this.Z * p.Z; + } + + public Point3D CrossProduct(Point3D p) + { + return new Point3D(this.Y * p.Z - this.Z * p.Y, this.Z * p.X - this.X * p.Z, this.X * p.Y - this.Y * p.X); + } + + public override bool Equals(object aObject) + { + Point3D point3D = aObject as Point3D; + if (point3D == null || Math.Abs(this.x - point3D.x) >= 0.001 || Math.Abs(this.y - point3D.y) >= 0.001) + return false; + return Math.Abs(this.z - point3D.z) < 0.001; + } + + public override object ConvertTo(ITypeDescriptorContext aContext, CultureInfo aCulture, object aValue, Type aDestinationType) + { + return (object)""; + } + + public override string ToString() + { + return this.X.ToString("F2") + " " + this.Y.ToString("F2") + " " + this.Z.ToString("F2"); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public int CompareTo(object obj) + { + return this.X.CompareTo(((Point3D)obj).X); + } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/DeterminatorUpliftLocation.cs =================================================================== diff -u -r326 -r327 --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/DeterminatorUpliftLocation.cs (.../Deltares.DamPiping.UpliftLocationDeterminator/DeterminatorUpliftLocation.cs) (revision 326) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/DeterminatorUpliftLocation.cs (.../Deltares.DamUplift/UpliftLocationDeterminator.cs) (revision 327) @@ -4,13 +4,120 @@ using System.Text; using System.Threading.Tasks; -namespace Deltares.DamPiping.UpliftLocationDeterminator +namespace Deltares.DamUplift { - public class DeterminatorUpliftLocation + public class UpliftLocationDeterminator { /// /// 2D surface line with all relevant points labelled (toe, ditch) as input. /// public PipingSurfaceLine SurfaceLine { get; set; } + + /// + /// Determine location with lowest upliftfactor + /// + /// location and upliftfactor + public UpliftLocationAndResult GetLocationAtWithLowestUpliftFactor() + { + double? lowestUpliftFactor = null; + +// ThrowIfNoPLLinesDefined(); +// ThrowIfNoSurfaceLinDefined(); +// ThrowIfNoSoilProfileDefined(); + + PipingPoint startSurfacePoint = SurfaceLine.GetDikeToeInward(); + IEnumerable relevantSurfacePointsList = from PipingPoint point in SurfaceLine.Points + where point.X >= startSurfacePoint.X + orderby point.X ascending + select point; + UpliftLocationAndResult lowestUpliftLocationAndResult = null; + foreach (PipingPoint surfacePoint in relevantSurfacePointsList) + { + UpliftLocationAndResult upliftLocationAndResult = GetUpliftFactorAtPoint(surfacePoint); + if (upliftLocationAndResult != null) + { + if (!lowestUpliftFactor.HasValue || upliftLocationAndResult.UpliftFactor < lowestUpliftFactor) + { + lowestUpliftFactor = upliftLocationAndResult.UpliftFactor; + lowestUpliftLocationAndResult = upliftLocationAndResult; + } + } + } + return lowestUpliftLocationAndResult; + } + + /// + /// Calculate upliftfactor for given point + /// + /// + /// location and upliftfactor + public UpliftLocationAndResult GetUpliftFactorAtPoint(PipingPoint point) + { +// SoilProfile1D soilProfileInCurrentPoint = GetSoilProfileBelowPoint(point.X); +// double upliftFactorForInBetweenSandLayer = double.MaxValue; +// if (soilProfileInCurrentPoint.InBetweenAquiferLayer != null) +// { +// // Check if inbetween sandlayer below surface +// double topInBetweenSandLayer = soilProfileInCurrentPoint.InBetweenAquiferLayer.TopLevel; +// if (topInBetweenSandLayer < point.Z) +// { +// // There is an aquitard above the aquifer, for which we can determine the uplift factor +// UpliftCalculator upliftCalculatorForInBetweenSandLayer = CreateUpliftCalculator(point, topInBetweenSandLayer, soilProfileInCurrentPoint); +// if ((PLLines.Lines[PLLineType.PL4] != null) && (PLLines.Lines[PLLineType.PL4].Points.Count > 0)) +// upliftFactorForInBetweenSandLayer = upliftCalculatorForInBetweenSandLayer.CalculateUpliftFactor(PLLines.Lines[PLLineType.PL4].ZFromX(point.X)); +// } +// else +// { +// if (soilProfileInCurrentPoint.GetBottomLevel(soilProfileInCurrentPoint.InBetweenAquiferLayer) < point.Z) +// { +// // The surface cuts into the aquifer so the level to be evaluated is at surfacelevel +// UpliftCalculator upliftCalculatorForInBetweenSandLayer = CreateUpliftCalculator(point, point.Z, soilProfileInCurrentPoint); +// if ((PLLines.Lines[PLLineType.PL4] != null) && (PLLines.Lines[PLLineType.PL4].Points.Count > 0)) +// upliftFactorForInBetweenSandLayer = upliftCalculatorForInBetweenSandLayer.CalculateUpliftFactor(PLLines.Lines[PLLineType.PL4].ZFromX(point.X)); +// +// } +// } +// } +// +// double upliftFactorForBottomSandLayer = double.MaxValue; +// if (soilProfileInCurrentPoint.BottomAquiferLayer != null) +// { +// // Check if bottom sandlayer below surface +// double topBottomSandLayer = soilProfileInCurrentPoint.BottomAquiferLayer.TopLevel; +// if (topBottomSandLayer < point.Z) +// { +// UpliftCalculator upliftCalculatorForBottomSandLayer = CreateUpliftCalculator(point, soilProfileInCurrentPoint.BottomAquiferLayer.TopLevel, soilProfileInCurrentPoint); +// if ((PLLines.Lines[PLLineType.PL3] != null) && (PLLines.Lines[PLLineType.PL3].Points.Count > 0)) +// upliftFactorForBottomSandLayer = upliftCalculatorForBottomSandLayer.CalculateUpliftFactor(PLLines.Lines[PLLineType.PL3].ZFromX(point.X)); +// } +// else +// { +// if (soilProfileInCurrentPoint.GetBottomLevel(soilProfileInCurrentPoint.BottomAquiferLayer) < point.Z) +// { +// // The surface cuts into the aquifer so the level to be evaluated is at surfacelevel +// UpliftCalculator upliftCalculatorForInBetweenSandLayer = CreateUpliftCalculator(point, point.Z, soilProfileInCurrentPoint); +// if ((PLLines.Lines[PLLineType.PL3] != null) && (PLLines.Lines[PLLineType.PL3].Points.Count > 0)) +// upliftFactorForBottomSandLayer = upliftCalculatorForInBetweenSandLayer.CalculateUpliftFactor(PLLines.Lines[PLLineType.PL3].ZFromX(point.X)); +// +// } +// } +// +// } +// +// if ((upliftFactorForBottomSandLayer == double.MaxValue) && (upliftFactorForInBetweenSandLayer == double.MaxValue)) +// return null; +// +// if (upliftFactorForBottomSandLayer < upliftFactorForInBetweenSandLayer) +// { +// return new UpliftLocationAndResult(point, upliftFactorForBottomSandLayer, soilProfileInCurrentPoint.BottomAquiferLayer.Id); +// } +// else +// { +// return new UpliftLocationAndResult(point, upliftFactorForInBetweenSandLayer, soilProfileInCurrentPoint.InBetweenAquiferLayer.Id); +// } + return null; //tmp + } + + } } Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/UpliftLocationAndResult.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/UpliftLocationAndResult.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/UpliftLocationAndResult.cs (revision 327) @@ -0,0 +1,30 @@ +namespace Deltares.DamUplift +{ + public class UpliftLocationAndResult : PipingPoint + { + public UpliftLocationAndResult() + { + UpliftFactor = 0; + LayerWhereUpliftOccuresId = ""; + } + + public UpliftLocationAndResult(double upliftFactor, string layerWhereUpliftOccuresId) + { + UpliftFactor = upliftFactor; + LayerWhereUpliftOccuresId = layerWhereUpliftOccuresId; + } + + public UpliftLocationAndResult(PipingPoint point, double upliftFactor, string layerWhereUpliftOccuresId) + { + X = point.X; + Y = point.Y; + Z = point.Z; + UpliftFactor = upliftFactor; + LayerWhereUpliftOccuresId = layerWhereUpliftOccuresId; + } + + public double? UpliftFactor { get; set; } + + public string LayerWhereUpliftOccuresId { get; set; } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Properties/Resources.Designer.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Properties/Resources.Designer.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Properties/Resources.Designer.cs (revision 327) @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Deltares.DamUplift.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Deltares.DamUplift.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to CharacteristicPointXNotAscending. + /// + internal static string PipingSurfaceLine_Validate_CharacteristicPointXNotAscending { + get { + return ResourceManager.GetString("PipingSurfaceLine_Validate_CharacteristicPointXNotAscending", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DitchIncorrect. + /// + internal static string PipingSurfaceLine_Validate_DitchIncorrect { + get { + return ResourceManager.GetString("PipingSurfaceLine_Validate_DitchIncorrect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PointXNotAscending. + /// + internal static string PipingSurfaceLine_Validate_PointXNotAscending { + get { + return ResourceManager.GetString("PipingSurfaceLine_Validate_PointXNotAscending", resourceCulture); + } + } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamUpliftTests/DeterminatorUpliftLocationTests.cs =================================================================== diff -u -r326 -r327 --- dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamUpliftTests/DeterminatorUpliftLocationTests.cs (.../Deltares.DamPiping.UpliftLocationDeterminatorTests/DeterminatorUpliftLocationTests.cs) (revision 326) +++ dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamUpliftTests/DeterminatorUpliftLocationTests.cs (.../Deltares.DamUpliftTests/UpliftLocationDeterminatorTests.cs) (revision 327) @@ -1,9 +1,9 @@ -using Deltares.DamPiping.UpliftLocationDeterminator; +using Deltares.DamUplift; using NUnit.Framework; -namespace Deltares.DamPiping.UpliftLocationDeterminatorTests +namespace Deltares.DamUpliftTests { - public class DeterminatorUpliftLocationTests + public class UpliftLocationDeterminatorTests { [Test] @@ -20,7 +20,7 @@ // SoilProfile1D soilProfile = FactoryForSoilProfileTests.CreateClaySandProfile(); // PLLines plLines = CreatePLLines(surfaceLine, soilProfile, cRiverlevel, false); - DeterminatorUpliftLocation upliftLocationDeterminator = new DeterminatorUpliftLocation() + UpliftLocationDeterminator upliftLocationDeterminator = new UpliftLocationDeterminator() { SurfaceLine = surfaceLine, // SoilProfile = soilProfile, @@ -29,7 +29,7 @@ Assert.AreEqual(10, surfaceLine.Points.Count); - // UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAtWithLowestUpliftFactor(); + UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAtWithLowestUpliftFactor(); // // Assert.AreEqual(cExpectedXCoordinate, upliftLocationAndResult.X, cTolerance); // Assert.AreEqual(cExpectedZCoordinate, upliftLocationAndResult.Z, cTolerance); Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Point2D.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Point2D.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Geo/Point2D.cs (revision 327) @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Deltares.DamUplift +{ + public class Point2D + { + public const double Epsilon = 1E-10; + + public double X { get; set; } + + public double Y { get; set; } + + public Point2D() + { + this.X = 0.0; + this.Y = 0.0; + } + + public Point2D(double aX, double aY) + { + this.X = aX; + this.Y = aY; + } + + public Point2D(double aValue1, Point2D aPoint1, double aValue2, Point2D aPoint2) + { + this.X = aValue1 * aPoint1.X + aValue2 * aPoint2.X; + this.Y = aValue1 * aPoint1.Y + aValue2 * aPoint2.Y; + } + + public Point2D(double aValue1, Point2D aPoint1, double aValue2, Point2D aPoint2, double aValue3, Point2D aPoint3, double aValue4, Point2D aPoint4) + { + this.X = aValue1 * aPoint1.X + aValue2 * aPoint2.X + aValue3 * aPoint3.X + aValue4 * aPoint4.X; + this.Y = aValue1 * aPoint1.Y + aValue2 * aPoint2.Y + aValue3 * aPoint3.Y + aValue4 * aPoint4.Y; + } + + public Point2D(Point2D aPoint) + { + this.X = aPoint.X; + this.Y = aPoint.Y; + } + + public static Point2D operator -(Point2D aPoint) + { + return new Point2D(-aPoint.X, -aPoint.Y); + } + + public static Point2D operator +(Point2D aPoint2, Point2D aPoint1) + { + return new Point2D(aPoint2.X + aPoint1.X, aPoint2.Y + aPoint1.Y); + } + + public static Point2D operator -(Point2D aPoint2, Point2D aPoint1) + { + return new Point2D(aPoint2.X - aPoint1.X, aPoint2.Y - aPoint1.Y); + } + + public static Point2D operator *(double aValue1, Point2D aPoint1) + { + return new Point2D(aValue1 * aPoint1.X, aValue1 * aPoint1.Y); + } + + public static Point2D operator *(Point2D aPoint1, double aValue1) + { + return new Point2D(aValue1 * aPoint1.X, aValue1 * aPoint1.Y); + } + + public void Init(double aX, double aY) + { + this.X = aX; + this.Y = aY; + } + + public void Init(Point2D aPoint) + { + this.X = aPoint.X; + this.Y = aPoint.Y; + } + + public Point2D Add(Point2D aPoint) + { + this.X += aPoint.X; + this.Y += aPoint.Y; + return this; + } + + public bool FromString(string aString, params char[] aSeparator) + { + string[] strArray = aString.Split(aSeparator); + if (strArray.Length != 2) + return false; + this.X = Convert.ToDouble(strArray[0]); + this.Y = Convert.ToDouble(strArray[1]); + return true; + } + + public override bool Equals(object obj) + { + Point2D point2D = obj as Point2D; + if (point2D != null && Helper.AlmostEquals(X, point2D.X, 1E-10)) + return Helper.AlmostEquals(Y, point2D.Y, 1E-10); + return false; + } + + public override int GetHashCode() + { + return this.GetType().GetHashCode() + 11 * (int)Math.Round(this.X * 1000000000) + 29 * (int)Math.Round(this.Y * 1000000000); + } + + public override string ToString() + { + return this.X.ToString("F3") + ", " + this.Y.ToString("F3"); + } + } +} Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Deltares.DamPiping.UpliftLocationDeterminator.csproj =================================================================== diff -u -r326 -r327 --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Deltares.DamPiping.UpliftLocationDeterminator.csproj (.../Deltares.DamPiping.UpliftLocationDeterminator/Deltares.DamPiping.UpliftLocationDeterminator.csproj) (revision 326) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/Deltares.DamPiping.UpliftLocationDeterminator.csproj (.../Deltares.DamUplift/Deltares.DamUplift.csproj) (revision 327) @@ -7,8 +7,8 @@ {C73DEAE1-1269-4C22-A973-B25502AFD504} Library Properties - Deltares.DamPiping.UpliftLocationDeterminator - Deltares.DamPiping.UpliftLocationDeterminator + Deltares.DamUplift + Deltares.DamUplift v4.5 512 @@ -41,7 +41,10 @@ - + + Properties\GlobalAssemblyInfo.cs + + @@ -51,12 +54,12 @@ - True True Resources.resx + Index: dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingConstants.cs =================================================================== diff -u --- dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingConstants.cs (revision 0) +++ dam failuremechanisms/damPiping/trunk/src/Deltares.DamUplift/PipingConstants.cs (revision 327) @@ -0,0 +1,21 @@ +namespace Deltares.DamUplift +{ + /// + /// Class holding all constant default values specific to the Piping kernel + /// + public class PipingConstants + { +// public const double UnitWeightOfWater = 9.81; +// public const double GammaSubParticles = 16.5; +// public const double BeddingAngleSellmeijerOriginal = 41.0; +// public const double BeddingAngleSellmeijerRevised = 37.0; +// public const double WhitesDragCoefficient = 0.25; +// public const double D70Mean = 2.08e-4; +// public const double RExitDefault = 1.00; +// public const double RToeDefault = 1.00; +// public const double RcDefault = 0.3; + public const double Accuracy = 0.0005; +// public const double MinimumLayerThickness = 0.001; +// public const double Epsilon = 1e-8; + } +} \ No newline at end of file Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Deltares.DamPiping.UpliftLocationDeterminator.csproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Properties/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Properties/AssemblyInfo.cs.svn'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Properties/GlobalAssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Helper.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/PipingCharacteristicPointType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Properties/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Geo/Routines2D.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Geo/Vector3D.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/DeterminatorUpliftLocation.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/PipingConstants.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Geo/Point3D.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/PipingPoint.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/PipingSurfaceLine.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Deltares.DamPiping.UpliftLocationDeterminator/Geo/Point2D.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamPiping.UpliftLocationDeterminatorTests/Properties/AssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamPiping.UpliftLocationDeterminatorTests/Deltares.DamPiping.UpliftLocationDeterminatorTests.csproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 327 refers to a dead (removed) revision in file `dam failuremechanisms/damPiping/trunk/src/Tests/Deltares.DamPiping.UpliftLocationDeterminatorTests/DeterminatorUpliftLocationTests.cs'. Fisheye: No comparison available. Pass `N' to diff?