Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entropy-stable dg operators #922

Merged
merged 131 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
6ac55dc
Add ESDG option to examples
MTCam Jun 28, 2023
9806ec3
Use production EOS
MTCam Jun 28, 2023
c5722c8
Use production Euler operator
MTCam Jun 28, 2023
f25345b
Use production gas_model
MTCam Jun 28, 2023
8e2cf0b
Use production init
MTCam Jun 28, 2023
ee300bc
Allow driver to provide NS operator.
MTCam Jun 28, 2023
192d265
Use production inviscid module.
MTCam Jun 28, 2023
29c752f
Use production ns_operator
MTCam Jun 28, 2023
071be1b
Use production version of poiseuille and advdiff.;
MTCam Jun 29, 2023
73a6c63
factor out actx init
matthiasdiener Jun 26, 2023
b815596
typing fixes
matthiasdiener Jun 27, 2023
f95c1f0
other examples
matthiasdiener Jun 27, 2023
e6e5843
linting
matthiasdiener Jun 28, 2023
3a3b5ca
pydocstyle
matthiasdiener Jun 28, 2023
9ffb079
MPIPytatoArrayContext
matthiasdiener Jun 28, 2023
7801ca2
add mirgecom/array_context.py, refactor
matthiasdiener Jun 28, 2023
60b9983
more fixes
matthiasdiener Jun 28, 2023
fb609fe
Merge branch 'main' into entropy-stable-dg
MTCam Jun 29, 2023
825478d
fix doc issues
matthiasdiener Jun 29, 2023
6032947
Create get_box_mesh.py
aakankshbhat Jun 29, 2023
c0577f2
Use production version of lump, poiseuille-multi, test_lazy_accuracy,…
MTCam Jun 29, 2023
8508097
fix flake8
matthiasdiener Jun 29, 2023
03bb20e
Disable no member on pylint for MPI Comm.
MTCam Jun 29, 2023
016cb10
fix pylint
matthiasdiener Jun 29, 2023
5e99342
fix doc build
matthiasdiener Jun 29, 2023
176459f
enforce specifying all args to get_reasonable_array_context_class
matthiasdiener Jun 29, 2023
229071e
revert back to no-radiation
MTCam Jun 29, 2023
e4a1428
Correct placement of pylint disable?
MTCam Jun 29, 2023
36bb898
Disable pylint no-name-in-module for MPI.Comm
MTCam Jun 29, 2023
e6af90c
merge actx-init
MTCam Jun 29, 2023
661845a
Correct merge error
MTCam Jun 29, 2023
2a69446
Unduplicate args to main
MTCam Jun 30, 2023
89e97d1
Remove unsed opt
MTCam Jun 30, 2023
2999678
Update get_box_mesh.py
aakankshbhat Jun 30, 2023
4314ee3
Update get_box_mesh.py
aakankshbhat Jun 30, 2023
0297845
get_box_mesh_v2
aakankshbhat Jun 30, 2023
cfa7091
Rename get_box_mesh_v2 to get_box_mesh_v2.py
aakankshbhat Jun 30, 2023
e4d8bf8
Merge upstream changes to drivers
MTCam Jun 30, 2023
d01cb35
Update simutil.py
aakankshbhat Jun 30, 2023
7e0cfe0
Update combozzle-mpi.py to import get_box_mesh
aakankshbhat Jun 30, 2023
ae5aee3
Remove previous get_box_mesh definition
aakankshbhat Jun 30, 2023
ef60223
Fix merge issues
MTCam Jun 30, 2023
cc3e3f6
import from simutil once instead of twice
aakankshbhat Jul 3, 2023
50e2dcd
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
cbf44d3
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
72174a2
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
341964c
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
9b069bb
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
470babd
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
5a5e99d
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
f5dd63c
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
cc15390
import get_box_mesh instead of defining it
aakankshbhat Jul 3, 2023
db8666c
Documentation for get_box_mesh
aakankshbhat Jul 5, 2023
48c2c4f
Update get_box_mesh function documentation to include tagged boundary…
aakankshbhat Jul 6, 2023
ca3a5b0
Merge remote-tracking branch 'origin/main' into entropy-stable-dg
majosm Jul 7, 2023
0938d27
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
8e2698f
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
25486d7
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
31d98a9
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
813d467
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
0e63ea1
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
e861962
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
5033121
remove extra underscore in get_box_mesh
aakankshbhat Jul 7, 2023
2040682
fixing syntax errors
aakankshbhat Jul 10, 2023
7f6cd13
Reduce line length for flake8 test
aakankshbhat Jul 10, 2023
c55d3e1
fixing syntax errors
aakankshbhat Jul 10, 2023
9cb5828
Merge remote-tracking branch 'origin/main' into entropy-stable-dg
majosm Jul 11, 2023
b0203f1
Merge remote-tracking branch 'origin/main' into entropy-stable-dg
majosm Jul 13, 2023
a65a03c
restore numpy import (in the right branch this time, sigh...)
majosm Jul 13, 2023
04e4d21
Merge remote-tracking branch 'origin/main' into entropy-stable-dg
majosm Jul 15, 2023
541b67e
Whitespace and Blank line corrections
aakankshbhat Jul 15, 2023
dd58b52
Whitespace changes
aakankshbhat Jul 15, 2023
fb453c7
Whitespace and blank line corrections
aakankshbhat Jul 17, 2023
aff15be
Merge branch 'main' into esdg-mrgup
MTCam Jul 17, 2023
fad3b8b
use zeros_like in boundary.py
majosm Jul 17, 2023
8540374
actx. -> actx.np.
majosm Jul 17, 2023
fca791c
Merge remote-tracking branch 'majosm/boundary-zeros-like' into entrop…
MTCam Jul 18, 2023
13e2ed5
Merge branch 'main' into entropy-stable-dg
MTCam Jul 18, 2023
f7d9f07
whitespace corrections in documentation
aakankshbhat Jul 19, 2023
e13252b
Extra blank line corrections
aakankshbhat Jul 19, 2023
0294a26
Fixing test cases for pytest
aakankshbhat Jul 21, 2023
f85b6e6
fixing whitespace errors for flake8 test
aakankshbhat Jul 21, 2023
898a6cb
fixing boundary errors
aakankshbhat Jul 21, 2023
f11fcfd
Fixing boundary errors
aakankshbhat Jul 24, 2023
8f6e156
fixing boundary errors
aakankshbhat Jul 24, 2023
d493a0d
Merge branch 'main' into entropy-stable-dg
MTCam Jul 25, 2023
8b00f4f
add 1 to a few more boundaries in tests
majosm Jul 26, 2023
0010727
use nelements_per_axis instead of deprecated n
majosm Jul 26, 2023
af8f692
minor change to combozzle to avoid conflict with production
majosm Jul 26, 2023
5d6c9ff
Fix documentation errors
aakankshbhat Jul 31, 2023
92e42c5
Merge branch 'main' into entropy-stable-dg
MTCam Jul 31, 2023
a6527eb
Merge branch 'main' into entropy-stable-dg
MTCam Jul 31, 2023
3c454f4
Merge branch 'illinois-ceesd:main' into update_get_box_mesh
aakankshbhat Jul 31, 2023
2184573
update boundary tags for new pytest parameters
aakankshbhat Aug 1, 2023
86d4312
remove old get_box_mesh files
majosm Aug 1, 2023
2b3a0c5
minor tweaks
majosm Aug 1, 2023
17dec39
format documentation
majosm Aug 1, 2023
ccff70a
Merge branch 'update_get_box_mesh' into entropy-stable-dg
majosm Aug 1, 2023
a436f9f
Merge remote-tracking branch 'origin/main' into entropy-stable-dg
majosm Aug 2, 2023
01c54d9
Merge remote-tracking branch 'origin/entropy-stable-dg' into entropy-…
MTCam Aug 2, 2023
bee7fa6
add NumpyActx support
matthiasdiener Aug 4, 2023
2068447
add comment
matthiasdiener Aug 4, 2023
3a4b651
mypy fix
matthiasdiener Aug 4, 2023
b06955d
modify other examples
matthiasdiener Aug 4, 2023
3b01ba6
Add ESDG references
MTCam Aug 4, 2023
2320e9d
Update ESDG interfacing
MTCam Aug 4, 2023
fa32821
Harden the ESDG processing and logic
MTCam Aug 4, 2023
1dfe35d
Do entropy-stable projection when needed, and clean up stale commented
MTCam Aug 4, 2023
2996045
add simple CI test
matthiasdiener Aug 4, 2023
6d248f1
fix numpy CI
matthiasdiener Aug 4, 2023
8efd189
add missing examples
matthiasdiener Aug 7, 2023
dd1eec2
Merge branch 'main' into entropy-stable-dg
MTCam Aug 9, 2023
a81e67a
Resolve class name in docstring.
MTCam Aug 9, 2023
5a88258
Merge/add numpy context options
MTCam Aug 9, 2023
e55aae4
Use production with numpy options
MTCam Aug 9, 2023
e56e870
Use updated prediction driver.
MTCam Aug 9, 2023
eeda69e
Clean up some options issues
MTCam Aug 9, 2023
8cde003
make numpy argument optional in get_reasonable_actx
matthiasdiener Aug 9, 2023
1512be3
Merge branch 'numpyactx-support' into esdg-numpy
MTCam Aug 9, 2023
d81d9f1
Merge upstream
MTCam Aug 9, 2023
fcb6f2f
Remove superfluous arg checking.
MTCam Aug 9, 2023
88f44bc
Use real production branch
MTCam Aug 9, 2023
fcdbbd1
Merge branch 'main' into entropy-stable-dg
MTCam Aug 9, 2023
4e2caa2
Unchange EOS (for now).
MTCam Aug 16, 2023
421e113
Add minimal docs to EV conversion utils.
MTCam Aug 16, 2023
ea6f1a0
Merge branch 'main' into entropy-stable-dg
MTCam Aug 16, 2023
e7337af
Doco
MTCam Aug 17, 2023
4e52d3d
Spellos, commentos, and warnos
MTCam Aug 17, 2023
0fc33bb
Commento
MTCam Aug 17, 2023
f4df601
Use zeros_like
MTCam Aug 17, 2023
b522a47
Merge branch 'main' into entropy-stable-dg
MTCam Aug 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion doc/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@ References
.. [Giles_1988] Michael Giles (1988), Non-Reflecting Boundary Conditions for the Euler \
Equations, CFDL-TR-88-1
.. [Lachaud_2014] Jean Lachaud and Nagi Mansour (2014), Porous-Material Analysis Toolbox Based
on OpenFOAM and Applications, Journal of Thermophysics and Heat Transfer 28 2
on OpenFOAM and Applications, Journal of Thermophysics and Heat Transfer 28 2
.. [Chandrashekar_2013] Praveen Chandrashekar, Kinetic Energy Preserving and Entropy Stable Finite Volume Schemes \
for Compressible Euler and Navier-Stokes Equations, Communications in Computational Physics 14, 5 \
`(DOI) <https://doi.org/10.4208/cicp.170712.010313a>`__
.. [Renac_2021] Florent Renac, Entropy stable, robust and high-order DGSEM for the compressible multicomponent \
Euler equations, Journal of Computational Physics, 445 `(DOI) <https://doi.org/10.1016/j.jcp.2021.110584>`__
38 changes: 26 additions & 12 deletions examples/autoignition-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
from mirgecom.simutil import (
get_sim_timestep,
generate_and_distribute_mesh,
write_visfile
write_visfile,
ApplicationOptionsError
)
from mirgecom.io import make_init_message
from mirgecom.mpi import mpi_entry_point
Expand Down Expand Up @@ -74,10 +75,9 @@ class MyRuntimeError(RuntimeError):


