Programmatic way to check if FEA results were empty/bad

Empty FEA results

Sometimes my input 3D models have multiple separate components without proper connection. The disconnected elements cause the FEA results to be empty with the stresses equal to zero:

NaN

The CCX logs indicate that the error is NaN for the iterations:

    - iteration 18 :
         total iteration time                   0.105 
         error                                  nan
    - iteration 19 :
         total iteration time                   0.109 
         error                                  nan
    - iteration 20 :
         total iteration time                   0.108 
         error                                  nan
    - iteration 21 :
         total iteration time                   0.102 
         error                                  nan
    - iteration 22 :
         total iteration time                   0.104 
         error                                  nan
    - iteration 23 :
         total iteration time                   0.105 
         error                                  nan
    - iteration 24 :
         total iteration time                   0.0971 
         error                                  nan
    - iteration 25 :
         total iteration time                   0.0986 
         error                                  nan
    - iteration 26 :
         total iteration time                   0.1 
         error                                  nan
    - iteration 27 :
         total iteration time                   0.101 
         error                                  nan
    - iteration 28 :
         total iteration time                   0.102 
         error                                  nan
    - iteration 29 :
         total iteration time                   0.119 
         error                                  nan
    - iteration 30 :
         total iteration time                   0.116 
         error                                  nan
    - iteration 31 :
         total iteration time                   0.11 
         error                                  nan
    - iteration 32 :
         total iteration time                   0.109 
         error                                  nan
    - iteration 33 :
         total iteration time                   0.107 
         error                                  nan
    - iteration 34 :
         total iteration time                   0.103 
         error                                  nan
    - iteration 35 :
         total iteration time                   0.103 
         error                                  nan
    - iteration 36 :
         total iteration time                   0.102 
         error                                  nan
    - iteration 37 :
         total iteration time                   0.103 
         error                                  nan
    - iteration 38 :
         total iteration time                   0.101 
         error                                  nan
    - iteration 39 :
         total iteration time                   0.169 
         error                                  nan
    - iteration 40 :
         total iteration time                   0.116 
         error                                  nan
    - iteration 41 :
         total iteration time                   0.119 
         error                                  nan
    - iteration 42 :
         total iteration time                   0.124 
         error                                  nan
    - iteration 43 :
         total iteration time                   0.108 
         error                                  nan
    - iteration 44 :
         total iteration time                   0.0983 
         error                                  nan
    - iteration 45 :
         total iteration time                   0.103 
         error                                  nan
    - iteration 46 :
         total iteration time                   0.103 
         error                                  nan
    - iteration 47 :
         total iteration time                   0.0989 
         error                                  nan
    - iteration 48 :
         total iteration time                   0.107 
         error                                  nan
    - iteration 49 :
         total iteration time                   0.124 
         error                                  nan
    - iteration 50 :
         total iteration time                   0.106 
         error                                  nan
    Time for refinement:                  5.5594 
________________________________________

CSC Conversion Time: 0.022706
Init Time: 0.615358
Factorize Time: 4.897406
Solve Time: 14.208785
Clean up Time: 0.000000
---------------------------------
Sum: 19.744257

Total PaStiX Time: 19.744257
CCX without PaStiX Time: 1.657823
Share of PaStiX Time: 0.922539
Total Time: 21.402079
Reusability: 0 : 1 
________________________________________

 Using up to 1 cpu(s) for the stress calculation.


 Job finished

________________________________________

Total CalculiX Time: 21.814503
________________________________________

Question

Is there a straightforward and programmatic way to figure out that the analysis results were empty, without actually opening the FRD file by CGX and visualizing the results? For example, what section of the FRD file should I read and double-check to figure out that the analysis went wrong? Or any other way :roll_eyes: Thanks.

Files

I have uploaded the INP and FRD files here:

Not a programmatic way but modal (*FREQUENCY) analysis will let you easily identify disconnected components - they will fly away in the initial mode shapes close to 0 Hz.

Abaqus also prints “There are x unconnected regions in the model” warning message. Would be nice if CalculiX could do that as well.

1 Like

You can write a cgx script for that. For example:

# file: values.fbd
# vim:fileencoding=utf-8:fdm=marker:ft=cgx

# Read dataset
read job.frd

# Dataset 4, von Mises stress
ds 4 e 7

# get all the nodes
seta nodes n all

# Activate the stack
stack on

# Get lowest and highest value
enq nodes low rec _ _ _ 1e-6 l
enq nodes high rec _ _ _ 1e-6 h
valu vhigh pop 2
valu vlow pop 3
# Clean up generated files
sys rm -f *.out

# Output, this is for a UNIX-like OS.
sys printf "lowest stress: %g Pa\\n" vlow >/dev/stderr
sys printf "highest stress: %g Pa\\n" vhigh >/dev/stderr
valu vdiff - vhigh vlow

# Choose suitable difference limits!
if vdiff < 10
    sys echo "ERROR: stresses too low" >/dev/stderr
endif
if vdiff > 1e7
    sys echo "ERROR: stresses too high" >/dev/stderr
endif

Running the script like this:

cgx -bg values.fbd >/dev/null

Produces:

lowest stress: 17023 Pa 
highest stress: 1.86737e+07 Pa 
ERROR: stresses too high

Note that this is written for a UNIX-like machine! This affects the sys commands.
For example, output redirection (“>/dev/stderr” or “>/dev/null”) works differently on a ms-windows box; look it up.
In place of rm, you use del. Also, I don’t think ms-windows has a printf utility. You might have to settle for echo instead.

1 Like