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

Rewrite linear acoustics a small bit

parent 2205ac65
No related branches found
No related tags found
No related merge requests found
......@@ -12,17 +12,19 @@ n = FacetNormal(cell)('+')
u = TrialFunction(MV)
v = TestFunction(MV)
rho, q0, q1 = split(u)
mass = inner(u, v)*dx
def flux(s):
rho, q0, q1 = split(s)
return as_matrix([[q0, q1], [rho, 0.], [0., rho]])
flux = as_matrix([[q0, q1],
[rho, 0.],
[0., rho]])
# Define numerical fluxes to choose from
llf_flux = dot(avg(flux(u)), n) - 0.5*jump(u)
llf_flux = dot(avg(flux), n) - 0.5*jump(u)
numerical_flux = llf_flux
r = -1. * inner(flux(u), grad(v))*dx \
r = -1. * inner(flux, grad(v))*dx \
- inner(numerical_flux, jump(v))*dS \
+ inner(u, v)*ds
......
......@@ -12,17 +12,19 @@ n = FacetNormal(cell)('+')
u = TrialFunction(MV)
v = TestFunction(MV)
rho, q0, q1 = split(u)
mass = inner(u, v)*dx
def flux(s):
rho, q0, q1 = split(s)
return as_matrix([[q0, q1], [rho, 0.], [0., rho]])
flux = as_matrix([[q0, q1],
[rho, 0.],
[0., rho]])
# Define numerical fluxes to choose from
llf_flux = dot(avg(flux(u)), n) - 0.5*jump(u)
llf_flux = dot(avg(flux), n) - 0.5*jump(u)
numerical_flux = llf_flux
r = -1. * inner(flux(u), grad(v))*dx \
r = -1. * inner(flux, grad(v))*dx \
- inner(numerical_flux, jump(v))*dS \
+ inner(u, v)*ds
......
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