using System; using System.Collections.Generic; namespace Deltares.Stability.Calculation.Inner { public class TGeotextiles { private double FBackUpMoment = 0; private double FETS = 0; private double FLengthL = 0; private double FLengthOfReductionZone = 0; private double FLengthR = 0; private double FMobPerc = 0; private double FSMob = 0; private string FTextileName = String.Empty; private List FXCoords = new List(); private List FZCoords = new List(); private double embeddingLength; private List intersectionPoints = new List(); private double mobilizedEmbTensileStr; private double moment = 0; public TGeotextiles() : base() { // TODO: Add any constructor code here } public string TextileName { get { return FTextileName; } set { FTextileName = value; } } public double ETS { get { return FETS; } set { FETS = value; } } public double MobPerc { get { return FMobPerc; } } public double SMob { get { return FSMob; } set { FSMob = value; } } public double LengthL { get { return FLengthL; } set { FLengthL = value; } } public double LengthR { get { return FLengthR; } set { FLengthR = value; } } public List XCoords { get { return FXCoords; } } public List ZCoords { get { return FZCoords; } } public double LengthOfReductionZone { get { return FLengthOfReductionZone; } set { FLengthOfReductionZone = value; } } // For output purposes public double BackupMoment { get { return FBackUpMoment; } } // Private Declarations // Input public double EmbeddingLength { get { return embeddingLength; } } public double MobilizedEmbTensileStr { get { return mobilizedEmbTensileStr; } } /// /// contribution of the geotextile on the resisting moment /// public double Moment { get { return moment; } } /// /// intersention points of geotextile and sliding plane /// public List IntersectionPoints { get { return intersectionPoints; } } public void Addpoint(double Ax, double Az) { FXCoords.Add(Ax); FZCoords.Add(Az); } public double GetGeotextilesMoment(double Xmid, double Zmid, double Radius, double ADrivingMom) { double result; int i; double Xs1 = 0; double ys1 = 0; double xs2 = 0; double ys2 = 0; // x en y coor snijpunten cirkel met geotextiel int NIntersect; // het aantal snijpunten double Distance; // de afstand punt - geotextiel double LXActive; double LZActive; double LLengthL; double LLengthR; double LMobPerc; mobilizedEmbTensileStr = 0; int LTotintersect; int LNPoints; double LXStart; double LXEnd; double LZStart; double LZEnd; var LXIntersect = new List(); var LYIntersect = new List(); result = 0; NIntersect = 0; // initialisation : no intersection points LTotintersect = 0; // find intersection points of the geotextile and the circle LNPoints = FXCoords.Count; for (i = 0; i <= LNPoints - 2; i ++) { LXStart = XCoords[i]; LXEnd = XCoords[i + 1]; LZStart = ZCoords[i]; LZEnd = ZCoords[i + 1]; MStabDatafunctions.Intersect_Circle_line(Xmid, Zmid, Radius, LXStart, LXEnd, LZStart, LZEnd, ref NIntersect, ref Xs1, ref ys1, ref xs2, ref ys2); LTotintersect = LTotintersect + NIntersect; if ((NIntersect > 0)) { // fill the inersect coordinates depending on the number of intersects var point2D = new TPoints(Xs1, ys1); if ((NIntersect == 1)) { LXIntersect.Add(Xs1); LYIntersect.Add(ys1); if (!intersectionPoints.Contains(point2D)) { intersectionPoints.Add(point2D); } } if ((NIntersect == 2)) { LXIntersect.Add(Xs1); LYIntersect.Add(ys1); if (!intersectionPoints.Contains(point2D)) { intersectionPoints.Add(point2D); } LXIntersect.Add(xs2); LYIntersect.Add(ys2); var intPoint2 = new TPoints(xs2, ys2); if (!intersectionPoints.Contains(intPoint2)) { intersectionPoints.Add(intPoint2); } } } MStabDatafunctions.RemoveDoubleIntersectionPoints(LXIntersect, LYIntersect); } if ((LTotintersect == 2)) { // kijk welk punt maatgevend is (afhankelijk van het moment trek of stuik if ((ADrivingMom > 0)) { LXActive = Math.Min(LXIntersect[0], LXIntersect[1]); } else { LXActive = Math.Max(LXIntersect[0], LXIntersect[1]); } // zoek ook de bijbehorende y op if ((Math.Abs(LXActive - LXIntersect[0]) < 1.0E-5)) { LZActive = LYIntersect[0]; } else { LZActive = LYIntersect[1]; } // bepaal de arm midelpunt to textiel Distance = MStabDatafunctions.DistanceToLine(Xmid, Zmid, LXIntersect[0], LYIntersect[0], LXIntersect[1], LYIntersect[1]); if ((Distance > Radius)) { Distance = 0; } // get maximum embedding lenght LXStart = XCoords[0]; LXEnd = XCoords[FXCoords.Count - 1]; LZStart = ZCoords[0]; LZEnd = ZCoords[FZCoords.Count - 1]; LLengthL = MStabDatafunctions.Distance2D(LXActive, LZActive, LXStart, LZStart); LLengthR = MStabDatafunctions.Distance2D(LXActive, LZActive, LXEnd, LZEnd); embeddingLength = Math.Min(LLengthL, LLengthR); LMobPerc = Math.Min(MobilisedPercentage(LLengthL), MobilisedPercentage(LLengthR)); // right side from intersectionpoint mobilizedEmbTensileStr = LMobPerc*FETS; result = Distance*mobilizedEmbTensileStr; } else { if ((LTotintersect == 1)) { if (((ADrivingMom > 0) && (LXIntersect[0] < Xmid)) || ((ADrivingMom < 0) && (LXIntersect[0] > Xmid))) { LXStart = XCoords[0]; LXEnd = XCoords[FXCoords.Count - 1]; LZStart = ZCoords[0]; LZEnd = ZCoords[FZCoords.Count - 1]; // snijpunt ligt in actieve gedeelte LXActive = Xs1; LZActive = ys1; // bepaal de arm midelpunt to textiel Distance = MStabDatafunctions.DistanceToLine(Xmid, Zmid, LXStart, LZStart, LXEnd, LZEnd); if (Distance > Radius) { Distance = 0; } // get maximum embedding lenght LLengthL = MStabDatafunctions.Distance2D(LXActive, LZActive, LXStart, LZStart); LLengthR = MStabDatafunctions.Distance2D(LXActive, LZActive, LXEnd, LZEnd); embeddingLength = Math.Min(LLengthL, LLengthR); LMobPerc = Math.Min(MobilisedPercentage(LLengthR), MobilisedPercentage(LLengthL)); // right side from intersectionpoint mobilizedEmbTensileStr = LMobPerc*FETS; result = Distance*mobilizedEmbTensileStr; } } } moment = result; return result; } private double MobilisedPercentage(double ALength) { double result; // Minimum lenght=0, always 100% mobilisation if ((Math.Abs(FLengthOfReductionZone) < 0.001)) { result = 1; } else { result = Math.Min(ALength, FLengthOfReductionZone)/FLengthOfReductionZone; } return result; } } // end TGeotextiles }