kharm/grid.hpp
/**
 * Construct a sub-grid starting at some point in a global space
 */
Construct a sub-grid starting at some point in a global space
Construct a sub - grid starting at some point in a global space
Grid::Grid(CoordinateEmbedding* coordinates, std::vector<int> fullshape, std::vector<int> startn,
            std::vector<int> shape, std::vector<GReal> startx, std::vector<GReal> endx,
            const int ng_in, const int nvar_in)
{
    nvar = nvar_in;
    ng = ng_in;
    n1tot = fullshape[0];
    n2tot = fullshape[1];
    n3tot = fullshape[2];
    n1start = startn[0];
    n2start = startn[1];
    n3start = startn[2];
    n1 = shape[0];
    n2 = shape[1];
    n3 = shape[2];
    gn1 = n1 + 2*ng;
    gn2 = n2 + 2*ng;
    gn3 = n3 + 2*ng;
    startx1 = startx[0];
    startx2 = startx[1];
    startx3 = startx[2];
    dx1 = (endx[0] - startx1) / n1;
    dx2 = (endx[1] - startx2) / n2;
    dx3 = (endx[2] - startx3) / n3;
    coords = coordinates;
    init_grids(*this);
}
Grid :: Grid ( CoordinateEmbedding * coordinates , std :: vector < int > fullshape , std :: vector < int > startn , std :: vector < int > shape , std :: vector < GReal > startx , std :: vector < GReal > endx , const int ng_in , const int nvar_in ) { nvar = nvar_in ; ng = ng_in ; n1tot = fullshape [ 0 ] ; n2tot = fullshape [ 1 ] ; n3tot = fullshape [ 2 ] ; n1start = startn [ 0 ] ; n2start = startn [ 1 ] ; n3start = startn [ 2 ] ; n1 = shape [ 0 ] ; n2 = shape [ 1 ] ; n3 = shape [ 2 ] ; gn1 = n1 + 2 * ng ; gn2 = n2 + 2 * ng ; gn3 = n3 + 2 * ng ; startx1 = startx [ 0 ] ; startx2 = startx [ 1 ] ; startx3 = startx [ 2 ] ; dx1 = ( endx [ 0 ] - startx1 ) / n1 ; dx2 = ( endx [ 1 ] - startx2 ) / n2 ; dx3 = ( endx [ 2 ] - startx3 ) / n3 ; coords = coordinates ; init_grids ( * this ) ; }
Construct a sub-grid starting at some point in a global space
Construct a sub - grid starting at some point in a global space