@mpi_entry_point
def main(actx_class, use_logmgr=True,
use_leap=False, use_overintegration=False,
def main(actx_class, use_leap=False, use_overintegration=False,
casename=None, rst_filename=None, log_dependent=True,
viscous_terms_on=False):
viscous_terms_on=False, use_esdg=False):
"""Drive example."""
if casename is None:
casename = "mirgecom"
Expand All @@ -90,7 +90,7 @@ def main(actx_class, use_logmgr=True,
from mirgecom.simutil import global_reduce as _global_reduce
global_reduce = partial(_global_reduce, comm=comm)

logmgr = initialize_logmgr(use_logmgr,
logmgr = initialize_logmgr(True,
filename=f"{casename}.sqlite", mode="wu", mpi_comm=comm)

from mirgecom.array_context import initialize_actx, actx_class_is_profiling
Expand Down Expand Up @@ -584,10 +584,16 @@ def my_post_step(step, t, dt, state):

return make_obj_array([cv, fluid_state.temperature]), dt

from mirgecom.inviscid import inviscid_facial_flux_rusanov as inv_num_flux_func
from mirgecom.inviscid import (
inviscid_facial_flux_rusanov,
entropy_stable_inviscid_facial_flux_rusanov
)
from mirgecom.gas_model import make_operator_fluid_states
from mirgecom.navierstokes import ns_operator

inv_num_flux_func = entropy_stable_inviscid_facial_flux_rusanov if use_esdg \
else inviscid_facial_flux_rusanov

fluid_operator = euler_operator
if viscous_terms_on:
fluid_operator = ns_operator
Expand All @@ -606,8 +612,9 @@ def my_rhs(t, state):
fluid_rhs = fluid_operator(
dcoll, state=fluid_state, gas_model=gas_model, time=t,
boundaries=boundaries, operator_states_quad=fluid_operator_states,
quadrature_tag=quadrature_tag,
quadrature_tag=quadrature_tag, use_esdg=use_esdg,
inviscid_numerical_flux_func=inv_num_flux_func)

chem_rhs = eos.get_species_source_terms(cv, fluid_state.temperature)
tseed_rhs = fluid_state.temperature - tseed
cv_rhs = fluid_rhs + chem_rhs
Expand Down Expand Up @@ -662,8 +669,8 @@ def my_rhs(t, state):
help="turns on compressible Navier-Stokes RHS")
parser.add_argument("--profiling", action="store_true",
help="turn on detailed performance profiling")
parser.add_argument("--log", action="store_true", default=True,
help="turn on logging")
parser.add_argument("--esdg", action="store_true",
help="use flux-differencing/entropy stable DG for inviscid computations.")
parser.add_argument("--leap", action="store_true",
help="use leap timestepper")
parser.add_argument("--numpy", action="store_true",
Expand All @@ -673,6 +680,13 @@ def my_rhs(t, state):
args = parser.parse_args()
from warnings import warn
warn("Automatically turning off DV logging. MIRGE-Com Issue(578)")

if args.esdg:
if not args.lazy and not args.numpy:
raise ApplicationOptionsError("ESDG requires lazy or numpy context.")
if not args.overintegration:
warn("ESDG requires overintegration, enabling --overintegration.")

log_dependent = False
viscous_terms_on = args.navierstokes

Expand All @@ -687,9 +701,9 @@ def my_rhs(t, state):
if args.restart_file:
rst_filename = args.restart_file

main(actx_class, use_logmgr=args.log, use_leap=args.leap,
use_overintegration=args.overintegration,
casename=casename, rst_filename=rst_filename,
main(actx_class, use_leap=args.leap,
use_overintegration=args.overintegration or args.esdg,
casename=casename, rst_filename=rst_filename, use_esdg=args.esdg,
log_dependent=log_dependent, viscous_terms_on=args.navierstokes)

# vim: foldmethod=marker
74 changes: 41 additions & 33 deletions examples/combozzle-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import numpy as np
from functools import partial

from meshmode.array_context import PyOpenCLArrayContext

from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa
from grudge.shortcuts import make_visualizer
from grudge.dof_desc import BoundaryDomainTag, DISCR_TAG_QUAD
Expand All @@ -41,12 +39,14 @@
from mirgecom.euler import extract_vars_for_logging, units_for_logging
from mirgecom.euler import euler_operator
from mirgecom.navierstokes import ns_operator

from mirgecom.simutil import (
get_sim_timestep,
generate_and_distribute_mesh,
write_visfile,
force_evaluation,
get_box_mesh
get_box_mesh,
ApplicationOptionsError
)
from mirgecom.io import make_init_message
from mirgecom.mpi import mpi_entry_point
Expand Down Expand Up @@ -146,11 +146,10 @@ def __call__(self, x_vec, *, time=0.0):


@mpi_entry_point
def main(use_logmgr=True,
def main(actx_class, rst_filename=None,
use_overintegration=False, casename=None,
rst_filename=None, actx_class=PyOpenCLArrayContext,
log_dependent=False, input_file=None,
force_eval=True):
force_eval=True, use_esdg=False):
"""Drive example."""
if casename is None:
casename = "mirgecom"
Expand All @@ -171,7 +170,7 @@ def main(use_logmgr=True,

# {{{ Some discretization parameters

dim = 3
dim = 2
order = 3

# - scales the size of the domain
Expand Down Expand Up @@ -675,7 +674,7 @@ def vol_max(x):

casename = f"{casename}-d{dim}p{order}e{global_nelements}n{nparts}"

logmgr = initialize_logmgr(use_logmgr,
logmgr = initialize_logmgr(True,
filename=f"{casename}.sqlite", mode="wu", mpi_comm=comm)

if logmgr:
Expand Down Expand Up @@ -1077,7 +1076,12 @@ def my_post_step(step, t, dt, state):

return state, dt

from mirgecom.inviscid import inviscid_facial_flux_rusanov
from mirgecom.inviscid import (
inviscid_facial_flux_rusanov,
entropy_stable_inviscid_facial_flux_rusanov
)
inv_num_flux_func = entropy_stable_inviscid_facial_flux_rusanov if use_esdg \
else inviscid_facial_flux_rusanov

def dummy_pre_step(step, t, dt, state):
if logmgr:
Expand Down Expand Up @@ -1106,18 +1110,18 @@ def cfd_rhs(t, state):
from mirgecom.gas_model import make_fluid_state
fluid_state = make_fluid_state(cv=cv, gas_model=gas_model,
temperature_seed=tseed)
fluid_operator_states = make_operator_fluid_states(dcoll, fluid_state,
gas_model, boundaries,
quadrature_tag)
fluid_operator_states = make_operator_fluid_states(
dcoll, fluid_state, gas_model, boundaries, quadrature_tag=quadrature_tag)

if inviscid_only:
fluid_rhs = \
euler_operator(
dcoll, state=fluid_state, time=t,
boundaries=boundaries, gas_model=gas_model,
inviscid_numerical_flux_func=inviscid_facial_flux_rusanov,
inviscid_numerical_flux_func=inv_num_flux_func,
quadrature_tag=quadrature_tag,
operator_states_quad=fluid_operator_states)
operator_states_quad=fluid_operator_states,
use_esdg=use_esdg)
else:
grad_cv = grad_cv_operator(dcoll, gas_model, boundaries, fluid_state,
time=t,
Expand All @@ -1128,33 +1132,29 @@ def cfd_rhs(t, state):
ns_operator(
dcoll, state=fluid_state, time=t, boundaries=boundaries,
gas_model=gas_model, quadrature_tag=quadrature_tag,
inviscid_numerical_flux_func=inviscid_facial_flux_rusanov)
inviscid_numerical_flux_func=inv_num_flux_func,
operator_states_quad=fluid_operator_states,
use_esdg=use_esdg)

if inert_only:
chem_rhs = 0*fluid_rhs
else:
chem_rhs = eos.get_species_source_terms(cv, fluid_state.temperature)
if not inert_only:
fluid_rhs = fluid_rhs + eos.get_species_source_terms(
cv, fluid_state.temperature)

if av_on:
alpha_f = compute_av_alpha_field(fluid_state)
indicator = smoothness_indicator(dcoll, fluid_state.mass_density,
kappa=kappa_sc, s0=s0_sc)
av_rhs = av_laplacian_operator(
fluid_rhs = fluid_rhs + av_laplacian_operator(
dcoll, fluid_state=fluid_state, boundaries=boundaries, time=t,
gas_model=gas_model, grad_cv=grad_cv,
operator_states_quad=fluid_operator_states,
alpha=alpha_f, s0=s0_sc, kappa=kappa_sc,
indicator=indicator)
else:
av_rhs = 0*fluid_rhs

if sponge_on:
sponge_rhs = _sponge(fluid_state.cv)
else:
sponge_rhs = 0*fluid_rhs
fluid_rhs = fluid_rhs + _sponge(fluid_state.cv)

fluid_rhs = fluid_rhs + chem_rhs + av_rhs + sponge_rhs
tseed_rhs = fluid_state.temperature - tseed
tseed_rhs = actx.zeros_like(fluid_state.temperature)

return make_obj_array([fluid_rhs, tseed_rhs])

Expand Down Expand Up @@ -1245,17 +1245,25 @@ def dummy_rhs(t, state):
help="Turn off force lazy eval between timesteps")
parser.add_argument("--profiling", action="store_true",
help="turn on detailed performance profiling")
parser.add_argument("--log", action="store_true", default=True,
help="turn on logging")
parser.add_argument("--esdg", action="store_true",
help="use entropy-stable for inviscid terms")
parser.add_argument("--leap", action="store_true",
help="use leap timestepper")
parser.add_argument("--numpy", action="store_true",
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")
args = parser.parse_args()

from warnings import warn
warn("Automatically turning off DV logging. MIRGE-Com Issue(578)")

if args.esdg:
if not args.lazy and not args.numpy:
raise ApplicationOptionsError("ESDG requires lazy or numpy context.")
if not args.overintegration:
warn("ESDG requires overintegration, enabling --overintegration.")

log_dependent = False
force_eval = not args.no_force

Expand All @@ -1279,9 +1287,9 @@ def dummy_rhs(t, state):

print(f"Calling main: {time.ctime(time.time())}")

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

# vim: foldmethod=marker
31 changes: 18 additions & 13 deletions examples/doublemach-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from mirgecom.initializers import DoubleMachReflection
from mirgecom.eos import IdealSingleGas
from mirgecom.transport import SimpleTransport
from mirgecom.simutil import get_sim_timestep
from mirgecom.simutil import get_sim_timestep, ApplicationOptionsError
from logpyle import set_dt
from mirgecom.euler import extract_vars_for_logging, units_for_logging
from mirgecom.logging_quantities import (
Expand Down Expand Up @@ -115,13 +115,10 @@ def get_doublemach_mesh():


@mpi_entry_point
def main(use_logmgr=True,
def main(actx_class, use_esdg=False,
use_leap=False, use_overintegration=False,
casename=None, rst_filename=None, actx_class=None):
casename=None, rst_filename=None):
"""Drive the example."""
if actx_class is None:
raise RuntimeError("Array context class missing.")

if casename is None:
casename = "mirgecom"

Expand All @@ -130,7 +127,7 @@ def main(use_logmgr=True,
rank = comm.Get_rank()
nparts = comm.Get_size()

logmgr = initialize_logmgr(use_logmgr,
logmgr = initialize_logmgr(True,
filename=f"{casename}.sqlite", mode="wu", mpi_comm=comm)

from mirgecom.array_context import initialize_actx, actx_class_is_profiling
Expand Down Expand Up @@ -391,7 +388,8 @@ def my_rhs(t, state):
return (
euler_operator(dcoll, state=fluid_state, time=t,
boundaries=boundaries,
gas_model=gas_model, quadrature_tag=quadrature_tag)
gas_model=gas_model, quadrature_tag=quadrature_tag,
use_esdg=use_esdg)
+ av_laplacian_operator(dcoll, fluid_state=fluid_state,
boundaries=boundaries,
time=t, gas_model=gas_model,
Expand Down Expand Up @@ -437,8 +435,8 @@ def my_rhs(t, state):
help="switch to a lazy computation mode")
parser.add_argument("--profiling", action="store_true",
help="turn on detailed performance profiling")
parser.add_argument("--log", action="store_true", default=True,
help="turn on logging")
parser.add_argument("--esdg", action="store_true",
help="use flux-differencing/entropy stable DG for inviscid computations.")
parser.add_argument("--leap", action="store_true",
help="use leap timestepper")
parser.add_argument("--numpy", action="store_true",
Expand All @@ -447,6 +445,13 @@ def my_rhs(t, state):
parser.add_argument("--casename", help="casename to use for i/o")
args = parser.parse_args()

from warnings import warn
if args.esdg:
if not args.lazy and not args.numpy:
raise ApplicationOptionsError("ESDG requires lazy or numpy context.")
if not args.overintegration:
warn("ESDG requires overintegration, enabling --overintegration.")

from mirgecom.array_context import get_reasonable_array_context_class
actx_class = get_reasonable_array_context_class(lazy=args.lazy, distributed=True,
profiling=args.profiling,
Expand All @@ -459,8 +464,8 @@ def my_rhs(t, state):
if args.restart_file:
rst_filename = args.restart_file

main(use_logmgr=args.log, use_leap=args.leap,
use_overintegration=args.overintegration,
casename=casename, rst_filename=rst_filename, actx_class=actx_class)
main(actx_class, use_leap=args.leap, use_esdg=args.esdg,
use_overintegration=args.overintegration or args.esdg,
casename=casename, rst_filename=rst_filename)

# vim: foldmethod=marker
Loading