示例#1
0
        public void TestCalculate_RDFWeightFunction()
        {
            RDFCalculator calculator = new RDFCalculator(0.0, 5.0, 0.1, 0.0, Returns1);
            AtomContainer h2mol      = new AtomContainer();
            Atom          h1         = new Atom("H")
            {
                Point3D = new Vector3(-0.5, 0.0, 0.0)
            };
            Atom h2 = new Atom("H")
            {
                Point3D = new Vector3(0.5, 0.0, 0.0)
            };

            h2mol.Atoms.Add(h1);
            h2mol.Atoms.Add(h2);

            double[] rdf1 = calculator.Calculate(h2mol, h1);
            double[] rdf2 = calculator.Calculate(h2mol, h2);

            // test whether the double array length is ok
            Assert.AreEqual(51, rdf1.Length);

            // test whether the RDFs are identical
            Assert.AreEqual(rdf1.Length, rdf2.Length);
            for (int i = 0; i < rdf1.Length; i++)
            {
                Assert.AreEqual(rdf1[i], rdf2[i], 0.00001);
            }
        }
示例#2
0
        public void TestRDFCalculator_double_double_double_double_RDFWeightFunction()
        {
            RDFCalculator calculator = new RDFCalculator(0.0, 5.0, 0.1, 0.0, Returns1);

            Assert.IsNotNull(calculator);
        }
示例#3
0
        public void TestRDFCalculator_double_double_double_double()
        {
            RDFCalculator calculator = new RDFCalculator(0.0, 5.0, 0.1, 0.0);

            Assert.IsNotNull(calculator);
        }