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.

Error at visoptions

More
1 year 11 months ago #4358 by nepomuk
Error at visoptions was created by nepomuk
Hello,

I'm using NGSolve 6.2.2201 with python 3.8.10 and I get the following error when I call a visoption like

visoptions.deformation=0

ERROR: unexpected "," outside function argument list
in expression "100,000000/100"
errinfo: unexpected "," outside function argument list
in expression "100,000000/100"
    (parsing expression "100,000000/100")
    invoked from within
"expr $status_percent/100"
    (procedure "timer2" line 32)
    invoked from within
"timer2 "
    ("after" script)

Can you tell me, where the dog is hidden? :)
BR, Nepomuk

 
More
1 year 11 months ago #4359 by matthiash
Replied by matthiash on topic Error at visoptions
Hello,

Could you post a full example?

The visoptions comands append tcl-commands to a queue, which are batch processed by the tcl timer.
I suspect that the actual problem is happening earlier.

Best,
Matthias
More
1 year 11 months ago #4361 by nepomuk
Replied by nepomuk on topic Error at visoptions
Hello,

The error disappeared, when I removed the matplotlib module. I wasn't able to recreate the error in a minimum example, but in the one below, the GUI gets stuck (with or without the visoption command) if one imports matplotlib.pyplot.

Where does this come from?

BR, Nepomuk


import netgen.gui
# ngsolve stuff
from ngsolve import *
# basic geometry features (for the background mesh)
from netgen.geom2d import SplineGeometry
from ngsolve.meshes import MakeStructured2DMesh
# visualization stuff
from ngsolve.internal import *

import matplotlib.pyplot as plt

geo=SplineGeometry()
geo.AddCircle((0,0),1,bc="diri",leftdomain=1,rightdomain=0)
mesh=Mesh(geo.GenerateMesh(maxh=0.1))
Vh=H1(mesh,order=1,dirichlet="diri")
u=Vh.TrialFunction()
v=Vh.TestFunction()
a=BilinearForm(Vh,symmetric=True)
f=LinearForm(Vh)
a+=InnerProduct(grad(u),grad(v))*dx
f+=CoefficientFunction(1.0)*v*dx
a.Assemble()
f.Assemble()
gfu=GridFunction(Vh)
gfu.vec.data=a.mat.Inverse(freedofs=Vh.FreeDofs())*f.vec
Draw(gfu,mesh,"gfu")
visoptions.deformation=0
input("...")

 
Time to create page: 0.138 seconds