- Thank you received: 0
Error at visoptions
2 years 6 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
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
2 years 6 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
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
2 years 6 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("...")
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.090 seconds