Catching An Error
Hey guys,
I want to catch a mistake concerning the mesh. when this mistake is occuring, the user should be able to fix the mesh.
During a while loop i have sometimes an error in the command *plotnodelist, because it needs the inputs 'results of a analysis' and 'nodes id'.
Sometimes the analysis fails and *plotnodelist leads to a break down of Hyperworks because of the missing results.
Here is the relevant part of my code:
while {} {......
if { [catch {*plotnodelist 1}] } {
puts 'analysis failed '
break
} else {
*plotnodelist 1
}
....}
Kind regards
Simon
Answers
-
So what is the action you need the user to take when the analysis fail?
0 -
Altair Forum User said:
break down of Hyperworks
does this mean segmentation error?
0 -
The failure information is on the lower left corner.
If this failure occurs, HyperMesh shows no reaction and has to be closed and opened every time.I want to catch this failure and stop the loop if the failure occurs.
After this i want to correct the mesh in HyperMesh and start another iteration.0 -
I see two things you can do:
1. Identify the error reading the result's file and act accordingly;
2. Identify the root cause from the meshing process and act from there.
Do you know which mesh issue is causing this problem?
0 -
Thanks for your efforts!
1. I'm executing a solver at first and load the results afterwards.
But sometimes the solver failed because the meshed is too bad, so no result file is
written. The command *plotnodelist needs the results file and fails if it's not existing.
--> HyperWorks closes2. meshing problem is non-correctable, because two 2d mesh edges are running into each other
during thermal expansion and the mesh overlaps. The solver fails in the next step in a static analysis (--> 1)
The overlapping is shown in the picture.The skript is running for many iteration without problems, but after some iteration the described problem occurs and HyperWorks crashes.
I want so improve the mesh after it fails and start the programm again.There must be a mistake in the code of catching the problem.
For the sake of completeness the part before the command '*plotnodelist
# executing the solver
exec $batch -analysis '$path/${name}.fem'
hm_answernext yes
*analysisfileset '$path/${name}.res'#make a contour plot
*setgeomrefinelevel 1
*drawlistresetstyle
*setcuttingplanesbase 0 29.3749355 7.5
*clipboundaryelements 1
*inputsimulation 'SUB1 - Statische Analyse ' 'Von Mises Stress'
*contourplot '' 0 0 0 0 1 0 0 0 'magnitude' 1 0 0#select the component nodes and plot the results
*createmark nodes 1 'by comp name' Randschicht
*createlist nodes 1 {*}[hm_getmark nodes 1]
set NodeList [hm_getlist nodes 1]if { [catch {*plotnodelist 1}] } {
puts 'analysis failed '
break
} else {*plotnodelist 1
}
0 -
Hi,
You don't need to write *plotnodelist again inside the else condition. Else will be executed when the initial code is successful.
0 -
If no result file is written, then all the marks and node lists you create after the analysis is complete are blank.
So you could try to identify if the result file exists, or simply check if these marks are blank.
0 -
Thanks for your help guys, this helped us a lot!
0