problems with U & U computation
Dear Foamers,
I want to compute the L2-norm. It works fine for p as it is a volScalarField but not for U. I also do not know, why the output line starting with Info work fine but doesn't if it is copied outside the line. The current code is: Code:
Udiff = U-Uexact; Code:
no match for âoperator=â in âULErr = Foam::sqrt(const Foam::tmp<Foam::GeometricField<double, PatchField, GeoMesh> >&) David |
Not 100% sure why you are getting the error, try putting "::" in front of the offending "sqrt". However, there is a simpler way to compute the vector magnitude that will definitely work:
ULErr = mag(U-Uexact); |
Thanks a lot for your reply!
The :: added gives: Code:
T.C:191: error: cannot convert âFoam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >â to âdoubleâ for argument â1â to âdouble sqrt(double)â Code:
no match for âoperator=â in âUL2 = Foam::mag(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = Foam::Vector<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]()â |
ULErr is a volScalarField. Now it works.
|
All times are GMT -4. The time now is 23:17. |