Help with Draw() function

Hello,

I am a beginner in NGSolve (I started using it last week), so please excuse me if this question is too basic or sounds stupid. Can someone please help me understand the Draw() function?

The Python help() documentation for Draw() says that it can draw a CoefficientFunction object, but so far, I have only been able to get them to work on GridFunction objects. For both CoefficientFunction and GridFunctionCoefficientFunction objects, I get an error message that says the object does not have an attribute Draw(). The help() of both CoefficientFunction and GridFunction do not list Draw() as one of the members, but Draw() still works for GridFunction objects. If I include the mesh and name arguments in Draw(), NGsolve displays the mesh.

Does Draw() only support GridFunction objects? Is there any way I can plot CoefficientFunction objects?

Also, a question regarding the first NGSolve tutorial (the Poisson tutorial, Poisson Equation — NGS-Py 6.2.2302 documentation):

Here, there are two Draw() statements,

Draw (gfu, mesh)
Draw (-grad(gfu), mesh, "Flux")

both of which seem to just produce the same result (plotting u). Is the second Draw() command supposed to do something else, and is this just my simulation being weird?

Hello rgs,

are you using the netgen gui? There the visualised function is always the last scalar function drawn. To see the vector valued function, go to Visual → Scalar Function and select the component or norm yo want to see. From python you can control this via from ngsolve.internal import visoptions visoptions.scalfunction = "Flux:0"

Best
Henry