From 4654506a4c2b417e76099eaa24c58f6b7841ff2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de> Date: Mon, 5 Dec 2016 16:35:44 +0100 Subject: [PATCH] Add mini and ufl for opcount example --- test/poisson/opcount_poisson_dg_symdiff.mini | 14 ++++++++++ test/poisson/poisson_dg_quadrilateral.ufl | 27 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 test/poisson/opcount_poisson_dg_symdiff.mini create mode 100644 test/poisson/poisson_dg_quadrilateral.ufl diff --git a/test/poisson/opcount_poisson_dg_symdiff.mini b/test/poisson/opcount_poisson_dg_symdiff.mini new file mode 100644 index 00000000..e87f17a5 --- /dev/null +++ b/test/poisson/opcount_poisson_dg_symdiff.mini @@ -0,0 +1,14 @@ +__name = opcount_poisson_dg_symdiff + +cells = 32 32 +extension = 1. 1. + +[wrapper.vtkcompare] +name = {__name} +extension = vtu + +[formcompiler] +exact_solution_expression = g +compare_dofs = 1e-1 +compare_l2errorsquared = 1e-4 +opcounter = 1 \ No newline at end of file diff --git a/test/poisson/poisson_dg_quadrilateral.ufl b/test/poisson/poisson_dg_quadrilateral.ufl new file mode 100644 index 00000000..1ca65e1e --- /dev/null +++ b/test/poisson/poisson_dg_quadrilateral.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] -- GitLab