Skip to content

Commit

Permalink
add advection outflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Nov 13, 2020
1 parent ba2c60d commit 86d0f16
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tst/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ if (ENABLE_HDF5)
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/output_hdf5/parthinput.advection \
--num_steps 4")
list(APPEND EXTRA_TEST_LABELS "")

list(APPEND TEST_DIRS advection_outflow)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/advection/advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/advection_outflow/parthinput.advection_outflow")
list(APPEND EXTRA_TEST_LABELS "")
endif()

# Any external modules that are required by python can be added to REQUIRED_PYTHON_MODULES
Expand Down
Empty file.
53 changes: 53 additions & 0 deletions tst/regression/test_suites/advection_outflow/advection_outflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#========================================================================================
# Parthenon performance portable AMR framework
# Copyright(C) 2020 The Parthenon collaboration
# Licensed under the 3-clause BSD License, see LICENSE file for details
#========================================================================================
# (C) (or copyright) 2020. Triad National Security, LLC. All rights reserved.
#
# This program was produced under U.S. Government contract 89233218CNA000001 for Los
# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC
# for the U.S. Department of Energy/National Nuclear Security Administration. All rights
# in the program are reserved by Triad National Security, LLC, and the U.S. Department
# of Energy/National Nuclear Security Administration. The Government is granted for
# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
# license in this material to reproduce, prepare derivative works, distribute copies to
# the public, perform publicly and display publicly, and to permit others to do so.
#========================================================================================

# Modules
import math
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pylab as plt
import sys
import os
import utils.test_case

""" To prevent littering up imported folders with .pyc files or __pycache_ folder"""
sys.dont_write_bytecode = True

class TestCase(utils.test_case.TestCaseAbs):
def Prepare(self, parameters, step):

parameters.coverage_status = "both"
return parameters

def Analyse(self, parameters):

sys.path.insert(1, parameters.parthenon_path + '/scripts/python')

try:
from phdf_diff import compare
except ModuleNotFoundError:
print("Couldn't find module to compare Parthenon hdf5 files.")
return False

delta = compare([
'outflow.out0.00001.phdf',
parameters.parthenon_path + '/tst/regression/gold_standard/outflow.out0.00001.phdf'])

return delta == 0

return True
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# ========================================================================================
# Athena++ astrophysical MHD code
# Copyright(C) 2014 James M. Stone <[email protected]> and other code contributors
# Licensed under the 3-clause BSD License, see LICENSE file for details
# ========================================================================================
# (C) (or copyright) 2020. Triad National Security, LLC. All rights reserved.
#
# This program was produced under U.S. Government contract 89233218CNA000001 for Los
# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC
# for the U.S. Department of Energy/National Nuclear Security Administration. All rights
# in the program are reserved by Triad National Security, LLC, and the U.S. Department
# of Energy/National Nuclear Security Administration. The Government is granted for
# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
# license in this material to reproduce, prepare derivative works, distribute copies to
# the public, perform publicly and display publicly, and to permit others to do so.
# ========================================================================================

<parthenon/job>
problem_id = outflow

<parthenon/mesh>
refinement = adaptive
numlevel = 2

nx1 = 64
x1min = -0.5
x1max = 0.5
ix1_bc = outflow
ox1_bc = outflow

nx2 = 64
x2min = -0.5
x2max = 0.5
ix2_bc = outflow
ox2_bc = outflow

nx3 = 1
x3min = -0.5
x3max = 0.5
ix3_bc = outflow
ox3_bc = outflow

<parthenon/meshblock>
nx1 = 16
nx2 = 16
nx3 = 1

<parthenon/time>
tlim = 0.5
integrator = rk2

<Advection>
cfl = 0.45
vx = 1.0
vy = 1.0
vz = 0.0
profile = hard_sphere

refine_tol = 0.3 # control the package specific refinement tagging function
derefine_tol = 0.03
compute_error = false
num_vars = 1 # number of variables in variable vector

<parthenon/output0>
file_type = hdf5
dt = 0.5
variables = advected

0 comments on commit 86d0f16

Please sign in to comment.