<commit_before>static char help[] = "Solves a 3D structured-grid Poisson problem with DMDA\n"
"and SNES.\n\n";

/* in this version, these work:
  ./fish3 -snes_fd
*/

#include <petsc.h>

typedef struct {
  DM        da;
  PetscReal hx, hy, hz;
  Vec       f;
} Ctx;


PetscErrorCode formRHS(DMDALocalInfo *info, Ctx *usr) {
    PetscErrorCode ierr;
    PetscInt       i, j, k;
    //PetscReal      x, y, z;
    PetscReal      ***af;

    ierr = DMDAVecGetArray(usr->da, usr->f, &af);CHKERRQ(ierr);
    for (k=info->zs; k<info->zs+info->zm; k++) {
        //z = k * usr->hz;
        for (j=info->ys; j<info->ys+info->ym; j++) {
            //y = j * usr->hy;
            for (i=info->xs; i<info->xs+info->xm; i++) {
                //x = i * usr->hx;
                af[k][j][i] = 1.0;<commit_msg>Minor: runtime notes.<commit_after>static char help[] = "Solves a 3D structured-grid Poisson problem with DMDA\n"
"and SNES.\n\n";

/* in this version, these work:
  ./fish3 -snes_monitor -ksp_monitor
  ./fish3 -snes_monitor -ksp_monitor -pc_type lu
  ./fish3 -snes_monitor -ksp_monitor -ksp_type cg -pc_type icc
  ./fish3 -snes_monitor -ksp_monitor -snes_fd
*/

#include <petsc.h>

typedef struct {
  DM        da;
  PetscReal hx, hy, hz;
  Vec       f;
} Ctx;


PetscErrorCode formRHS(DMDALocalInfo *info, Ctx *usr) {
    PetscErrorCode ierr;
    PetscInt       i, j, k;
    //PetscReal      x, y, z;
    PetscReal      ***af;

    ierr = DMDAVecGetArray(usr->da, usr->f, &af);CHKERRQ(ierr);
    for (k=info->zs; k<info->zs+info->zm; k++) {
        //z = k * usr->hz;
        for (j=info->ys; j<info->ys+info->ym; j++) {
            //y = j * usr->hy;
            for (i=info->xs; i<info->xs+info->xm; i++) {
                //x = i * usr->hx;
                af[k][j][i] = 1.0;
{'fraction_non_alphanumeric': 0.17736486486486486, 'fraction_numerical': 0.006193693693693694, 'mean_word_length': 2.0850694444444446, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1620867', 'n_tokens_mistral': 752, 'n_tokens_neox': 736, 'n_words': 172}