Wednesday, August 15, 2012

Gmsh launching


I would like to say several words about Gmsh launching. If you want to start Gmsh without any input arguments, for example, by double-clicking on its icon (in systems with desktop environment), or typing only

$ path_to_gmsh_bin_directory/gmsh

in the command line (using Terminal in Unix-like systems, or, for example, Total Commander in Windows systems), in all these cases, you might face some problems. Being launched without input parameters, Gmsh creates a default file "untitled.geo", and uses it as an input argument. For Windows7 this file is created here

C:\Users\_UserName_\AppData\Local\Temp\

regardless the place where you launched Gmsh.
Now we simulate the situation when someone started Gmsh without arguments and made some actions using menu window. For example, we add 2 new points (Geometry->Elementary entities->Add->New->Point). When we'll close Gmsh, and launch it again (without input parameters), we'll see that all changes are saved in the default file (i.e. we'll see our 2 points). Now imagine that someone made actions, that led to Gmsh's crush. It's difficult to invent something of this kind right now, so we'll just write the following string to the default file.

Exit;

After that, we close Gmsh, and start it again in the same way as before. What will we see? Gmsh appears and closes immediately. I think the cause is clear - the Exit command forces Gmsh to shut down. This situation shows that if the default file contains something making Gmsh's crush, you, probably, will not know why this crush happens, because there is no error message from Gmsh or something else. The reason is just bad default file.
So the remedy is obvious:
I. To find the default geometry file (look for "untitled.geo") and
1. delete it;
2. change it to cancel all actions that lead to such bad result.
II. To start Gmsh with new geometry file as an argument

gmsh newfile.geo

The second solution will not return the geometry you previously created, but Gmsh will start anyway.

If you launch Gmsh without input parameters under Unix-like system, the behaviour stays the same. But in this case the default file "untitled.geo" is created in the directory where you start Gmsh. So to find this file is a little bit easier.

Be careful launching Gmsh without arguments!

No comments:

Post a Comment