!   TITLE:  adapter_ring.mac
!
!---------------------------------------------------------------------------
!       Rev -   10/20/2000  D. Edwards
!---------------------------------------------------------------------------
!
!   AAAV Elevatation axis Adapter Ring, P/N SK305A010
!
!   CSar0:  Cartesian Adapter Ring Coordinate System
!   CSar1:  Cylindrical Adapter Ring Coordinate System
!   CSar2:  Spherical Adapter Ring Coordinate System
!
!
!******************************* TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Material and Element Type
!   4.  Solid Model
!
!
!************************** Model Assembly Preparation **********************
!
mod_assemb_prep,arg1,arg2,arg3
!
!
/title,Adapter Ring
!
!
/units,bin
!
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
adapter_ring.parm                   ! name of parameter file
!
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate Systems >>>>>>>>>>>>>>>>>>>>
!
mod_coord_system,acs,xc,yc,zc,rotxyc,rotyzc,rotzxc
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 3.  Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>
!
csys,CSar0

! Define keypoints starting from bottom corner of inner hole
! and working around CCW.

k,,0,d3/2,-l3
k,,0,d2/2,-l3
k,,0,d2/2,0
k,,0,d4/2,0
k,,0,d4/2,l2
k,,0,d1/2,l2
k,,0,d1/2,-l1
k,,0,d3/2,-l1

create_area

k,,0,0,0
k,,0,0,1
/psymb,cs,1
init_entity_num
revolve_aset,km-1,km,360,4

!
!------------------------------- Meshing ----------------------------------
!
*if,f_mesh_,eq,1,then

    esize=.2

    ! Section the part for map meshing
    csys,CSar0
    asel,selv,loc,z,-L1
    ar_profile_cut,,1

    ! Map mesh volumes which interface with the mirror
    csys,CSar0
    lsel,selv,loc,z,-L1
    csys,CSar1
    lsel,r,loc,x,d3/2
    asll,s,0
    asel,r,loc,z,-L1
    cm,mount,area
    msh_standrd,3,1,0,,1,2,esize,esize,al6061

    csys,CSar0
    asel,selv,loc,x,0
    asel,r,loc,y,d1/2,d4/2
    rotate_volm_msh,CSar0,,0,1,1,2,.5*esize,.5*esize,al6061

*endif

finalize_model

:skip