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

Add stokes dg test case

parent 65481737
No related branches found
No related tags found
No related merge requests found
......@@ -14,3 +14,8 @@ add_generated_executable(UFLFILE stokes_dg.ufl
TARGET stokes_dg_numdiff
FORM_COMPILER_ARGS --numerical-jacobian
)
dune_add_system_test(TARGET stokes_dg_numdiff
INIFILE stokes_dg_numdiff.mini
SCRIPT dune_vtkcompare.py
)
File added
g = VectorExpression("Dune::FieldVector<double, 2> y(0.0); y[0]=4*x[1]*(1.-x[1]); return y;", on_intersection=True)
bctype = Expression("if (x[0] < 1. - 1e-8) return 1; else return 0;", on_intersection=True)
cell = triangle
P2 = VectorElement("Lagrange", cell, 2)
P1 = FiniteElement("Lagrange", cell, 1)
P2 = VectorElement("DG", cell, 2)
P1 = FiniteElement("DG", cell, 1)
TH = P2 * P1
v, q = TestFunctions(TH)
u, p = TrialFunctions(TH)
ds = ds(subdomain_id=1, subdomain_data=bctype)
n = FacetNormal(cell)('+')
eps = -1.0
sigma = 1.0
r = inner(grad(u), grad(v))*dx \
- inner(avg(grad(u))*n, jump(v))*dS \
+ eps * inner(avg(grad(v))*n, jump(u))*dS \
+ inner(avg(grad(u))*n, jump(v))*dS \
- eps * inner(avg(grad(v))*n, jump(u))*dS \
- inner(grad(u)*n, v)*ds \
+ eps * inner(grad(v)*n, u)*ds \
+ eps * inner(grad(v)*n, u-g)*ds \
+ sigma * inner(jump(u), jump(v))*dS \
+ sigma * inner(u, v)*ds \
+ sigma * inner(u-g, v)*ds \
- p*div(v)*dx \
- q*div(u)*dx \
+ avg(p)*inner(jump(v), n)*dS \
+ avg(q)*inner(jump(u), n)*dS \
- avg(p)*inner(jump(v), n)*dS \
+ p*inner(v, n)*ds \
+ q*inner(u, n)*ds
- q*div(u)*dx \
- avg(q)*inner(jump(u), n)*dS \
+ q*inner(u, n)*ds \
- q*inner(g, n)*ds
forms = [r]
__name = stokes_dg_numdiff
lowerleft = 0.0 0.0
upperright = 1.0 1.0
elements = 16 16
elementType = simplical
printmatrix = false
[wrapper.vtkcompare]
name = {__name}
reference = hagenpoiseuille_dg_ref
extension = vtu
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