ngsolve.webgui Draw vs. typical ngsolve Draw

More
3 years 3 weeks ago #4056 by bl7
Hello all,

I am drawing a CoefficientFunction on a mesh, such as

ng.Draw(ng.cos(ng.atan(ng.y/ng.x)), mesh)

Is there any reason for ngsolve.webgui.Draw to successfully draw the CoefficientFunction while the usual (non-webgui) ngsolve.Draw throws an error such as

TypeError: Draw(): incompatible function arguments. The following argument types are supported:
1. (cf: ngsolve.fem.CoefficientFunction, mesh: ngsolve.comp.Mesh, name: str, sd: int = 2, autoscale: bool = True, min: float = 0.0, max: float = 1.0, draw_vol: bool = True, draw_surf: bool = True, reset: bool = False, **kwargs) -> None
2. (gf: ngsolve.comp.GridFunction, sd: int = 2, autoscale: bool = True, min: float = 0.0, max: float = 1.0, **kwargs) -> None
3. (mesh: ngsolve.comp.Mesh, **kwargs) -> None
4. (arg0: object) -> None

Invoked with: <ngsolve.fem.CoefficientFunction object at 0x150490090>, <ngsolve.comp.Mesh object at 0x1501d7450>

running precisely the same code? I am having a little trouble understanding the nuances between the two. Thank you all kindly in advance for your time.

Best regards,
Brian Lee
More
3 years 3 weeks ago #4057 by bl7
Hello all,

My apologies for asking such a juvenile question. The issue is resolved by assigning a name to the CF in the non-webgui setting.

Best regards,
Brian Lee
Time to create page: 0.088 seconds