Netgen over a remote connection requiring display

More
2 years 1 month ago #4512 by JamesElgy
HI All,

I am trying to use Netgen over a remote desktop connection via an ubuntu terminal without an attached display. My understanding is that

$ netgen -geofile=example.geo -meshfile=example.vol - coarse -batchmode

would generate a mesh of example.geo without opening a gui interface. Is that correct? I am getting tkinter errors about connecting to a display:

Traceback (most recent call last):
  File "/home/james/.local/bin/netgen", line 8, in <module>
    sys.exit(main())
  File "/home/james/.local/lib/python3.10/site-packages/netgen/__main__.py", line 45, in main
    from .gui import win
  File "/home/james/.local/lib/python3.10/site-packages/netgen/gui.py", line 48, in <module>
    StartGUI()
  File "/home/james/.local/lib/python3.10/site-packages/netgen/gui.py", line 20, in StartGUI
    win = Tk()
  File "/usr/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display "localhost:0.0"

Regards,
James
More
2 years 1 month ago #4513 by christopher
in your command is the space between the - and coarse on purpose or a copy mistake?
Because if I remove the space your command works for me.

But how did you install ngsolve? Using provided installer, apt or pip installer?
More
2 years 1 month ago #4514 by JamesElgy
Hi Christopher,
Thanks for the prompt reply.

The space between the - and coarse was a copying mistake I made when I typed my original forum post.
I've installed ngsolve via the pip installer.

Regards,
James

 
More
2 years 1 month ago - 2 years 1 month ago #4517 by matthiash
Hi James,

The "netgen" executable in the pip installer is actually a python script, not implementing all the options from the "legacy" executable you get when you compile the code yourself. (has to do with python packaging and linkage).

In your case I would write a short python script to do the meshing and run it:
Code:
from netgen.csg import * geom = CSGeometry("some_file.geo") mesh = geom.GenerateMesh(meshsize.coarse) mesh.Save("mesh.vol.gz")


Best,
Matthias
Last edit: 2 years 1 month ago by matthiash.
The following user(s) said Thank You: JamesElgy
Time to create page: 0.113 seconds