Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

ngsolve.webgui Draw vs. typical ngsolve Draw

More
2 years 6 months 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
2 years 6 months 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.108 seconds