Hi, All
Does anybody know h
Hi, All
Does anybody know how to calculate residual of two scalar field with OpenFOAM? I wanna get shorter code then that: volScalarField residual("residual", T); residual == mag(analytical - T); doubleScalar maxResidual = 0.0; forAll(residual, i) { if (residual[i] > maxResidual) { maxResidual = residual[i]; } } residual = maxResidual; where analytical & T are of type volScalarField. |
i.e. in my question i mean how
i.e. in my question i mean how to find max element of volScalarField using OpenFOAM methods
|
How about "max(residual)"...?
How about "max(residual)"...?
|
Ah, thanks. I found the decisi
Ah, thanks. I found the decision by myself already.
max(mag(analytical - T)).value(); I was in trouble because i didn't use *.value(), then max(mag(analytical - T)) was returning not scalar value. |
All times are GMT -4. The time now is 10:28. |