From b2887ab0cba51fa21d887dc1f87396d119369ec1 Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Tue, 13 Dec 2016 10:54:19 +0100 Subject: [PATCH] Address all the comments --- .../loopy/transformations/collect_rotate.py | 2 +- python/dune/perftool/sumfact/sumfact.py | 5 +--- python/dune/perftool/sumfact/switch.py | 2 +- test/poisson/opcount_poisson_dg.ufl | 27 +++++++++++++++++++ test/poisson/poisson_dg_quadrilateral.mini | 14 ++++++++++ 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 test/poisson/opcount_poisson_dg.ufl create mode 100644 test/poisson/poisson_dg_quadrilateral.mini diff --git a/python/dune/perftool/loopy/transformations/collect_rotate.py b/python/dune/perftool/loopy/transformations/collect_rotate.py index 510075c9..f37b5df0 100644 --- a/python/dune/perftool/loopy/transformations/collect_rotate.py +++ b/python/dune/perftool/loopy/transformations/collect_rotate.py @@ -17,7 +17,7 @@ from loopy.kernel.creation import parse_domains from loopy.symbolic import pw_aff_to_expr from loopy.match import Tagged -from pymbolic.mapper.dependency import DependencyMapper +from loopy.symbolic import DependencyMapper import pymbolic.primitives as prim import loopy as lp diff --git a/python/dune/perftool/sumfact/sumfact.py b/python/dune/perftool/sumfact/sumfact.py index afae030a..b038e763 100644 --- a/python/dune/perftool/sumfact/sumfact.py +++ b/python/dune/perftool/sumfact/sumfact.py @@ -131,10 +131,7 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id): a_matrices, buffer, input, index = get_vectorization_info(a_matrices, restriction) # Initialize a base storage for this buffer and get a temporay pointing to it - try: - shape = tuple(mat.cols for mat in a_matrices if mat.cols != 1) - except: - from pudb import set_trace; set_trace() + shape = tuple(mat.cols for mat in a_matrices if mat.cols != 1) dim_tags = ",".join(['f'] * local_dimension()) if index is not None: shape = shape + (4,) diff --git a/python/dune/perftool/sumfact/switch.py b/python/dune/perftool/sumfact/switch.py index 4fa63064..d2361c3b 100644 --- a/python/dune/perftool/sumfact/switch.py +++ b/python/dune/perftool/sumfact/switch.py @@ -56,7 +56,7 @@ def decide_if_kernel_is_necessary(facedir_s, facemod_s, facedir_n, facemod_n): if not get_option("diagonal_transformation_matrix"): return True - # A codim1 entity is can never be on the upper resp. lower side of the ref element + # A codim1 entity can never be on the upper resp. lower side of the ref element # in both inside and outside cell in a YaspGrid if facemod_n == facemod_s: return False diff --git a/test/poisson/opcount_poisson_dg.ufl b/test/poisson/opcount_poisson_dg.ufl new file mode 100644 index 00000000..1ca65e1e --- /dev/null +++ b/test/poisson/opcount_poisson_dg.ufl @@ -0,0 +1,27 @@ +cell = "quadrilateral" + +f = Expression("return -2.0*x.size();", cell=cell) +g = Expression("return x.two_norm2();", on_intersection=True, cell=cell) + +V = FiniteElement("DG", cell, 1) + +u = TrialFunction(V) +v = TestFunction(V) + +n = FacetNormal(cell)('+') + +gamma = 1.0 +theta = 1.0 + +r = inner(grad(u), grad(v))*dx \ + + inner(n, avg(grad(u)))*jump(v)*dS \ + + gamma*jump(u)*jump(v)*dS \ + + theta*jump(u)*inner(avg(grad(v)), n)*dS \ + - inner(n, grad(u))*v*ds \ + + gamma*u*v*ds \ + - theta*u*inner(grad(v), n)*ds \ + - f*v*dx \ + + theta*g*inner(grad(v), n)*ds \ + - gamma*g*v*ds + +forms = [r] diff --git a/test/poisson/poisson_dg_quadrilateral.mini b/test/poisson/poisson_dg_quadrilateral.mini new file mode 100644 index 00000000..2cb4d1d2 --- /dev/null +++ b/test/poisson/poisson_dg_quadrilateral.mini @@ -0,0 +1,14 @@ +__name = poisson_dg_quadrilateral_{__exec_suffix} +__exec_suffix = numdiff, symdiff | expand num + +extension = 1.0 1.0 +cells = 32 32 + +[wrapper.vtkcompare] +name = {__name} +extension = vtu + +[formcompiler] +numerical_jacobian = 1, 0 | expand num +exact_solution_expression = g +compare_l2errorsquared = 2e-5 -- GitLab