!   TITLE:  ring.mac (CU09644005)
!
!-----------------------------------------------------------------------
!       Rev -   08/29/2002      D. Edwards
!-----------------------------------------------------------------------
!
!   Ring - EZ Adjustment, C200111393
!
!
!   CSr0:       Cartesian ring Coordinate System
!   CSr1:       Cylindrical ring Coordinate System
!   CSr2:       Spherical ring Coordinate System
!
!
!************************** TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Solid Model
!
!********************* Model Assembly Preparation **********************
!
mod_assemb_prep,arg1        ! prepare database for assembly
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
ring.parm
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate System >>>>>>>>>>>>>>>>>>>>>
!
mod_coord_system,acs,xc,yc,zc,rotxyc,rotyzc,rotzxc
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 3.  Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>
!

! Create area with chamfer and revolve
k,,rhole
k,,1.2*len/2
k,,1.2*len/2,thic
k,,rhole+cham,thic
k,,rhole,thic-cham

create_area

! Divide up area for mesh control
ara_create_part,CSr0,90,r_fine

asel,selv,area,,am
ara_create_part,CSr0,90,rs

! Revolve the set of areas
create_cs,0,'CSrz0',0,0,0,0,0,-90,0

revolve_aset,CSrz0,90,1

! Slice up the volume to form the rectangular block
norm_cut_pln_ct,'z',zmid
norm_cut_pln_ct,'x',len/2
norm_cut_pln_ct,'x',-len/2
norm_cut_pln_ct,'y',wid/2

csys,CSrz0

vsel,selv,loc,x,0,len/2
vsel,r,loc,y,0,wid/2
vsel,inve
vsla,r,1

vdele,all,,,1

init_entity_num

nummrg,kp

init_entity_num

view,'iso'

lplot

!
!----------------------------------------------------------------------
!
!
!                         (1)     (2)     (3)      (4)     (5)   (6)    (7)
!       ROTATE_VOLM_MSH, actcs,  mstyp, mshdens, elmszovr, etpa, etpv, elmnl,
!
!                        elmxl, mtrl,  rl,  ecs,  radrot, varcang, ell
!                         (8)   (9)   (10)  (11)   (12)    (13)    (14)
!
!====================== MESH DENSITY =========================
parm_val,'pin','mfine','mfine',0.5*cham
parm_val,'pin','mruf','mruf',2*cham
mrufer=6*cham       !5*cham
!=============================================================
!
! Mesh interface volume around pin press fit
csys,CSrz0
lsel,selv,loc,y,0
lsel,r,loc,x,0,rs
lsel,r,loc,z,zmid,thic
asll,s,1

rotate_volm_msh,CSrz0,0,0,-2,1,2,mfine,mfine,,,,rs,90

lsel,selv,loc,y,0
lsel,r,loc,x,0,rs
lsel,r,loc,z,0,zmid
asll,s,1
rotate_volm_msh,CSrz0,0,0,-2,1,2,mruf,mruf,mring,,,rs,90

! Mesh volumes out to the pin shoulder
aslc,selv,0,wid/2,zmid
asel,r,loc,z,zmid
msh_standrd,3,0,0,elszohof,1,2,mruf,mruf,mring

! Mesh remainder of block
aslc,selv,len/2,0,zmid
asel,r,loc,z,zmid
msh_standrd,3,0,0,elszohof,1,2,mrufer,mrufer,mring

csys,CSr0
vsymm,x,all
nummrg,all

finalize_model