Closed bishtgautam closed 3 years ago
mpiexec-openmpi-gcc8 -n 2 ./richards_driver -dim 3 -Nx 100 -Ny 100 -Nz 10 -tdy_water_density exponential -final_time 1.e0
: Crashedmpiexec-openmpi-gcc8 -n 4 ./richards_driver -dim 3 -Nx 100 -Ny 100 -Nz 10 -tdy_water_density exponential -final_time 1.e0
: Worked fineThe error can be reproduced on a smaller domain via:
nx=2;ny=5;nz=10; mpiexec -n 2 \
./richards_driver -dim 3 -Nx $nx -Ny $ny -Nz $nz -tdy_water_density exponential -final_time 1.e0
The error is because DMPlex is using a star stencil, but we need to use a box stencil.
@knepley How can I tell DMPlex to use box stencil instead of star stencil? Here is the code that I'm using to set 1 DOF at cell centers:
ierr = PetscSectionCreate(comm, &sec); CHKERRQ(ierr);
ierr = PetscSectionSetNumFields(sec, 1); CHKERRQ(ierr);
ierr = PetscSectionSetFieldName(sec, 0, "LiquidPressure"); CHKERRQ(ierr);
ierr = PetscSectionSetFieldComponents(sec, 0, 1); CHKERRQ(ierr);
ierr = DMPlexGetHeightStratum(dm,0,&pStart,&pEnd); CHKERRQ(ierr);
ierr = PetscSectionSetChart(sec,pStart,pEnd); CHKERRQ(ierr);
for(p=pStart; p<pEnd; p++) {
ierr = PetscSectionSetFieldDof(sec,p,0,1); CHKERRQ(ierr);
ierr = PetscSectionSetDof(sec,p,1); CHKERRQ(ierr);
}
ierr = PetscSectionSetUp(sec); CHKERRQ(ierr);
ierr = DMSetSection(dm,sec); CHKERRQ(ierr);
ierr = PetscSectionViewFromOptions(sec, NULL, "-layout_view"); CHKERRQ(ierr);
ierr = PetscSectionDestroy(&sec); CHKERRQ(ierr);
ierr = DMSetBasicAdjacency(dm,PETSC_TRUE,PETSC_TRUE); CHKERRQ(ierr);
On Thu, Oct 8, 2020 at 12:46 PM Gautam Bisht notifications@github.com wrote:
The error is because DMPlex is using a star stencil, but we need to use a box stencil.
@knepley https://github.com/knepley How can I tell DMPlex to use box stencil instead of star stencil? Here is the code that I'm using to set 1 DOF at cell centers:
ierr = PetscSectionCreate(comm, &sec); CHKERRQ(ierr); ierr = PetscSectionSetNumFields(sec, 1); CHKERRQ(ierr); ierr = PetscSectionSetFieldName(sec, 0, "LiquidPressure"); CHKERRQ(ierr); ierr = PetscSectionSetFieldComponents(sec, 0, 1); CHKERRQ(ierr);
ierr = DMPlexGetHeightStratum(dm,0,&pStart,&pEnd); CHKERRQ(ierr); ierr = PetscSectionSetChart(sec,pStart,pEnd); CHKERRQ(ierr); for(p=pStart; p<pEnd; p++) { ierr = PetscSectionSetFieldDof(sec,p,0,1); CHKERRQ(ierr); ierr = PetscSectionSetDof(sec,p,1); CHKERRQ(ierr); } ierr = PetscSectionSetUp(sec); CHKERRQ(ierr); ierr = DMSetSection(dm,sec); CHKERRQ(ierr); ierr = PetscSectionViewFromOptions(sec, NULL, "-layout_view"); CHKERRQ(ierr); ierr = PetscSectionDestroy(&sec); CHKERRQ(ierr); ierr = DMSetBasicAdjacency(dm,PETSC_TRUE,PETSC_TRUE); CHKERRQ(ierr);
This is a box stencil. A star would be TRUE: FALSE.
https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMSetBasicAdjacency.html
You can see the sparsity pattern using
-mat_view draw -draw_pause -1
Thanks,
Matt
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TDycores-Project/TDycore/issues/93#issuecomment-705693062, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEORCMX222QOG7KBEX4COLSJXUH3ANCNFSM4SHZH7QQ .
-- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ http://www.cse.buffalo.edu/~knepley/
Thanks @knepley. You were correct that the existing stencil was a box stencil. The error was because the code wasn't skipping non-local vertices.
@jeff-cohere reported the model failure here