CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   tensors cofactors (

maka November 11, 2008 08:18

I noticed that expression a) w
I noticed that expression a) works while b) and c) does not. I use V 1.3

volTensorField T = ...;

a) Foam::inv(T);

b) Foam::cof(T);
error: 'cof' was not declared in this scope.

c) Foam::cofactors(T);
error: no matching function for call to 'cofactors(Foam::volTensorField&)'


henry November 11, 2008 08:49

Currently (version 1.5) the "c
Currently (version 1.5) the "cofactors" function is defined for:

SymmTensorI.H://- Return the cofactor tensor of a symmetric tensor
SymmTensorI.H:inline SymmTensor<cmpt> cofactors(const SymmTensor<cmpt>& st)
TensorI.H://- Return the cofactor tensor of a tensor
TensorI.H:inline Tensor<cmpt> cofactors(const Tensor<cmpt>& t)

if you think it would be useful to have this function available at the field level I will propagate it through.


maka November 11, 2008 11:31

I managed to get cofactors wit
I managed to get cofactors with an indirect way by:

volTensorField M ...;


but it is not efficient. I would be grateful if you could propagate such cof function to the field level (similar to inv) in both definitions. If you could post the modification relative to V1.5 I will try to manage from there. Many thanks for your help.

Best regards,

henry November 11, 2008 12:09

Will do.... H
Will do....


henry November 14, 2008 14:46

...done. I have also rename

I have also renamed "cofactors" "cof" for consistency with the rest of the 3-char tensor function names.

The updates are now in our 1.5.x git repository.


maka November 17, 2008 09:31

Thanks Henry.
Thanks Henry.

All times are GMT -4. The time now is 18:59.