diff --git a/examples/advection/weak.py b/examples/advection/weak.py index 68eeafe0765ce499ec7d131de249bc9715a24ee5..85545303e4263b8024f6e497bd8b1675d608af32 100644 --- a/examples/advection/weak.py +++ b/examples/advection/weak.py @@ -28,7 +28,7 @@ logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) -def main(ctx_factory, dim=1, order=4, visualize=True): +def main(ctx_factory, dim=2, order=4, visualize=True): cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) diff --git a/requirements.txt b/requirements.txt index deb093942eb18a06631afdde454793a5da1d2fb4..4997171b7330324096e25cb177d4c543c7179ce7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ git+https://gitlab.tiker.net/inducer/dagrt.git git+https://gitlab.tiker.net/inducer/leap.git git+https://github.com/inducer/meshpy.git git+https://github.com/inducer/modepy.git -git+https://github.com/inducer/meshmode.git +# git+https://github.com/inducer/meshmode.git +git+https://gitlab.tiker.net/fikl2/meshmode.git@face-connection-1d diff --git a/test/test_grudge.py b/test/test_grudge.py index e373e1335a86a9f384b19a54bb2a8842130decc8..35f72a8dd40908803f190891c057098a65023914 100644 --- a/test/test_grudge.py +++ b/test/test_grudge.py @@ -204,18 +204,18 @@ def test_2d_gauss_theorem(ctx_factory): @pytest.mark.parametrize(("mesh_name", "mesh_pars"), [ + ("segment", [8, 16, 32]), ("disk", [0.1, 0.05]), ("rect2", [4, 8]), ("rect3", [4, 6]), ]) @pytest.mark.parametrize("op_type", ["strong", "weak"]) -@pytest.mark.parametrize("flux_type", ["upwind"]) +@pytest.mark.parametrize("flux_type", ["central"]) @pytest.mark.parametrize("order", [3, 4, 5]) # test: 'test_convergence_advec(cl._csc, "disk", [0.1, 0.05], "strong", "upwind", 3)' def test_convergence_advec(ctx_factory, mesh_name, mesh_pars, op_type, flux_type, order, visualize=False): """Test whether 2D advection actually converges""" - cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) @@ -223,7 +223,16 @@ def test_convergence_advec(ctx_factory, mesh_name, mesh_pars, op_type, flux_type eoc_rec = EOCRecorder() for mesh_par in mesh_pars: - if mesh_name == "disk": + if mesh_name == "segment": + from meshmode.mesh.generation import generate_box_mesh + mesh = generate_box_mesh( + [np.linspace(-1.0, 1.0, mesh_par)], + order=order) + + h = 2.0 / mesh_par + dim = 1 + dt_factor = 1.0 + elif mesh_name == "disk": pytest.importorskip("meshpy") from meshpy.geometry import make_circle, GeometryBuilder @@ -241,7 +250,6 @@ def test_convergence_advec(ctx_factory, mesh_name, mesh_pars, op_type, flux_type h = np.sqrt(mesh_par) dim = 2 dt_factor = 4 - elif mesh_name.startswith("rect"): dim = int(mesh_name[4:]) from meshmode.mesh.generation import generate_regular_rect_mesh