|
[Sponsors] |
July 2, 2011, 14:53 |
May I know more about tensor calculation?
|
#1 |
New Member
yafuji aki
Join Date: Jul 2010
Location: Japan
Posts: 14
Rep Power: 16 |
Hello, everyone!
How do I calculate partial derivative dA/dx (= (dAxx/dx, dAxy/dx, dAxz/dx, dAyy/dx, dAyz/dx, dAzz/dx)) of a symmetric tensor A (= (Axx, Axy, Axz, Ayy, Ayz, Azz))? I tried to use "grad(A)" but failed. I am at a loss of what to do... If anyone has information concerning this, please let me know! Sincerely yours aki |
|
July 4, 2011, 03:05 |
|
#2 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hi Aki,
fvc::grad(A) should do the trick Best Kathrin |
|
July 4, 2011, 23:51 |
|
#3 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
Kathrin,
I don't think that would work... The gradient of a tensor would contain 27 components, which Foam doesn't cater for at the moment. It can be done, just that the templates need to be instantiated, but that wouldn't be trivial. Cheers, Sandeep |
|
July 5, 2011, 03:05 |
|
#4 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Sandeep,
you are totally right. I overlooked A being a tensor. I feel a little embarrassed about it. Thank you for letting me know! Aki, for what do you need this? Do you just need the single components? Best Kathrin |
|
July 5, 2011, 14:53 |
|
#5 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
A simple workaround would be to store the gradient of each row of the tensor as another tensor, and manipulating that as necessary.
|
|
July 6, 2011, 03:33 |
|
#6 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
A not so simple way would be to use the VectorN library, which would make possible to have this huge tensor as a whole and add the fvc::grad for this special case. But for me it seems to be overengineered, as least as long as Aki doesn't need the complete tensor.
The question really is for what it is needed... |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|