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

dirichlet_expression -> interpolate_expression

There is way more reasons to interpolate a function into the
solution vector and we cover them with one code path:
* Dirichlet boundary conditions (strong ones)
* Initial conditions for instationary expressions
* Initial guesses for Newton solvers
parent 5081753a
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 18 deletions
...@@ -11,4 +11,4 @@ v = TestFunction(V) ...@@ -11,4 +11,4 @@ v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx] forms = [(inner(grad(u), grad(v)) - f*v)*dx]
exact_solution = g exact_solution = g
is_dirichlet = 1 is_dirichlet = 1
dirichlet_expression = g interpolate_expression = g
...@@ -11,4 +11,4 @@ v = TestFunction(V) ...@@ -11,4 +11,4 @@ v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx] forms = [(inner(grad(u), grad(v)) - f*v)*dx]
exact_solution = g exact_solution = g
is_dirichlet = 1 is_dirichlet = 1
dirichlet_expression = g interpolate_expression = g
...@@ -11,4 +11,4 @@ v = TestFunction(V) ...@@ -11,4 +11,4 @@ v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx] forms = [(inner(grad(u), grad(v)) - f*v)*dx]
exact_solution = g exact_solution = g
is_dirichlet = 1 is_dirichlet = 1
dirichlet_expression = g interpolate_expression = g
...@@ -13,5 +13,5 @@ v = TestFunction(V) ...@@ -13,5 +13,5 @@ v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx] forms = [(inner(grad(u), grad(v)) - f*v)*dx]
exact_solution = g exact_solution = g
dirichlet_expression = g interpolate_expression = g
is_dirichlet = 1 is_dirichlet = 1
\ No newline at end of file
...@@ -19,4 +19,4 @@ ds = ds(subdomain_data=bctype) ...@@ -19,4 +19,4 @@ ds = ds(subdomain_data=bctype)
forms = [(inner(grad(u), grad(v)) - f*v)*dx - j*v*ds(0)] forms = [(inner(grad(u), grad(v)) - f*v)*dx - j*v*ds(0)]
exact_solution = g exact_solution = g
is_dirichlet = bctype is_dirichlet = bctype
dirichlet_expression = g interpolate_expression = g
\ No newline at end of file \ No newline at end of file
...@@ -15,4 +15,4 @@ v = TestFunction(V) ...@@ -15,4 +15,4 @@ v = TestFunction(V)
forms = [(inner(A*grad(u), grad(v)) + c*u*v -f*v)*dx] forms = [(inner(A*grad(u), grad(v)) + c*u*v -f*v)*dx]
exact_solution = g exact_solution = g
is_dirichlet = 1 is_dirichlet = 1
dirichlet_expression = g interpolate_expression = g
\ No newline at end of file \ No newline at end of file
...@@ -15,5 +15,5 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx ...@@ -15,5 +15,5 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx
forms = [r] forms = [r]
is_dirichlet = v_bctype, v_bctype, 0 is_dirichlet = v_bctype, v_bctype, 0
dirichlet_expression = g_v, None interpolate_expression = g_v, None
exact_solution = g_v, 8.*(1.-x[0]) exact_solution = g_v, 8.*(1.-x[0])
\ No newline at end of file
...@@ -16,4 +16,4 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx ...@@ -16,4 +16,4 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx
forms = [r] forms = [r]
exact_solution = g_v, 8.*(1.-x[0]) exact_solution = g_v, 8.*(1.-x[0])
is_dirichlet = v_bctype, v_bctype, v_bctype, 0 is_dirichlet = v_bctype, v_bctype, v_bctype, 0
dirichlet_expression = g_v, None interpolate_expression = g_v, None
...@@ -15,5 +15,5 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx ...@@ -15,5 +15,5 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx
forms = [r] forms = [r]
is_dirichlet = v_bctype, v_bctype, 0 is_dirichlet = v_bctype, v_bctype, 0
dirichlet_expression = g_v, None interpolate_expression = g_v, None
exact_solution = g_v, 8.*(1.-x[0]) exact_solution = g_v, 8.*(1.-x[0])
...@@ -16,5 +16,5 @@ r = (inner(grad(v), S) + inner(grad(u) - S, T) - div(v)*p - q*div(u))*dx ...@@ -16,5 +16,5 @@ r = (inner(grad(v), S) + inner(grad(u) - S, T) - div(v)*p - q*div(u))*dx
forms = [r] forms = [r]
is_dirichlet = v_bctype, v_bctype, 0, 0, 0, 0, 0 is_dirichlet = v_bctype, v_bctype, 0, 0, 0, 0, 0
dirichlet_expression = 4*x[1]*(1.-x[1]), 0.0, None, None, None, None, None interpolate_expression = 4*x[1]*(1.-x[1]), 0.0, None, None, None, None, None
exact_solution = 4*x[1]*(1.-x[1]), 0.0, 8*(1.-x[0]), 0.0, 0.0, -1.*8*x[1] + 4., 0.0 exact_solution = 4*x[1]*(1.-x[1]), 0.0, 8*(1.-x[0]), 0.0, 0.0, -1.*8*x[1] + 4., 0.0
\ No newline at end of file
...@@ -22,5 +22,5 @@ r = (inner(grad(v), S) + inner(2*sym(grad(u)) - S, T) - div(v)*p - q*div(u))*dx ...@@ -22,5 +22,5 @@ r = (inner(grad(v), S) + inner(2*sym(grad(u)) - S, T) - div(v)*p - q*div(u))*dx
forms = [r] forms = [r]
is_dirichlet = v_bctype, v_bctype, 0, 0, 0, 0 is_dirichlet = v_bctype, v_bctype, 0, 0, 0, 0
dirichlet_expression = 4*x[1]*(1.-x[1]), 0.0, None, None, None, None interpolate_expression = 4*x[1]*(1.-x[1]), 0.0, None, None, None, None
exact_solution = 4*x[1]*(1.-x[1]), 0.0, 8*(1.-x[0]), 0.0, 0.0, -1.*8*x[1] + 4. exact_solution = 4*x[1]*(1.-x[1]), 0.0, 8*(1.-x[0]), 0.0, 0.0, -1.*8*x[1] + 4.
\ No newline at end of file
...@@ -18,5 +18,5 @@ r = (inner(2*sym(grad(u)), grad(v)) - div(v)*p - q*div(u))*dx - inner(grad(u).T* ...@@ -18,5 +18,5 @@ r = (inner(2*sym(grad(u)), grad(v)) - div(v)*p - q*div(u))*dx - inner(grad(u).T*
forms = [r] forms = [r]
is_dirichlet = v_bctype, v_bctype, 0 is_dirichlet = v_bctype, v_bctype, 0
dirichlet_expression = g_v, None interpolate_expression = g_v, None
exact_solution = g_v, 8.*(1.-x[0]) exact_solution = g_v, 8.*(1.-x[0])
\ No newline at end of file
...@@ -29,4 +29,4 @@ r = -1. * inner(flux, grad(v))*dx \ ...@@ -29,4 +29,4 @@ r = -1. * inner(flux, grad(v))*dx \
+ inner(u, v)*ds + inner(u, v)*ds
forms = [mass, r] forms = [mass, r]
dirichlet_expression = f, 0.0, 0.0 interpolate_expression = f, 0.0, 0.0
...@@ -28,4 +28,4 @@ r = -1.*u*inner(beta, grad(v))*dx \ ...@@ -28,4 +28,4 @@ r = -1.*u*inner(beta, grad(v))*dx \
forms = [mass, r] forms = [mass, r]
exact_solution = 0.0 exact_solution = 0.0
is_dirichlet = dirichlet is_dirichlet = dirichlet
dirichlet_expression = initial interpolate_expression = initial
\ No newline at end of file \ No newline at end of file
...@@ -36,4 +36,4 @@ r = -1. * inner(flux, grad(v))*dx \ ...@@ -36,4 +36,4 @@ r = -1. * inner(flux, grad(v))*dx \
+ inner(boundary_flux, v)*ds + inner(boundary_flux, v)*ds
forms = [mass, r] forms = [mass, r]
dirichlet_expression = f, 0.0, 0.0 interpolate_expression = f, 0.0, 0.0
...@@ -15,4 +15,4 @@ v = TestFunction(V) ...@@ -15,4 +15,4 @@ v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx] forms = [(inner(grad(u), grad(v)) - f*v)*dx]
exact_solution = g exact_solution = g
is_dirichlet = 1 is_dirichlet = 1
dirichlet_expression = g interpolate_expression = g
...@@ -12,4 +12,4 @@ v = TestFunction(V) ...@@ -12,4 +12,4 @@ v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx] forms = [(inner(grad(u), grad(v)) - f*v)*dx]
exact_solution = g exact_solution = g
is_dirichlet = 1 is_dirichlet = 1
dirichlet_expression = g interpolate_expression = g
...@@ -16,5 +16,5 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx ...@@ -16,5 +16,5 @@ r = (inner(grad(v), grad(u)) - div(v)*p - q*div(u))*dx
forms = [r] forms = [r]
exact_solution = g_v, 8.*(1.-x[0]) exact_solution = g_v, 8.*(1.-x[0])
dirichlet_expression = g_v, None interpolate_expression = g_v, None
is_dirichlet = v_bctype, v_bctype, None is_dirichlet = v_bctype, v_bctype, None
\ No newline at end of file
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