Piecewise defined form (conditional in ufl file?)
Hi everybody,
I need to write in a ufl file a piecewise defined functional:
L =
inner(grad(
1/normg(
2*inner(
normg() is a function that gives the norm of the gradient. I tried to use conditional(
Thanks a lot for the help!
Here is the code of the ufl file:
t1=1
t2=2
element=
w = TrialFunction(
f = Coefficient(
u = Coefficient(
# Euclidean norm of the gradient
def normg(v):
return sqrt(inner(
L = conditional( lt(normg(u),t1), inner(grad(
# L = conditional( lt(normg(u),t1), m2*normg(u), \
# conditional( lt(normg(u),t2), \
# m2*t1, \
# m1*normg(u))) \
# *inner(
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Cataldo Manigrasso for more information if necessary.