! ============================================================
! M06 - Bug hunt
! ============================================================
/CLEAR,START                        ! Activate one case at a time; do not fix them all at once.
/FILNAME,m06_bug_hunt,1
/UNITS,SI

tip_force=-1000
beam_l=1.0
beam_h=0.10
beam_b=0.05

! ERROR 1: solve with a propagated partial selection.
! CMSEL,S,tip_nodes
! SOLVE runs the calculation; here the partial selection contaminates the model.

! ERROR 2: query results without loading a set.
! /POST1
! SET,LAST loads a result set before reading RF with *GET.
! *GET,...,RF reads reactions only from the active set in /POST1.
! *GET,rfy,NODE,1,RF,FY

! ERROR 3: incorrect sign convention.
rfy_expected=1000
wrong_force_error=ABS(rfy_expected-tip_force)/ABS(tip_force)

! ERROR 4: FSUM with all nodes selected can give a
! global resultant close to zero; it does not represent the support alone.
! SPOINT sets the reference point for FSUM moments.
! FSUM sums forces and moments of selected nodes.
! ALLSEL,ALL
! FSUM

fake_rmz=0                          ! must be reconstructed with r x RF or summed with FSUM/SPOINT.

/COM,DIAGNOSE: selection, SET, signs, FSUM scope and moment transfer
/COM,wrong_force_error should expose the sign mistake
FINISH



