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

/CLEAR,START                        ! Complete the TODOs for CERIG, MPC184/BEAM188, and SMISC extraction.
/FILNAME,m12_start,1
/TITLE,M12 - Bolted-joint starting point
/UNITS,SI

plate_x=0.08
plate_z=0.04
plate_t=0.012
interface_gap=0.0001
mesh_h=0.004
bolt_x=0.04
bolt_z=0.02
head_absorb_r=0.010
thread_absorb_r=0.008
bolt_d=0.012
young=210E9
nu=0.30
fx_total=4000
fy_total=-3000
select_tol=mesh_h*1E-4

/PREP7
ET,1,SOLID185
KEYOPT,1,2,0
MP,EX,1,young
MP,PRXY,1,nu
TYPE,1
MAT,1
BLOCK,0,plate_x,0,plate_t,0,plate_z
BLOCK,0,plate_x,plate_t+interface_gap,2*plate_t+interface_gap,0,plate_z

div_x=MAX(1,NINT(plate_x/mesh_h))
div_y=MAX(1,NINT(plate_t/mesh_h))
div_z=MAX(1,NINT(plate_z/mesh_h))
MSHAPE,0,3D
MSHKEY,1
LSEL,S,LENGTH,,plate_x
LESIZE,ALL,,,div_x,,1
LSEL,S,LENGTH,,plate_t
LESIZE,ALL,,,div_y,,1
LSEL,S,LENGTH,,plate_z
LESIZE,ALL,,,div_z,,1
ALLSEL,ALL
VMESH,ALL

SELTOL,select_tol
NSEL,S,LOC,Y,0
CM,bottom_nodes,NODE
ALLSEL,ALL
SELTOL,

! TODO 2: select head_dep at y=2*plate_t+interface_gap and thread_dep at y=plate_t.
! TODO 3: choose head_pilot and thread_pilot; apply CERIG,piloto,ALL
! CERIG: couples the dependent region to the pilot node (head or thread).
! TODO 4: create a 1D connector between pilots; apply load at head_pilot (Fx, Fy).

FINISH

/SOLU
ANTYPE,STATIC
NLGEOM,OFF
CMSEL,S,bottom_nodes
D,ALL,ALL,0
ALLSEL,ALL
! TODO 5: F,head_pilot,FX,fx_total and F,head_pilot,FY,fy_total
OUTRES,ALL,LAST
SOLVE
FINISH

/COM,Complete the TODOs and compare with 12_bolt_connector.mac
FINISH
