Some questions about external_petsc_problem1.0? #29368
-
Check these boxes if you have followed the posting rules.
QuestionQ1: What does the problem the Recently, I still study the code in ∂u/∂t - ∇·∇u – 10000v = 0 And v comes from the transferred value from the u in ∂u/∂t = ∂2u/∂x2 + ∂2u/∂y2 However, I have two questions from its other comments.
I also find similar things in the code for (j = ys; j < ys + ym; j++)
{
for (i = xs; i < xs + xm; i++)
{
nc = 0;
row.j = j;
row.i = i;
if (PETSC_TRUE && (i == 0 || i == Mx - 1 || j == 0 || j == My - 1))
{
col[nc].j = j;
col[nc].i = i;
vals[nc++] = 1.0;
}
else if (PETSC_FALSE && i == 0)
{ /* Left Neumann */
col[nc].j = j;
col[nc].i = i;
vals[nc++] = 1.0;
col[nc].j = j;
col[nc].i = i + 1;
vals[nc++] = -1.0;
}
else if (PETSC_FALSE && i == Mx - 1)
{ /* Right Neumann */
col[nc].j = j;
col[nc].i = i;
vals[nc++] = 1.0;
col[nc].j = j;
col[nc].i = i - 1;
vals[nc++] = -1.0;
}
else if (PETSC_FALSE && j == 0)
{ /* Bottom Neumann */
col[nc].j = j;
col[nc].i = i;
vals[nc++] = 1.0;
col[nc].j = j + 1;
col[nc].i = i;
vals[nc++] = -1.0;
}
else if (PETSC_FALSE && j == My - 1)
{ /* Top Neumann */
col[nc].j = j;
col[nc].i = i;
vals[nc++] = 1.0;
col[nc].j = j - 1;
col[nc].i = i;
vals[nc++] = -1.0;
}
else
{ /* Interior */
col[nc].j = j - 1;
col[nc].i = i;
vals[nc++] = -sy;
col[nc].j = j;
col[nc].i = i - 1;
vals[nc++] = -sx;
col[nc].j = j;
col[nc].i = i;
vals[nc++] = 2.0 * (sx + sy) + a;
col[nc].j = j;
col[nc].i = i + 1;
vals[nc++] = -sx;
col[nc].j = j + 1;
col[nc].i = i;
vals[nc++] = -sy;
}
ierr = MatSetValuesStencil(Jpre, 1, &row, nc, col, vals, INSERT_VALUES);
CHKERRQ(ierr);
}
} However, I find there is a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You have to look into the ExternalPetscProblem class to see what it's doing. It's doing implicit Euler for time integration. It's a finite difference diffusion problem.
See the other post. Picard iteration is from the FixedPointSolve created in the main app
Dont read too much into the comments. The code might have evolved without updating the comments. This is one of the main flaws of commenting code. |
Beta Was this translation helpful? Give feedback.
You have to look into the ExternalPetscProblem class to see what it's doing. It's doing implicit Euler for time integration.
then there is a call to
externalPETScDiffusionFDMSolve
which is defined herehttps://github.com/idaholab/moose/blob/next/modules/external_petsc_solver/src/petscsolver/PETScDiffusionFDM.C
It's a finite difference diffusion problem.
See the other post. Picard iteration is from the FixedPointSolve created in …