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

Port the stokes tests

parent b036bdd1
No related branches found
No related tags found
No related merge requests found
......@@ -16,5 +16,4 @@ zeroThreshold.data_1 = 1e-6
[formcompiler]
numerical_jacobian = 0, 1 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-8
......@@ -2,8 +2,6 @@ cell = triangle
x = SpatialCoordinate(cell)
g_v = as_vector((4*x[1]*(1.-x[1]), 0.0))
g_p = 8*(1.-x[0])
g = (g_v, g_p)
bctype = conditional(x[0] < 1. - 1e-8, 1, 0)
P2 = VectorElement("DG", cell, 2)
......@@ -35,3 +33,4 @@ r = inner(grad(u), grad(v))*dx \
- q*inner(g_v, n)*ds
forms = [r]
exact_solution = g_v, 8*(1.-x[0])
\ No newline at end of file
......@@ -11,5 +11,4 @@ extension = vtu
[formcompiler]
numerical_jacobian = 0, 1 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-8
......@@ -2,8 +2,6 @@ cell = quadrilateral
x = SpatialCoordinate(cell)
g_v = as_vector((4*x[1]*(1.-x[1]), 0.0))
g_p = 8*(1.-x[0])
g = (g_v, g_p)
bctype = conditional(x[0] < 1. - 1e-8, 1, 0)
P2 = VectorElement("DG", cell, 2)
......@@ -35,3 +33,4 @@ r = inner(grad(u), grad(v))*dx \
- q*inner(g_v, n)*ds
forms = [r]
exact_solution = g_v, 8*(1.-x[0])
......@@ -12,5 +12,4 @@ extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-10
......@@ -3,10 +3,8 @@ cell = quadrilateral
x = SpatialCoordinate(cell)
v_bctype = conditional(x[0] < 1. - 1e-8, 1, 0)
g_v = as_vector((4.*x[1]*(1.-x[1]), 0.0))
g_p = 8.*(1.-x[0])
g = (g_v, g_p)
P2 = VectorElement("Lagrange", cell, 2, dirichlet_constraints=v_bctype, dirichlet_expression=g_v)
P2 = VectorElement("Lagrange", cell, 2)
P1 = FiniteElement("Lagrange", cell, 1)
TH = P2 * P1
......@@ -16,3 +14,6 @@ u, p = TrialFunctions(TH)
r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx
forms = [r]
is_dirichlet = v_bctype, v_bctype, 0
dirichlet_expression = g_v, None
exact_solution = g_v, 8.*(1.-x[0])
......@@ -17,5 +17,4 @@ extension = vtu
[formcompiler]
# numerical_jacobian = 0, 1 | expand num
numerical_jacobian = 1
exact_solution_expression = g
compare_l2errorsquared = 1e-11
......@@ -2,10 +2,9 @@ v_bctype = Expression("if (x[0] < 1. - 1e-8) return 1; else return 0;", on_inter
g_v = Expression(("4*x[1]*(1.-x[1])", "0.0"))
g_p = Expression("8*(1.-x[0])")
g_S = Expression(("0.0", "0.0", "-8*x[1] + 4.", "0.0"))
g = g_v * g_p * g_S
cell = triangle
P2 = VectorElement("Lagrange", cell, 2, dirichlet_constraints=v_bctype, dirichlet_expression=g_v)
P2 = VectorElement("Lagrange", cell)
P1 = FiniteElement("Lagrange", cell, 1)
P2_stress = TensorElement("DG", cell, 1)
......@@ -17,3 +16,6 @@ u, p, S = TrialFunctions(TH)
r = (inner(grad(v), S) + inner(grad(u) - S, T) - div(v)*p - q*div(u))*dx
forms = [r]
is_dirichlet = v_bctype, v_bctype, 0, 0, 0, 0, 0
dirichlet_expression = g_v, None, None, None, None, None, None
exact_solution = g_v, g_p, g_S
\ No newline at end of file
......@@ -14,5 +14,4 @@ extension = vtu
[formcompiler]
numerical_jacobian = 1
exact_solution_expression = g
compare_l2errorsquared = 1e-6
......@@ -2,10 +2,9 @@ v_bctype = Expression("if (x[0] < 1. - 1e-8) return 1; else return 0;", on_inter
g_v = Expression(("4*x[1]*(1.-x[1])", "0.0"))
g_p = Expression("8*(1.-x[0])")
g_S = Expression(("0.0", "-8*x[1] + 4.", "0.0"))
g = g_v * g_p * g_S
cell = triangle
P2 = VectorElement("Lagrange", cell, 2, dirichlet_constraints=v_bctype, dirichlet_expression=g_v)
P2 = VectorElement("Lagrange", cell, 2)
P1 = FiniteElement("Lagrange", cell, 1)
P2_stress = TensorElement("DG", cell, 1, symmetry={(0, 1): (1, 0)})
......@@ -23,3 +22,6 @@ r = (inner(grad(v), S) + inner(2*sym(grad(u)) - S, T) - div(v)*p - q*div(u))*dx
# + inner(S.T*n, v)*ds
forms = [r]
is_dirichlet = v_bctype, v_bctype, 0, 0, 0, 0
dirichlet_expression = g_v, None, None, None, None, None
exact_solution = g_v, g_p, g_S
\ No newline at end of file
......@@ -14,7 +14,4 @@ extension = vtu
[formcompiler]
numerical_jacobian = 0, 1 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-11
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)
P2 = VectorElement("Lagrange", cell, 2)
P1 = FiniteElement("Lagrange", cell, 1)
TH = P2 * P1
......@@ -18,3 +15,6 @@ 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]
is_dirichlet = v_bctype, v_bctype, 0
dirichlet_expression = g_v, None
exact_solution = g_v, 8.*(1.-x[0])
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