diff --git a/python/dune/perftool/pdelab/driver/instationary.py b/python/dune/perftool/pdelab/driver/instationary.py index bf8759e793cfbae9a8e8390122f1acbc75b4a2c2..7cefddb50d6a5cb2907c228dd328acbdc1db6170 100644 --- a/python/dune/perftool/pdelab/driver/instationary.py +++ b/python/dune/perftool/pdelab/driver/instationary.py @@ -118,7 +118,9 @@ def define_timesteppingmethod(name): if explicit: return "{} {};".format(tsm_type, name) else: - return "{} {}(1.0);".format(tsm_type, name) + ini = name_initree() + return "{} {}({}.get<double>(\"instat.theta\",1.0));".format(tsm_type, name, ini) + def name_timesteppingmethod(): diff --git a/python/dune/perftool/pdelab/driver/interpolate.py b/python/dune/perftool/pdelab/driver/interpolate.py index 9a79c554f37894628b45c364c129189e3714f83b..626896c11e68495ab0337ea5bcde5a8a993f4a57 100644 --- a/python/dune/perftool/pdelab/driver/interpolate.py +++ b/python/dune/perftool/pdelab/driver/interpolate.py @@ -103,7 +103,11 @@ def define_boundary_lambda(name, boundary): from dune.perftool.ufl.visitor import UFL2LoopyVisitor from dune.perftool.pdelab import PDELabInterface visitor = UFL2LoopyVisitor(PDELabInterface(), "exterior_facet", {}) + from pymbolic.mapper.c_code import CCodeMapper + ccm = CCodeMapper() + expr = visitor(boundary) + from dune.perftool.loopy.target import numpy_to_cpp_dtype return "auto {} = [&](const auto& x){{ return ({}){}; }};".format(name, numpy_to_cpp_dtype("float64"), - visitor(boundary)) + ccm(expr)) diff --git a/test/hyperbolic/linearacoustics.mini b/test/hyperbolic/linearacoustics.mini index 4b14be572516023e6fab609ee4a0ed515b98fd83..5cb5ba591a8e1e47e1ba3ed1693fb000ee5f5a62 100644 --- a/test/hyperbolic/linearacoustics.mini +++ b/test/hyperbolic/linearacoustics.mini @@ -18,7 +18,3 @@ extension = vtu [formcompiler] numerical_jacobian = 1, 0 | expand diff explicit_time_stepping = 0 -# This tests that all mass is transported out of the domain. -# While this is not the best of tests, it is something easily checked for. -#exact_solution_expression = g -#compare_l2errorsquared = 1e-10 diff --git a/test/hyperbolic/linearacoustics.ufl b/test/hyperbolic/linearacoustics.ufl index 09386752df35e0593693feefe96fbcb29b775d2d..97627f232484863617400eec74cdedfaa99bcae9 100644 --- a/test/hyperbolic/linearacoustics.ufl +++ b/test/hyperbolic/linearacoustics.ufl @@ -1,8 +1,6 @@ cell = quadrilateral x = SpatialCoordinate(cell) -#V = FiniteElement("DG", cell, 1) - MV = VectorElement("DG", cell=cell, degree=1, dim=3) n = FacetNormal(cell)('+') diff --git a/test/hyperbolic/lineartransport.mini b/test/hyperbolic/lineartransport.mini index be1a17c4887ea3938aa03983b4582e90c91cfda1..1ca4dedeb11ae71cc2d9f3f99e55306ebd9580ed 100644 --- a/test/hyperbolic/lineartransport.mini +++ b/test/hyperbolic/lineartransport.mini @@ -20,7 +20,4 @@ extension = vtu [formcompiler] numerical_jacobian = 1, 0 | expand diff explicit_time_stepping = 0, 1 | expand scheme -# This tests that all mass is transported out of the domain. -# While this is not the best of tests, it is something easily checked for. -exact_solution_expression = g compare_l2errorsquared = 1e-10 \ No newline at end of file diff --git a/test/hyperbolic/lineartransport.ufl b/test/hyperbolic/lineartransport.ufl index 116813a219cf3fe2235ad0f681b0a0c87a5bbfb6..c54388bdb98f25992e305809bd5e9012999ebc70 100644 --- a/test/hyperbolic/lineartransport.ufl +++ b/test/hyperbolic/lineartransport.ufl @@ -2,13 +2,12 @@ cell = triangle x = SpatialCoordinate(cell) initial = conditional(And(And(x[0] > 0.1, x[0] < 0.2), And(x[1] > 0.1, x[1] < 0.2)), 1, 0) -g = 0.0 dirichlet = conditional(x[0] + x[1] < 1.0, 1, 0) dsd = ds(subdomain_data=dirichlet, subdomain_id=1) dso = ds(subdomain_data=dirichlet, subdomain_id=0) -V = FiniteElement("DG", cell, 1, dirichlet_constraints=dirichlet, dirichlet_expression=initial) +V = FiniteElement("DG", cell, 1) u = TrialFunction(V) v = TestFunction(V) @@ -26,4 +25,7 @@ r = -1.*u*inner(beta, grad(v))*dx \ + inner(beta, n)*u*v*dso \ + numerical_flux(n, g, u('-'))*v*dsd -forms = [mass, r] \ No newline at end of file +forms = [mass, r] +is_dirichlet = dirichlet +dirichlet_expression = initial +exact_solution = 0 \ No newline at end of file diff --git a/test/sumfact/hyperbolic/linearacoustics.mini b/test/sumfact/hyperbolic/linearacoustics.mini index 9ac464c09493274efcad320ac2e4c969b59447f0..43090314691d619e6f9e29b7d37bd4f1b2cd4817 100644 --- a/test/sumfact/hyperbolic/linearacoustics.mini +++ b/test/sumfact/hyperbolic/linearacoustics.mini @@ -19,7 +19,3 @@ extension = vtu numerical_jacobian = 1, 0 | expand diff explicit_time_stepping = 0 sumfact = 1 -# This tests that all mass is transported out of the domain. -# While this is not the best of tests, it is something easily checked for. -#exact_solution_expression = g -#compare_l2errorsquared = 1e-10 diff --git a/test/sumfact/hyperbolic/lineartransport.mini b/test/sumfact/hyperbolic/lineartransport.mini index 81738269883a365c36ae49de9be810cf2cf882cd..08ca74767cf6df60c83cbbb803a5c1ff53d1b0c1 100644 --- a/test/sumfact/hyperbolic/lineartransport.mini +++ b/test/sumfact/hyperbolic/lineartransport.mini @@ -19,5 +19,4 @@ sumfact = 1 #fastdg = 1 # This tests that all mass is transported out of the domain. # While this is not the best of tests, it is something easily checked for. -exact_solution_expression = g compare_l2errorsquared = 1e-10 diff --git a/test/sumfact/hyperbolic/lineartransport.ufl b/test/sumfact/hyperbolic/lineartransport.ufl index 2b47ffeab86ab9971f5ed6445e18019aee11b925..e41a2dca42a51840f806a9886b95a8fb7509bd3c 100644 --- a/test/sumfact/hyperbolic/lineartransport.ufl +++ b/test/sumfact/hyperbolic/lineartransport.ufl @@ -2,13 +2,12 @@ cell = quadrilateral x = SpatialCoordinate(cell) initial = conditional(And(And(x[0] > 0.1, x[0] < 0.2), And(x[1] > 0.1, x[1] < 0.2)), 1, 0) -g = 0.0 dirichlet = conditional(x[0] + x[1] < 1.0, 1, 0) dsd = ds(subdomain_data=dirichlet, subdomain_id=1) dso = ds(subdomain_data=dirichlet, subdomain_id=0) -V = FiniteElement("DG", cell, 3, dirichlet_constraints=dirichlet, dirichlet_expression=initial) +V = FiniteElement("DG", cell, 3) u = TrialFunction(V) v = TestFunction(V) @@ -26,4 +25,7 @@ r = -1.*u*inner(beta, grad(v))*dx \ + inner(beta, n)*u*v*dso \ + numerical_flux(n, g, u('-'))*v*dsd -forms = [mass, r] \ No newline at end of file +forms = [mass, r] +exact_solution = 0.0 +is_dirichlet = dirichlet +dirichlet_expression = initial \ No newline at end of file