Using trig/hyperbolic functions with dimensioned scalars
I'm trying to compute the cosh and sinh of a dimensionedScalar, and it won't accept the arguments. Here is my code:
Code:
forAll(M,celli){ Two questions: (1) Is there a way to perform cosh et al on a vector or field? From the documentation, it looks like it only accepts scalars, but I'm not sure. (2) How can I solve the issue? Argument.value() doesn't seem to work, and using a const dimensionedScalar doesn't make sense with my problem. I really appreciate your help. Thanks! 
It is not allowed to compute the cosh or sinh of a dimensioned numer. Just this about it, what would be the meaning of
Code:
scalar cosFive = cos(5 m/s) For your case, you could use Code:
cosh(Argument.value())/sinh(Argument.value()) Cheers, L 
Quote:
What does the "double&" mean, and does anyone have any suggestions for how to solve this? 
Ok, try adding 'Foam::' :
Code:
Foam::cosh(Argument.value())/Foam::sinh(Argument.value()) L 
That worked! Thank you, Lieven

All times are GMT 4. The time now is 07:01. 