! ============================================================
! M09 - Bug hunt
! ============================================================
/CLEAR,START                        ! Five typical failures in parametric sweeps.
/FILNAME,m09_bug_hunt,1
/UNITS,SI

! ERROR 1: reuse geometry without rebuilding between cases.
! ! forgetting VDELE/KDELE at the start of 09_build
! Symptom: accumulated nodes/elements; impossible topology in the CSV.

! ERROR 2: write the CSV from 09_extract on each iteration.
! *CFOPEN inside the loop overwrites the file on every case.
! *CFOPEN,m09_results,csv  ! inside extract
! *VWRITE in extract leaves only the last row on disk.
! Symptom: only the last row remains; incoherent selection.

! ERROR 3: confuse validation_pass with feasible.
! *IF,validation_pass,EQ,1,THEN selected_h=beam_h *ENDIF
! Symptom: selects h=0.08 even though |uy| exceeds 0.25 mm.

! ERROR 4: /CLEAR inside the *DO without redefining inputs.
! *DO loses parameters and arrays if /CLEAR wipes the session mid-sweep.
! *DO,case_id,1,3
!   /CLEAR,START
!   /INPUT,09_build
! Symptom: beam_h, mesh_h, and arrays disappear; inconsistent loop.

/COM,DIAGNOSE: rebuild, single CSV, feasible vs validation, param survival, min selection     ! Symptom: chooses h=0.14 when h=0.12 also passes and is lighter.
/COM,Table: symptom -> check (counts, CSV, limits) -> cause -> fix
FINISH



