diff --git a/test/poisson/CMakeLists.txt b/test/poisson/CMakeLists.txt index 844fdce8d338ebfcb59b916d21d97d87829f0d60..e1925db7fffc33641255e37ec022298ef27ea642 100644 --- a/test/poisson/CMakeLists.txt +++ b/test/poisson/CMakeLists.txt @@ -60,6 +60,18 @@ dune_add_formcompiler_system_test(UFLFILE poisson_dg_quadrilateral.ufl INIFILE poisson_dg_quadrilateral.mini ) +# 10. Poisson Test Case with a full permeability tensor +dune_add_formcompiler_system_test(UFLFILE poisson_tensor.ufl + BASENAME poisson_tensor + INIFILE poisson_tensor.mini + ) + +# 11. Poisson Test Case: DG with full permeability tensor +dune_add_formcompiler_system_test(UFLFILE poisson_dg_tensor.ufl + BASENAME poisson_dg_tensor + INIFILE poisson_dg_tensor.mini + ) + # the reference vtk file add_executable(poisson_dg_ref reference_main.cc) set_target_properties(poisson_dg_ref PROPERTIES EXCLUDE_FROM_ALL 1) diff --git a/test/poisson/poisson_dg_tensor.mini b/test/poisson/poisson_dg_tensor.mini new file mode 100644 index 0000000000000000000000000000000000000000..f3463f5c998ee7baf07904bbb31c0b0661cef230 --- /dev/null +++ b/test/poisson/poisson_dg_tensor.mini @@ -0,0 +1,17 @@ +__name = poisson_dg_tensor_{__exec_suffix} +__exec_suffix = numdiff, symdiff | expand num + +lowerleft = 0.0 0.0 +extension = 1.0 1.0 +cells = 32 32 +elementType = quadrilateral + +[wrapper.vtkcompare] +name = {__name} +reference = poisson_dg_ref +extension = vtu + +[formcompiler] +numerical_jacobian = 1, 0 | expand num +exact_solution_expression = g +compare_l2errorsquared = 2e-5 diff --git a/test/poisson/poisson_dg_tensor.ufl b/test/poisson/poisson_dg_tensor.ufl new file mode 100644 index 0000000000000000000000000000000000000000..f88ec5673658fd0b63c63b98329b90384805c24a --- /dev/null +++ b/test/poisson/poisson_dg_tensor.ufl @@ -0,0 +1,32 @@ +cell = quadrilateral + +x = SpatialCoordinate(cell) + +I = Identity(2) +A = as_matrix([[x[i]*x[j] + I[i,j] for j in range(2)] for i in range(2)]) +g = x[0]**2 + x[1]**2 +c = 8. +f = -4. + +V = FiniteElement("DG", cell, 1) + +u = TrialFunction(V) +v = TestFunction(V) + +n = FacetNormal(cell)('+') + +gamma = 1.0 +theta = -1.0 + +r = (inner(A*grad(u), grad(v)) + c*u*v)*dx \ + + inner(n, A*avg(grad(u)))*jump(v)*dS \ + + gamma*jump(u)*jump(v)*dS \ + + theta*jump(u)*inner(A*avg(grad(v)), n)*dS \ + - inner(n, A*grad(u))*v*ds \ + + gamma*u*v*ds \ + - theta*u*inner(A*grad(v), n)*ds \ + - f*v*dx \ + + theta*g*inner(A*grad(v), n)*ds \ + - gamma*g*v*ds + +forms = [r] diff --git a/test/poisson/poisson_tensor.mini b/test/poisson/poisson_tensor.mini new file mode 100644 index 0000000000000000000000000000000000000000..dd922fef55a7080284d9be134d7a1aae0dfabdce --- /dev/null +++ b/test/poisson/poisson_tensor.mini @@ -0,0 +1,17 @@ +__name = poisson_tensor_{__exec_suffix} +__exec_suffix = numdiff, symdiff | expand num + +lowerleft = 0.0 0.0 +upperright = 1.0 1.0 +elements = 32 32 +elementType = quadrilateral + +[wrapper.vtkcompare] +name = {__name} +reference = poisson_ref +extension = vtu + +[formcompiler] +numerical_jacobian = 1, 0 | expand num +exact_solution_expression = g +compare_l2errorsquared = 1e-6 diff --git a/test/poisson/poisson_tensor.ufl b/test/poisson/poisson_tensor.ufl new file mode 100644 index 0000000000000000000000000000000000000000..c8d936acb7e49dfd265c21ea6e4ea591281f679c --- /dev/null +++ b/test/poisson/poisson_tensor.ufl @@ -0,0 +1,15 @@ +cell = triangle + +x = SpatialCoordinate(cell) + +I = Identity(2) +A = as_matrix([[x[i]*x[j] + I[i,j] for j in range(2)] for i in range(2)]) +g = x[0]**2 + x[1]**2 +c = 8. +f = -4. + +V = FiniteElement("CG", cell, 1, dirichlet_expression=g) +u = TrialFunction(V) +v = TestFunction(V) + +forms = [(inner(A*grad(u), grad(v)) + c*u*v -f*v)*dx]