Ejemplo n.º 1
0
        static void Nf2ffToVtk()
        {
            var nf2ff = new NF2FF(1e9, "ref_3D_pattern.h5");

            // Assume openEMS and NF2FF are run and 3D_Pattern.h5 is available
            nf2ff.ReadHDF5Result();
            nf2ff.ToVTK(fileName: "dut_3D_pattern.vtk");
        }
 public void NF2FF_GenerateVtkDump_MatchesReference()
 {
     var nf2ff = new NF2FF(1e9, "ref_3D_pattern_patch.h5");
     nf2ff.ReadHDF5Result();
     nf2ff.ToVTK(fileName: "dut_3D_pattern.vtk");
 }
Ejemplo n.º 3
0
        static void Nf2ffToVtk()
        {
            var nf2ff = new NF2FF(1e9, "ref_3D_pattern.h5");

            // Assume openEMS and NF2FF are run and 3D_Pattern.h5 is available
            nf2ff.ReadHDF5Result();
            nf2ff.ToVTK(fileName: "dut_3D_pattern.vtk");
        }
        public void NF2FF_Generate2DInputXml_MatchesReference()
        {
            var nf2ff = new NF2FF(2400e6);
            nf2ff.SetPolarMesh2D();

            XElement dutNf2ffXml = nf2ff.ToXDocument().Element("nf2ff");
            XElement refNf2ffXml = XDocument.Load("ref_nf2ff_2d_input.xml").Element("nf2ff");;

            double[] dutTheta = (from l in dutNf2ffXml.Element("theta").Value.Split(',') select Double.Parse(l)).ToArray();
            double[] refTheta = (from l in refNf2ffXml.Element("theta").Value.Split(',') select Double.Parse(l)).ToArray();
            for (int i = 0; i < dutTheta.Length; i++)
            {
                Assert.Equal(refTheta[i], dutTheta[i], 12);
            }

            double[] dutPhi = (from l in dutNf2ffXml.Element("theta").Value.Split(',') select Double.Parse(l)).ToArray();
            double[] refPhi = (from l in refNf2ffXml.Element("theta").Value.Split(',') select Double.Parse(l)).ToArray();
            for (int i = 0; i < dutTheta.Length; i++)
            {
                Assert.Equal(refPhi[i], dutPhi[i], 12);
            }
        }