예제 #1
0
        //        public double ucrt(int x, int y, int z)
        //{
        //    int ucrt_index = Array.IndexOf(variables_name, "UCRT");
        //    return vars_phi[x, y, z, ucrt_index];
        //}
        //public double[] ucrt(int x, int y)
        //{
        //    ///inserire exeptions
        //    int ucrt_index = Array.IndexOf(variables_name, "UCRT");
        //    double[] arr = new double[z_high_cell_face.Length];
        //    for (int i = 0; i < arr.Length; i++)
        //    {
        //        arr[i] = vars_phi[x, y, i, ucrt_index];
        //    }
        //    return arr;
        //}
        ////public double z0(int x, int y)
        ////{
        ////    int len = z_high_cell_face.Length;
        ////    double[] logz = new double[len];
        ////    double[] u = ucrt(x, y);
        ////    for (int i = 0; i < len; i++)
        ////    {
        ////        double zcen;
        ////        if (i == 0) zcen = z_high_cell_face[i] / 2;
        ////        else zcen = z_high_cell_face[i] - z_high_cell_face[i - 1];
        ////        logz[i] = Math.Log(zcen);
        ////    }
        ////}
        public WindField(WSProject project ,int settore)
        {
            // inistialize phi and xyz

            string  phi_file = project.file.DirectoryName + "\\windfield\\" + settore + "_red.phi";
            string  xyz_file = project.file.DirectoryName + "\\windfield\\" + settore + "_red.xyz";

            FileInfo phi_file_check = new FileInfo(phi_file);
            FileInfo xyz_file_check = new FileInfo(xyz_file);

            // check if required files exists

            if (phi_file_check.Exists && xyz_file_check.Exists)
            {
                phi = new PhiFile(phi_file);
                xyz = new XYZFile(xyz_file);
            }
            else
            {
                phi = null;
                xyz = null;
            }
        }
예제 #2
0
 public void WindField_constructor_phi()
 {
     FileInfo phi_file = new FileInfo(phi_file270_path);
     PhiFile expected = new PhiFile(phi_file.FullName);
     Assert.IsTrue(expected.Equals(target.phi));
 }
예제 #3
0
 public void test_project_fill_phifiles_on_construct()
 {
     WSProject project = new WSProject(project_file.FullName);
     PhiFile settore_270 = new PhiFile(phifile270_path);
     Assert.IsTrue(project.WField[270].phi.Equals(settore_270)); //remeber that Phifile equals do not compare vars_phi[,,,] !
     // should test if the file do not exist project_fill_phifiles_on_construct()
 }
예제 #4
0
 //(object obj)
 public bool Equals(PhiFile other)
 {
     return (FileName.FullName == other.FileName.FullName) &&
            (cartes == other.cartes) &&
            (onephs == other.onephs) &&
            (bfc == other.bfc) &&
            (xcycle == other.xcycle) &&
            (ccm == other.ccm) &&
            (nx == other.nx) &&
            (ny == other.ny) &&
            (nz == other.nz) &&
            (nphi == other.nphi) &&
            (den1 == other.den1) &&
            (den2 == other.den2) &&
            (epor == other.epor) &&
            (npor == other.npor) &&
            (hpor == other.hpor) &&
            (vpor == other.vpor) &&
            (lenrec == other.lenrec) &&
            (numblk == other.numblk) &&
            (nmatst == other.nmatst) &&
            (nfmak1 == other.nfmak1) &&
            (rinner == other.rinner) &&
            (f_nprphi == other.f_nprphi) &&
            (f_nfmak2 == other.f_nfmak2) &&
            (rdmat1 == other.rdmat1) &&
            (f_idmat2 == other.f_idmat2) &&
            Enumerable.SequenceEqual(all_variables_name, other.all_variables_name) &&
            Enumerable.SequenceEqual(x_east_cell_face, other.x_east_cell_face) &&
            Enumerable.SequenceEqual(y_north_cell_face, other.y_north_cell_face) &&
            Enumerable.SequenceEqual(z_high_cell_face, other.z_high_cell_face) &&
            Enumerable.SequenceEqual(slab_mean_pressure_correction, other.slab_mean_pressure_correction) &&
            Enumerable.SequenceEqual(variables_name, other.variables_name);
            //&& Enumerable.SequenceEqual(vars_phi, other.vars_phi);
 }