Directional derivative
Hi folks,
Just a quick question:
I have a 2D domain and I need to have \partial (\partial u / \partial x) / \partial x. In other words, div(grad(u)) in x direction only.
Can (u.dx(0)).dx(0) do the job?
I have also tried u[0].dx(0), but I got the following error:
Invalid number of indices (1) for tensor expression of rank 0:
Argument(
Traceback (most recent call last):
File "adv_diff_
r = u.dx(0) - nu*(u[0].dx(0)) # L(u)
File "/usr/lib/
a = Indexed(self, indices)
File "/usr/lib/
% (len(indices), expression.rank(), expression))
File "/usr/lib/
raise self._exception
ufl.log.
Argument(
Any help is deeply appreciated.
Best,
Mo
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Martin Sandve Alnæs
- Solved:
- 2013-02-07
- Last query:
- 2013-02-07
- Last reply:
- 2013-02-07
|
#1 |
Yes :)
Or shorter just u.dx(0,0) if I recall correctly.
Martin
Den 7. feb. 2013 01:30 skrev "Mo" <email address hidden>
følgende:
> New question #221239 on DOLFIN:
> https:/
>
> Hi folks,
>
> Just a quick question:
>
> I have a 2D domain and I need to have \partial (\partial u / \partial x) /
> \partial x. In other words, div(grad(u)) in x direction only.
>
> Can (u.dx(0)).dx(0) do the job?
>
> I have also tried u[0].dx(0), but I got the following error:
>
>
> Invalid number of indices (1) for tensor expression of rank 0:
> Argument(
> None), -1)
>
> Traceback (most recent call last):
> File "adv_diff_
> r = u.dx(0) - nu*(u[0].dx(0)) # L(u)
> File "/usr/lib/
> in _getitem
> a = Indexed(self, indices)
> File "/usr/lib/
> __init__
> % (len(indices), expression.rank(), expression))
> File "/usr/lib/
> raise self._exception
> ufl.log.
> of rank 0:
> Argument(
> None), -1)
>
>
> Any help is deeply appreciated.
>
> Best,
> Mo
>
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>
Kent-Andre Mardal (kent-and) said : | #2 |
On 7 February 2013 01:30, Mo <email address hidden> wrote:
> New question #221239 on DOLFIN:
> https:/
>
> Hi folks,
>
> Just a quick question:
>
> I have a 2D domain and I need to have \partial (\partial u / \partial x) /
> \partial x. In other words, div(grad(u)) in x direction only.
>
> Can (u.dx(0)).dx(0) do the job?
>
yes
Kent
>
> I have also tried u[0].dx(0), but I got the following error:
>
>
> Invalid number of indices (1) for tensor expression of rank 0:
> Argument(
> None), -1)
>
> Traceback (most recent call last):
> File "adv_diff_
> r = u.dx(0) - nu*(u[0].dx(0)) # L(u)
> File "/usr/lib/
> in _getitem
> a = Indexed(self, indices)
> File "/usr/lib/
> __init__
> % (len(indices), expression.rank(), expression))
> File "/usr/lib/
> raise self._exception
> ufl.log.
> of rank 0:
> Argument(
> None), -1)
>
>
> Any help is deeply appreciated.
>
> Best,
> Mo
>
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>