Skip to content
Snippets Groups Projects
Commit 4bbea759 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Add a symmetrized CG stokes example

parent ed81ca1b
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,11 @@ dune_add_formcompiler_system_test(UFLFILE stokes.ufl
INIFILE stokes.mini
)
dune_add_formcompiler_system_test(UFLFILE stokes_sym.ufl
BASENAME stokes_sym
INIFILE stokes_sym.mini
)
dune_add_formcompiler_system_test(UFLFILE stokes_dg.ufl
BASENAME stokes_dg
INIFILE stokes_dg.mini
......
__name = stokes_sym_{__exec_suffix}
__exec_suffix = symdiff, numdiff | expand num
lowerleft = 0.0 0.0
upperright = 1.0 1.0
elements = 16 16
elementType = simplical
printmatrix = false
[wrapper.vtkcompare]
name = {__name}
reference = hagenpoiseuille_ref
extension = vtu
[formcompiler]
numerical_jacobian = 0, 1 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-6
print_transformations = True
print_transformations_dir = .
v_bctype = Expression("if (x[0] < 1. - 1e-8) return 1; else return 0;", on_intersection=True)
g_v = Expression(("4*x[1]*(1.-x[1])", "0.0"))
g_p = Expression("8*(1.-x[0])")
g = g_v * g_p
cell = triangle
P2 = VectorElement("Lagrange", cell, 2, dirichlet_constraints=v_bctype, dirichlet_expression=g_v)
P1 = FiniteElement("Lagrange", cell, 1)
TH = P2 * P1
v, q = TestFunctions(TH)
u, p = TrialFunctions(TH)
ds = ds(subdomain_data=v_bctype, subdomain_id=0)
n = FacetNormal(triangle)('+')
r = (inner(2*sym(grad(u)), grad(v)) - div(v)*p - q*div(u))*dx - inner(grad(u).T*n,v)*ds
forms = [r]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment