- Thank you received: 6
access higher order derivative of a testfunction
- Guosheng Fu
- Topic Author
- Offline
- Elite Member
Less
More
6 years 6 months ago #511
by Guosheng Fu
access higher order derivative of a testfunction was created by Guosheng Fu
Hello,
I want to access a second, and third order derivative of a DG testfunction. Is it supported in ngsolve?
Say, I have a third order derivative in the equation,
-u_xxx
and this leads to the cell-wise bilinear forms
(u_x, v_xx) or (u, v_xxx)
I tried
ux = u.Deriv()
uxx = ux.Deriv(),
but it seems not working....
Best,
Guosheng
I want to access a second, and third order derivative of a DG testfunction. Is it supported in ngsolve?
Say, I have a third order derivative in the equation,
-u_xxx
and this leads to the cell-wise bilinear forms
(u_x, v_xx) or (u, v_xxx)
I tried
ux = u.Deriv()
uxx = ux.Deriv(),
but it seems not working....
Best,
Guosheng
6 years 6 months ago - 6 years 6 months ago #512
by schruste
Replied by schruste on topic access higher order derivative of a testfunction
Hi Guosheng,
Every finite element space can provide additional differential operators (on top of the evaluation, Deriv() and Trace()). In general there are no higher derivatives, but for H1 we have the DiffOp "hesse" that you can use for second order derivatives with (for v a TestFunction of an H1 FESpace):
The operator gives you a vector of dimension d x d that I wrapped into a matrix.
For L2 it would work the same way, but it wasn't provided for python so far.
It has just been added to the master. Check out the master branch at gitlab.asc.tuwien.ac.at/jschoeberl/ngsolve or wait for the nightly build.
For higher derivatives we don't have a standard implementation so far. In that case you have to introduce auxiliary variables to represent higher derivatives or implement the DiffOp yourself.
Best,
Christoph
Every finite element space can provide additional differential operators (on top of the evaluation, Deriv() and Trace()). In general there are no higher derivatives, but for H1 we have the DiffOp "hesse" that you can use for second order derivatives with (for v a TestFunction of an H1 FESpace):
Code:
hesse_v = CoefficientFunction(v.Operator("hesse"),dims=(mesh.dim,mesh.dim))
For L2 it would work the same way, but it wasn't provided for python so far.
It has just been added to the master. Check out the master branch at gitlab.asc.tuwien.ac.at/jschoeberl/ngsolve or wait for the nightly build.
For higher derivatives we don't have a standard implementation so far. In that case you have to introduce auxiliary variables to represent higher derivatives or implement the DiffOp yourself.
Best,
Christoph
Last edit: 6 years 6 months ago by schruste.
Time to create page: 0.100 seconds