Dear all,
There is an absolute value in my variational form, for example: (....+|\frac{\partial u}{\partial x}|+....)dV, where u is a Function and x is the x axis. I write this variational form like this:
from dolfin import *
import numpy as np
V = VectorFunctionSpace(mesh, "CG", 1)
u = Function(V)
variational_form = (... + np.absolute(u.dx(0)) + ...)*dx
My first question is can we use np.absolute() in a variational form?
Besides, there is no doubt that we can use float as the argument of np.aboslute(), like this:
a=np.absolute(-3.2)
print(a)
But can we use the type of fenics (such as the u.dx(0)
in my case) to be the argument of np.aboslute()? np.absolute() can recognize a float, but I don’t think np.aboslute() can recognize the types of fenics.
I appreciate any help.