Skip to content

Commit

Permalink
Add options for TPE and example, grad test. (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam authored Feb 15, 2024
1 parent 8a7eb26 commit 3466be3
Show file tree
Hide file tree
Showing 5 changed files with 432 additions and 20 deletions.
11 changes: 7 additions & 4 deletions examples/combozzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __call__(self, x_vec, *, time=0.0):


@mpi_entry_point
def main(actx_class, rst_filename=None,
def main(actx_class, rst_filename=None, use_tpe=False,
use_overintegration=False, casename=None,
log_dependent=False, input_file=None,
force_eval=True, use_esdg=False):
Expand Down Expand Up @@ -602,7 +602,7 @@ def main(actx_class, rst_filename=None,
rst_order = restart_data["order"]
else: # generate the grid from scratch
generate_mesh = partial(get_box_mesh, dim, a=box_ll, b=box_ur, n=nels_axis,
periodic=periodic)
periodic=periodic, tensor_product_elements=use_tpe)

local_mesh, global_nelements = generate_and_distribute_mesh(comm,
generate_mesh)
Expand All @@ -612,7 +612,8 @@ def main(actx_class, rst_filename=None,
if grid_only:
return 0

dcoll = create_discretization_collection(actx, local_mesh, order)
dcoll = create_discretization_collection(actx, local_mesh, order,
tensor_product_elements=use_tpe)
nodes = actx.thaw(dcoll.nodes())
ones = dcoll.zeros(actx) + 1.0

Expand Down Expand Up @@ -1251,6 +1252,8 @@ def dummy_rhs(t, state):
help="use numpy-based eager actx.")
parser.add_argument("--restart_file", help="root name of restart file")
parser.add_argument("--casename", help="casename to use for i/o")
parser.add_argument("--tpe", action="store_true",
help="Use tensor product elements (quads/hexes).")
args = parser.parse_args()

from warnings import warn
Expand Down Expand Up @@ -1287,7 +1290,7 @@ def dummy_rhs(t, state):

main(actx_class, input_file=input_file,
use_overintegration=args.overintegration or args.esdg,
casename=casename, rst_filename=rst_filename,
casename=casename, rst_filename=rst_filename, use_tpe=args.tpe,
log_dependent=log_dependent, force_eval=force_eval, use_esdg=args.esdg)

# vim: foldmethod=marker
Loading

0 comments on commit 3466be3

Please sign in to comment.