Diagonal elements of a volTensorField
I need to compute the diagonal elements of a volTensorField. The tensor field has the form,
volTensorField tmp ("tmp", fvc::grad(U));
It seems OpenFoam 1.6 doesn't have a function like diag(tmp). Does OpenFoam 1.7 have such kinds of function? Do any people know how to compute the diagonal elements?
If you want the sum of the diagonal elements then:
volScalarField trTmp = tr(tmp);
If you just want the diagonal components, then
will provide the individual fields.
|All times are GMT -4. The time now is 01:50.|