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
Find more posts tagged with
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.
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 closes
2. 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
}
So what is the action you need the user to take when the analysis fail?