Using functions in non-linear form with DG
Asked by
Praveen C
Hello,
For a DG scheme to solve a non-linear problem, I want to know if we can define functions like "nflux" and use them in a form like below. I then want to solve using a nonlinear solver. Is this valid syntax ? Its seems to compile and run but I am getting nans.
(This is a cooked up example to illustrate my situation)
def nflux(ul, ur, vn):
if vn > 0.0:
return ul**2
else:
return ur**2
V = FunctionSpace(mesh, "DG", 1)
v = TestFunction(V)
u = Function(V)
v = Expression(
n = FacetNormal(mesh)
vn= dot(v, n)
H = nflux(u('+'), u('-'), vn)
L = H*jump(v)*dS
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Martin Sandve Alnæs
- Solved:
- Last query:
- Last reply:
This question was reopened
- by Praveen C
To post a message you must log in.