How can I access to a volTensorField elements? urgent!!!
Hi everybody,
I want to access to elements of a volTensorField. any body knows how can I do that? thanks, Mostafa |
Hi Mostafa,
This is from the top of my head so don't know if it's fully correct but it might help you in the right direction. Sepose T is the name of the tensorField: Code:
forAll(T,cellI) L |
thank you Lieven,
It's just for a Tensor not a volTensorField. I tried it before but it said that volTensorField has no member named ‘yy’. again thank you. Mostafa |
Hi Mostafa,
I don't really understand your post. First you say that it's not a volTensorField but only a tensor, and next you say that the error states "volTensorField has no member named 'yy'". I hope you can see the contradiction in this and clarify it for me... Cheers, L |
Quote:
I meant that what you said is applicable for Tensor type and when I used it for volTensorField it didn't work. a question: what is the meaning of cellI in your post? Code:
const Tensor& t=T[cellI] |
That's why I put it inside the forAll-loop so that it would loop over each cell (hence the meaning of CellI).
Just found out that the easier way to get the whole field immediately is (e.g. for component xy): Code:
scalarField Txy = T.component(tensor::XY); L |
A volTensorField is comprised of both internal values as well as boundary values assigned to patch faces.
I'm assuming you need to get to the internal field, this is how you do it: Code:
|
All times are GMT -4. The time now is 17:10. |