Esempio n. 1
0
        public void TestIndecesForRepeatedNodesAtBoundares()
        {
            var a   = new LinearCycledLonsAvgProcessing(Build360AxisBoundariesRepeated(), true);
            var ips = a.GetIPsForPoint(3.5);

            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(3, ips.Indices[0]);
            Assert.AreEqual(4, ips.Indices[1]);

            ips = a.GetIPsForPoint(-0.5);
            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(359, ips.Indices[0]);
            Assert.IsTrue(0 == ips.Indices[1] || 360 == ips.Indices[1]);

            ips = a.GetIPsForPoint(-1.5);
            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(358, ips.Indices[0]);
            Assert.AreEqual(359, ips.Indices[1]);

            ips = a.GetIPsForCell(-0.5, 0.5);
            Assert.AreEqual(3, ips.Indices.Length);
            Assert.AreEqual(359, ips.Indices[0]);
            Assert.IsTrue(0 == ips.Indices[1] || 360 == ips.Indices[1]);
            Assert.AreEqual(1, ips.Indices[2]);
        }