Exemple #1
0
        bool ReadFromGRDECL(SpecGrid specGrid, MapAxes mapAxes, string file)
        {
            double[] values = GRDECLReader.Array(file, grdecl_kw_coord);
            if (values.Count() == 0)
            {
                return(false);
            }
            if (values.Count() != 2 * 3 * (specGrid.NX + 1) * (specGrid.NY + 1))
            {
                return(false);
            }
            //Init(specGrid.NX, specGrid.NX, 50f, 50f);
            Pillars = new Pillar[specGrid.NX + 1, specGrid.NY + 1];
            int n = 0;

            for (int j = 0; j < specGrid.NY + 1; ++j)
            {
                for (int i = 0; i < specGrid.NX + 1; ++i)
                {
                    double xt = values[n++];
                    double yt = values[n++];
                    double zt = values[n++];
                    double xb = values[n++];
                    double yb = values[n++];
                    double zb = values[n++];
                    Pillars[i, j] = new Pillar(xt, yt, zt, xb, yb, zb);
                }
            }
            MapAxes = mapAxes;
            return(true);
        }
Exemple #2
0
        bool ReadFromGRDECL(SpecGrid specGrid, string file)
        {
            double[] values = GRDECLReader.Array(file, grdecl_kw_actnum);
            if (values.Count() == 0)
            {
                return(false);
            }
            if (values.Count() != specGrid.NX * specGrid.NY * specGrid.NZ)
            {
                return(false);
            }
            Init(specGrid.NX, specGrid.NY, specGrid.NZ);
            int n = 0;

            for (int k = 0; k < specGrid.NZ; ++k)
            {
                for (int j = 0; j < specGrid.NY; ++j)
                {
                    for (int i = 0; i < specGrid.NX; ++i)
                    {
                        Values[i, j, k] = (values[n++] == 0f) ? false : true;
                    }
                }
            }
            return(true);
        }
Exemple #3
0
        bool ReadGRDECL(int nx, int ny, int nz, string kw, string file)
        {
            Title = kw;
            double[] values = GRDECLReader.Array(file, kw);
            if (values.Count() == 0)
            {
                return(false);
            }
            if (values.Count() != nx * ny * nz)
            {
                return(false);
            }
            Values = new double[nx, ny, nz];
            int n = 0;

            for (int k = 0; k < nz; ++k)
            {
                for (int j = 0; j < ny; ++j)
                {
                    for (int i = 0; i < nx; ++i)
                    {
                        Values[i, j, k] = values[n++];
                    }
                }
            }
            UpdateScale();
            return(true);
        }
Exemple #4
0
        bool ReadFromGRDECL(SpecGrid specGrid, string file)
        {
            double[] values = GRDECLReader.Array(file, grdecl_kw_zcorn);
            if (values.Count() == 0)
            {
                return(false);
            }
            if (values.Count() != 2 * specGrid.NX * 2 * specGrid.NY * 2 * specGrid.NZ)
            {
                return(false);
            }
            Init(specGrid.NX, specGrid.NY, specGrid.NZ);
            int n      = 0;
            int c_last = 2;
            int jloop  = 1;
            int kloop  = 1;

            for (int k = 0; k < specGrid.NZ; ++k)
            {
                for (int j = 0; j < specGrid.NY; ++j)
                {
                    for (int i = 0; i < specGrid.NX; ++i)
                    {
                        for (int c = c_last - 2; c < c_last; ++c)
                        {
                            Items[i, j, k].Corners[c] = values[n++];
                        }
                    }
                    if (jloop == 1)
                    {
                        jloop   = 2;
                        c_last += 2;
                        --j;
                    }
                    else
                    {
                        jloop   = 1;
                        c_last -= 2;
                    }
                }
                if (kloop == 1)
                {
                    kloop   = 2;
                    c_last += 4;
                    --k;
                }
                else
                {
                    kloop   = 1;
                    c_last -= 4;
                }
            }
            return(true);
        }