Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Jan 18, 2025
1 parent 3cec6c7 commit 972d7e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
13 changes: 9 additions & 4 deletions tests/functional/harris/harris_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
time_step_nbr = 1000
time_step = 0.001
final_time = time_step * time_step_nbr
dt = 10 * time_step
nt = final_time / dt + 1
timestamps = dt * np.arange(nt)


def default_timestamps():
dt = 10 * time_step
nt = final_time / dt + 1
timestamps = dt * np.arange(nt)


def default_setup():
Expand All @@ -45,9 +48,11 @@ def default_setup():
)


def config(sim = None, seed = 12334):
def config(sim = None, timestamps = None, seed = 12334):
if not sim:
sim = default_setup()
if not timestamps:
timestamps = default_timestamps()

def density(x, y):
L = sim.simulation_domain()[1]
Expand Down
5 changes: 1 addition & 4 deletions tests/functional/harris/harris_2d_100_x_100.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
time_step = 0.005
timestamps = np.arange(0, final_time + time_step, final_time / 5)

if cpp.mpi_rank() == 0:
print(LOAD_BALANCE, "diag timestamps:", timestamps)

diag_dir = "phare_outputs/harris_2d_100_x_100"
plot_dir = Path(f"{diag_dir}_plots")
plot_dir.mkdir(parents=True, exist_ok=True)
Expand All @@ -66,7 +63,7 @@ def config():
},
)

sim = base.config(sim)
sim = base.config(sim, timestamps)

for quantity in ["density", "bulkVelocity"]:
ph.FluidDiagnostics(quantity=quantity, write_timestamps=timestamps)
Expand Down

0 comments on commit 972d7e2

Please sign in to comment.