.msh file is not read

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

.msh file is not read

Leon Robers
Hi

Once in a while, the execution of my code stops after the meshing file is generated, so at this point:
...
Info: Done meshing 2D (5.23438 s)
Info: 52639 vertices 55186 elements
Info: Writing 'featool_gmsh_XQCERAFLVKG3.msh'...
Info: Done writing 'featool_gmsh_XQCERAFLVKG3.msh'
Info: Done reading 'featool_gmsh_XQCERAFLVKG3.geo'
Info: Stopped on Tue Feb 18 17:54:47 2020
(now it stops!)

Normally, it continues with the following line and the normal fea calculation:
Reading file C:\Users\lerobers\AppData\Local\Temp\featool_gmsh_XQCERAFLVKG3.msh
...

So Matlab does not crash but just stays "busy" without continuing the computation.
Since I implemented my fea-computation in a loop which runs over several days and my geometry is changed with each loop-iteration, I would like to be able to terminate the meshing process automatically if it takes longer than a certain threshold. So ideally, i could just end the gridgen.m function after a certain time limit is reached and continue with my matlab code, even though no mesh has been imported. My code then can handle any error which occurs and just skips the computation. Is this possible?

The error is independent of the geometry (it really just occurs rarely and only on one of the 2 computers where I am running the simulations)

If you can help me, thanks, if this is beyond the fea-tool related questions, I understand that too
thanks
Leon
Reply | Threaded
Open this post in threaded view
|

Re: .msh file is not read

Precise Simulation
Administrator
This post was updated on .
As it seems like the process is hanging in a Matlab function call (the mesh reading phase) it is to my knowledge not possible to break/stop such a process in any easy way. There is a "timer" functionality in Matlab to periodically call and execute functions, however I don't think this can be used to stop/break already running functions as Matlab still is inherently single-threaded (with blocking threads). (If gmsh itself was hanging one could use an asynchronous "system" call to periodically kill the gmsh binary/process).

As the FEATool 1.12 release candidate is now available which has a rewritten msh reading function I would recommend to try to update first and see if it helps. Otherwise, if it happens again you could maybe send me the corresponding geometry/geo/msh file with the precise "gridgen(...)" which caused the issue and I can see if it can be replicated and debugged.

Alternatively, if you are using Windows and awkward workaround would be to possibly write and make use of an AutoHotKey script to periodically send the "Ctrl-C" command to break the function (maybe within a Matlab "try" "catch" block so as to continue the loop).

Otherwise, depending on the computational resources/servers available to you, you could try to run the simulations in parallel batches as described here

  Running MATLAB FEM and Multiphysics Simulations in Parallel

so that most of the simulations will proceed even if one or a few simulation runs are blocked.


Leon Robers wrote
Once in a while, the execution of my code stops after the meshing file is generated, so at this point:
...
Info: Done meshing 2D (5.23438 s)
Info: 52639 vertices 55186 elements
Info: Writing 'featool_gmsh_XQCERAFLVKG3.msh'...
Info: Done writing 'featool_gmsh_XQCERAFLVKG3.msh'
Info: Done reading 'featool_gmsh_XQCERAFLVKG3.geo'
Info: Stopped on Tue Feb 18 17:54:47 2020
(now it stops!)

Normally, it continues with the following line and the normal fea calculation:
Reading file C:\Users\lerobers\AppData\Local\Temp\featool_gmsh_XQCERAFLVKG3.msh
...

So Matlab does not crash but just stays "busy" without continuing the computation.
Since I implemented my fea-computation in a loop which runs over several days and my geometry is changed with each loop-iteration, I would like to be able to terminate the meshing process automatically if it takes longer than a certain threshold. So ideally, i could just end the gridgen.m function after a certain time limit is reached and continue with my matlab code, even though no mesh has been imported. My code then can handle any error which occurs and just skips the computation. Is this possible?

The error is independent of the geometry (it really just occurs rarely and only on one of the 2 computers where I am running the simulations)

If you can help me, thanks, if this is beyond the fea-tool related questions, I understand that too
thanks
Leon
Reply | Threaded
Open this post in threaded view
|

Re: .msh file is not read

Leon Robers
alright, thank you for your detailed comments on this issue.

I'm looking forward to use the new released version and see if this issue still occurs.