Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Seung Won Suh committed Apr 7, 2024
1 parent 3fe4299 commit 3459c78
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 9 additions & 5 deletions examples/dmd/heat_conduction_incdmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@
// Sample runs and results for DMD:
//
// Command 1:
// mpirun -np 8 heat_conduction_incdmd
// mpirun -np 8 heat_conduction_incdmd --inc
//
// Output 1:
// Residual of DMD solution is: 0.064594653
//
// Command 2:
// mpirun -np 8 heat_conduction_incdmd --noinc
//
// Output 2:
// Residual of DMD solution is: 0.064594653

//
// =================================================================================
//
// Description: This example constructs a reduced-order model for a nonlinear
// heat equation with incremental DMD. DMD predicts a provisional solution
// every time step, and if the prediction is accurate enough, it replaces the
// full-order model solution as a new snapshot. The full-order model is based
// on ex16p.cpp of MFEM.
// on ex16p.cpp of MFEM, and this example only works with backward Euler.
//

#include "mfem.hpp"
Expand Down Expand Up @@ -141,9 +148,6 @@ int main(int argc, char *argv[])
"Number of times to refine the mesh uniformly in parallel.");
args.AddOption(&order, "-o", "--order",
"Order (degree) of the finite elements.");
args.AddOption(&ode_solver_type, "-s", "--ode-solver",
"ODE solver: 1 - Backward Euler, 2 - SDIRK2, 3 - SDIRK3,\n\t"
"\t 11 - Forward Euler, 12 - RK2, 13 - RK3 SSP, 14 - RK4.");
args.AddOption(&t_final, "-tf", "--t-final",
"Final time; start time is 0.");
args.AddOption(&dt, "-dt", "--time-step",
Expand Down
8 changes: 8 additions & 0 deletions regression_tests/tests/dmd/heat_conduction_incdmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
source $GITHUB_WORKSPACE/regression_tests/common.sh
CMDS=(
"$COMMAND ./heat_conduction_incdmd --inc"
)
TYPE="DMD"
OFFSET=5
run_tests

0 comments on commit 3459c78

Please sign in to comment.