Example #1
0
        public static int FindCorrespondingBackgroundLayerIndex(ISection1D <Layer1D> section1D, IAnomalyLayer anomalyLayer)
        {
            var start = anomalyLayer.Depth;
            var end   = anomalyLayer.Depth + anomalyLayer.Thickness;

            return(FindCorrespondingBackgroundLayerIndex(section1D, start, end));
        }
Example #2
0
        //=> 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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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();
        }
Example #6
0
        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));
        }
Example #7
0
 public NonMeshedModel(ISection1D <Layer1D> section1D)
 {
     Section1D  = section1D;
     _anomalies = new List <NonMeshedAnomaly>();
 }
Example #8
0
        public static T FindCorrespondingBackgroundLayer <T>(ISection1D <T> section1D, IAnomalyLayer anomalyLayer) where T : Layer1D
        {
            var index = FindCorrespondingBackgroundLayerIndex(section1D, anomalyLayer);

            return(section1D[index]);
        }