Help with Draw() function

More
4 years 1 week ago #3314 by rgs
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, ngsolve.org/docu/latest/i-tutorials/wta/poisson.html ):

Here, there are two Draw() statements,
Code:
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?
More
4 years 1 week ago #3316 by hvwahl
Replied by hvwahl on topic Help with Draw() function
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
Code:
from ngsolve.internal import visoptions visoptions.scalfunction = "Flux:0"

Best
Henry
The following user(s) said Thank You: rgs
Time to create page: 0.094 seconds