public static int FindCorrespondingBackgroundLayerIndex(ISection1D <Layer1D> section1D, IAnomalyLayer anomalyLayer) { var start = anomalyLayer.Depth; var end = anomalyLayer.Depth + anomalyLayer.Thickness; return(FindCorrespondingBackgroundLayerIndex(section1D, start, end)); }
//=> new Complex((sigma + omega * Epsilon0), -omega * Epsilon0); public static Complex[] GetAllSection1DZeta(this ISection1D <IsotropyLayer> section1D) { var result = new Complex[section1D.NumberOfLayers]; for (int i = 0; i < result.Length; i++) { result[i] = section1D[i].Zeta; } return(result); }
private static Complex[] GetBackgroundZeta(IAnomaly anomaly, ISection1D <IsotropyLayer> section1D) { var zeta0 = new Complex[anomaly.Layers.Count]; for (int k = 0; k < anomaly.Layers.Count; k++) { zeta0[k] = ModelUtils.FindCorrespondingBackgroundLayer(section1D, anomaly.Layers[k]).Zeta; } return(zeta0); }
public static decimal[] GetBackgroundLayerDepths(ISection1D <Layer1D> section1D) { var backgroundDepths = new decimal[section1D.NumberOfLayers]; backgroundDepths[0] = section1D.ZeroAirLevelAlongZ; for (int i = 0; i < section1D.NumberOfLayers - 1; i++) { backgroundDepths[i + 1] = backgroundDepths[i] + section1D[i].Thickness; } return(backgroundDepths); }
public static int FindCorrespondingBackgroundLayerIndex(ISection1D <Layer1D> section1D, decimal start, decimal end) { decimal ss = section1D.ZeroAirLevelAlongZ; for (int i = 0; i < section1D.NumberOfLayers; i++) { var layer = section1D[i]; var es = ss + layer.Thickness; if (start >= ss && end <= es) { return(i); } ss = es; } throw new InvalidOperationException(); }
public static AlphaBeta CreateFrom(ISection1D <IsotropyLayer> section1D) { int numberOf1DLayers = section1D.NumberOfLayers; var zeta = section1D.GetAllSection1DZeta(); var alpha1 = Enumerable.Repeat(Complex.One, numberOf1DLayers).ToArray(); var beta1 = Enumerable.Repeat(Complex.One, numberOf1DLayers).ToArray(); var alphaSigma = new Complex[numberOf1DLayers]; var betaSigma = new Complex[numberOf1DLayers]; for (int k = 0; k < numberOf1DLayers - 1; k++) { alphaSigma[k] = zeta[k + 1] / zeta[k]; } for (int k = 1; k < numberOf1DLayers; k++) { betaSigma[k] = zeta[k - 1] / zeta[k]; } return(new AlphaBeta(alpha1, beta1, alphaSigma, betaSigma)); }
public NonMeshedModel(ISection1D <Layer1D> section1D) { Section1D = section1D; _anomalies = new List <NonMeshedAnomaly>(); }
public static T FindCorrespondingBackgroundLayer <T>(ISection1D <T> section1D, IAnomalyLayer anomalyLayer) where T : Layer1D { var index = FindCorrespondingBackgroundLayerIndex(section1D, anomalyLayer); return(section1D[index]); }