Skip to content

Commit

Permalink
Merge branch 'bishtgautam/dmplex' (PR #7)
Browse files Browse the repository at this point in the history
Adds demo using DMPlex
  • Loading branch information
bishtgautam committed Nov 15, 2022
2 parents 290c18d + aa040fb commit 2805d44
Show file tree
Hide file tree
Showing 5 changed files with 1,317 additions and 13 deletions.
1 change: 1 addition & 0 deletions swe_roe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ex2
6 changes: 3 additions & 3 deletions swe_roe/ex1.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ PetscErrorCode RHSFunction(TS ts, PetscReal t, Vec X, Vec F, void *ptr) {

if (save == 1) {
char fname[PETSC_MAX_PATH_LEN];
sprintf(fname, "outputs/ex1_Nx_%d_Ny_%d_dt_%f_%d.dat", user->Nx, user->Ny, user->dt, user->tstep);
sprintf(fname, "outputs/ex1_Nx_%d_Ny_%d_dt_%f_%d.dat", user->Nx, user->Ny, user->dt, user->tstep - 1);

PetscViewer viewer;
PetscCall(PetscViewerBinaryOpen(user->comm, fname, FILE_MODE_WRITE, &viewer));
Expand Down Expand Up @@ -597,7 +597,7 @@ int main(int argc, char **argv) {
user->Nx = user->Lx / user->dx;
user->Ny = user->Ly / user->dy;
user->Nt = user->max_time / user->dt;
PetscPrintf(user->comm, "Max simulation time is %f\n", user->max_time);
PetscPrintf(user->comm, "Max simulation time is %f; \n", user->max_time);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
* Initialize DMDA
Expand Down Expand Up @@ -698,7 +698,7 @@ int main(int argc, char **argv) {

if (user->save == 2) {
char fname[PETSC_MAX_PATH_LEN];
sprintf(fname, "outputs/ex1_Nx_%d_Ny_%d_dt_%f_%d.dat", user->Nx, user->Ny, user->dt, user->Nt);
sprintf(fname, "outputs/ex1_Nx_%d_Ny_%d_dt_%f_%d.dat", user->Nx, user->Ny, user->dt, user->tstep);

PetscViewer viewer;
PetscCall(PetscViewerBinaryOpen(user->comm, fname, FILE_MODE_WRITE, &viewer));
Expand Down
Loading

0 comments on commit 2805d44

Please sign in to comment.