! ----------------------------------------------------------------------
! M08 - English course download: 08_solve.mac
! Follow the matching English lesson for explanations and task details.
! Commands, parameter names, file names, CSV keys, and result tokens are preserved.
! ----------------------------------------------------------------------

FINISH
/SOLU
ERESX,YES

CMSEL,S,fixed_nodes
*GET,n_fixed_check,NODE,0,COUNT
*IF,n_fixed_check,LE,0,THEN
  /COM,ERROR: cannot restrain an empty fixed_nodes selection
  ALLSEL,ALL
  /EOF
*ENDIF
D,ALL,ALL,0
ALLSEL,ALL

CMSEL,S,tip_nodes
*GET,n_tip_check,NODE,0,COUNT
*IF,n_tip_check,LE,0,THEN
  /COM,ERROR: cannot load an empty tip_nodes selection
  ALLSEL,ALL
  /EOF
*ENDIF
force_per_node=tip_force/n_tip_check
F,ALL,FY,force_per_node
ALLSEL,ALL

ANTYPE,STATIC
NLGEOM,OFF
KBC,1
NSUBST,1
OUTRES,ALL,LAST
SOLVE
FINISH

/COM,M08 SOLVE: force_per_node=%force_per_node%
