!   TITLE:  msh_area.mac (MESH)
!
!
!   OBJECTIVE:
!
!   This sub-macro is a standard (simplified) version of mesh algorithm for
!   area meshing.
!
!
!   COMMAND SYNTAX:
!
!                  (1)     (2)     (3)   (4)    (5)    (6)    (7)  (8)   (9)
!       MSH_AREA, mstyp, mshdens, etpa, elmnl, elmxl, lszmsh, mat, real, ecs
!
!
!   ARGUMENTS:
!
!       (1) mstyp = mesh type:
!
!               0 (or blank) = free mesh
!
!               1 = map mesh
!
!       (2) mshdens = mesh density.  If the desired mesh density is coarse or
!                     fine, then this parameter will create the desired mesh.
!                     This will allow the line sizing algorithm to size all the
!                     lines that are less than or equal to 2.5 times the min-
!                     imum element edge length, ELMNL. This will aid in keeping
!                     element aspect ratios to reasonable values when the de-
!                     sired minimum element edge length, ELMNL, is more than 3
!                     times the smallest line. (e.g., for stress analysis, the
!                     desired mesh density is fine; and for dynamic analysis,
!                     the desired mesh density is coarse).
!
!                           0 (or blank) = fine mesh density
!
!                           1 = coarse mesh density
!
!                           n = user defined divisions for all lines less
!                               than or equal to 3.0*ELMNL.
!
!                     If MSHDENS is assigned any numerical value (n) other
!                     than 0 or 1, then any line that is less than or equal
!                     to 3 times ELMNL is sized that numerical value line
!                     divisions.
!
!       (3) etpa = element type to be used for area meshing
!
!       (4) elmnl = element minimum edge length
!
!       (5) elmxl = element maximum edge length
!
!       *** (6) lszmsh = Options for line sizing and performing mesh operation:
!
!               - When it is desired to resize the previously sized lines:
!
!         (default) 1 (or blank) = perform line sizing and mesh operation(s)
!                   2 = perform line sizing, DO NOT mesh
!
!               - When it is desired to NOT resize the previously sized lines:
!
!                   -1 = perform line sizing and mesh operation(s)
!                   -2 = perform line sizing, DO NOT mesh
!
!                   3 = DO NOT perform line sizing, perform mesh operation
!
!
!       *** (7) mat = material properties # to be used in meshing operations.
!                     If left blank (defaults to 1).
!
!       *** (8) real = real constant set #, if applicable.
!
!       *** (9) ecs = coordinate system # for associated elements (element
!                     coordinate systems) (defaults to global cartesian)
!
!       *** NOTE: Arguments 6, 7, 8 and 9 are all defaults as listed above.
!                 Therefore, if using these defaults, then these arguments
!                 may be left blank. Otherwise, they may be specified as needed.
!
!       See MSH_ALGORITHM documentation for an in-depth explanation of their use.
!
!   DESCRIPTION:
!
!   The purpose of this sub_macro is to execute MSH_ALGORITHM under the simpler
!   set of circumstances most commonly encountered in area meshing operations
!   only. Its use will alleviate the cumbersome task of deciphering all the
!   arguments to use or specify in MSH_ALGORITHM when meshing only areas, where
!   most arguments are not used.
!
!   The defaults are:
!
!               a.)  perform line sizing and area meshing (LSZMSH=1)
!               b.)  material type 1 (MTRL=1)
!               c.)  no specified real constant set (REAL not specified)
!               d.)  default element coordinate system (ECS=0)
!
!   This macro is used when the following MSH_ALGORITHM arguments NEED NOT be
!   specified:
!
!         a.) PERFMSH:
!                 perform mesh is already set to 1 (PERFMSH=1), area meshing
!                 only
!
!         b.) ELMSZOVR:
!                 no element size over-ride since no volume sweeping
!
!         c.) ETPV:
!                 no volume meshing
!
!         d.) VOLSEL:
!                 volumes DO NOT have to be specified since no volume sweeping
!
!         e.) ATARGOV:
!                 target areas DO NOT have to be specified since no volume
!                 sweeping
!
!         f.) RADROT, VARCANG, ELL:
!                 where radii of rotation, volume arc angles and/or element
!                 element longitudinal lengths DO NOT have to be specified
!                 since no volume sweeping
!
!         g.) SPRAT:
!                 elements of constant spacing ratio are used
!
!
!
!
*get,prkey_,active,0,prkey
/nopr

mtyp_=arg1
mdens_=arg2
etypa_=arg3
mnl_=arg4
mxl_=arg5
lszmsh_=arg6
matl_=arg7
rlcs_=arg8
elcs_=arg9
!
!
*if,matl_,eq,0,then
    matl_=1
*endif
!
*if,lszmsh_,eq,0,then
    lsiz_=1
    pfmsh_=1
*elseif,lszmsh_,eq,1,then
    lsiz_=1
    pfmsh_=1
*elseif,lszmsh_,eq,2,then
    lsiz_=1
    pfmsh_=0
*elseif,lszmsh_,eq,3,then
    lsiz_=0
    pfmsh_=1
*elseif,lszmsh_,eq,-1,then
    lsiz_=-1
    pfmsh_=1
*elseif,lszmsh_,eq,-2,then
    lsiz_=-1
    pfmsh_=0
*endif
!
msh_algorithm,lsiz_,pfmsh_,mtyp_,mdens_,,,etypa_,,mnl_,mxl_,matl_,rlcs_,elcs_
!
!
*set,mtyp_,
*set,mdens_,
*set,etypa_,
*set,mnl_,
*set,mxl_,
*set,matl_,
*set,rlcs_,
*set,elcs_,
*set,lsiz_,
*set,pfmsh_,
*set,lszmsh_,

*if,prkey_,eq,1,then
    /go
*endif