override public void initialize()
        {
            setProblemClass();

            int total_nodes = this.Ranks.Length;

            maxcells = Convert.ToInt32(Math.Sqrt(total_nodes));
            ncells   = Convert.ToInt32(Math.Sqrt(total_nodes));

            MAX_CELL_DIM     = (problem_size / maxcells) + 1;
            IMAX             = JMAX = KMAX = MAX_CELL_DIM;
            _grid_points_[0] = _grid_points_[1] = _grid_points_[2] = problem_size;
            IMAXP            = IMAX / 2 * 2 + 1;
            JMAXP            = JMAX / 2 * 2 + 1;

            set_constants(0, dt_default);

            U.initialize_field("u", maxcells, KMAX + 4, JMAXP + 4, IMAXP + 4, 5);
            Rhs.initialize_field("rhs", maxcells, KMAX + 2, JMAXP + 2, IMAXP + 2, 5);
            Lhs.initialize_field("lhs", maxcells, KMAX + 2, JMAXP + 2, IMAXP + 2, 15);
            Forcing.initialize_field("forcing", maxcells, KMAX + 2, JMAXP + 2, IMAXP + 2, 5);

            Us.initialize_field("us", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Vs.initialize_field("vs", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Ws.initialize_field("ws", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Qs.initialize_field("qs", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Ainv.initialize_field("ainv", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Rho.initialize_field("rho", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Speed.initialize_field("speed", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);
            Square.initialize_field("square", maxcells, KMAX + 3, JMAX + 3, IMAX + 3);

            //Lhsa.initialize_field("lhsa", maxcells, KMAX+2, JMAXP+2, IMAXP+2, 15);
            //Lhsb.initialize_field("lhsb", maxcells, KMAX+2, JMAXP+2, IMAXP+2, 15);
            //Lhsc.initialize_field("lhsc", maxcells, KMAX+2, JMAXP+2, IMAXP+2, 15);
        }
Ejemplo n.º 2
0
 private void setAinvcol(int j, double[] x)
 {
     for (int i = 1; i <= n; i++)
     {
         Ainv.sm(i, j, x[i - 1]);
     }
 }