cmo / create / cmo_box / / / hex cmo / geometry / cmo1 / geom_sph_box cmo / constraint / cmo1 / dummy * * This input file inserts a spherical hex grid inside a background * hex grid. * define / nx / 11 define / ny / 11 define / nz / 21 define / nrad_in / 3 define / nrad_out / 11 * * The following are the coordinates of the external * box that the mesh sphere mesh will be inserted into. * It is up to the user to have the xcen,ycen,zcen values * in the center of them minmax values. If you get the center * off, that could cause problems. * define / xmin / -3.0 define / xmax / 3.0 define / ymin / -3.0 define / ymax / 3.0 define / zmin / -3.0 define / zmax / 3.0 define / xcen / 0.0 define / ycen / 0.0 define / zcen / 0.0 * * The next set of coordinates define the size of * the hole that will be cut out of the background * mesh. These values must be smaller that the bounding * box defined above. Also, the hole will not have the * exact size of the numbers below. It will be the size * of the nearest larger set of coordinates. * define / xmin_h / -1.5 define / xmax_h / 1.5 define / ymin_h / -1.5 define / ymax_h / 1.5 define / zmin_h / -1.5 define / zmax_h / 1.5 * * This is the radius of the sphere. Again, this better be * smaller than the the hole cut out above. * * This is an absolute value. * define / rad_sph / 0.55 * * This is an relative scale value. * define / rad_box / 0.10 * * These are the material ID's of the box and sphere. * define / box_mat / 1 define / sph_mat / 2 * * * All the stuff below puts the sphere in the box. * Do not change below this line. * *------------------------------------------------ *------------------------------------------------ * createpts/brick/xyz/nx ny nz / xmin ymin zmin / xmax ymax zmax / 1 1 1 * * make a copy of the main grid volume cmo/copy/cmo1/cmo_box * cmo/select/cmo_box * coordinates are box that will contain the source region pset/p_hole/geom/xyz/1,0,0/xmin_h ymin_h zmin_h / xmax_h ymax_h zmax_h * remove box from main grid volume rmpoint/pset,get,p_hole/inclusive rmpoint/compress/ * cmo/select/cmo1/ * define elements that are IN the source box pset/p_hole/geom/xyz/1,0,0/xmin_h ymin_h zmin_h / xmax_h ymax_h zmax_h eltset/e_hole/inclusive/pset get p_hole eltset/e_not_hole/not e_hole/ rmpoint/elements/eltset,get,e_not_hole/ rmpoint/compress/ * dump / gmv / box_w_hole.gmv / cmo_box * dump / gmv / hole.gmv / cmo1 * * set material/color for sphere cmo / setatt / cmo1 / imt / 1 0 0 / sph_mat cmo / setatt / cmo1 / itetclr / 1 0 0 / sph_mat * *extracts boundary of cube extract/surfmesh/1 0 0/cmo2d/cmo1/ rmpoint/compress/ * dump/gmv/surface_box.gmv/cmo2d * *inside box cmo/status pset/p1/seq/1,0,0/ copypts/cmo2d/cmo2d/0,0/1,0,0/ zq/isetwd/0,0,0/0/ pset/p2/seq/0,0,0/ scale/pset,get,p2/radius/rtp/rad_sph rad_sph rad_sph/ xcen, ycen, zcen zq/imt/1,0,0/1/ settets/ * dump/gmv/inside_box.gmv/cmo2d *4th argument is number lines in outer box * * relative argument not implemented in lagrit version * * cmo / create / cmo1_3da / / / hex createpts/brick/interp/nrad_out/pset,get,p1/pset,get,p2/cmo1_3da/ dump/gmv/brick_int.gmv/cmo1_3da * *sphere cmo/delete/cmo2d/ cmo/select/cmo1/ *sets size of inside box scale/1,0,0/relative/xyz/rad_box,rad_box,rad_box/ xcen, ycen, zcen extract/surfmesh/1,0,0/cmo2d/cmo1/ rmpoint/compress/ pset/p1/seq/1,0,0/ copypts/-def-/-def-/0,0/1,0,0/ zq/isetwd/0,0,0/0/ pset/p2/seq/0,0,0/ scale/pset,get,p2/radius/rtp/rad_sph rad_sph rad_sph/ xcen, ycen, zcen zq/imt/1,0,0/2/ settets/ *4th argument is number lines in sphere * cmo / create / cmo1_3db / / / hex rzbrick/interp/nrad_in/pset,get,p1/pset,get,p2/cmo1_3db/ * * dump/gmv/sphere_all.gmv/cmo1_3db addmesh/merge/cmo1_3da/cmo1_3da/cmo1_3db/ dump / avs / merged1.inp / cmo1_3da cmo / delete / cmo1_3da read / avs / merged1.inp / cmptmp dump / gmv / merged1.gmv / cmptmp dump / avs / cmo_box.inp / cmo_box read / avs / cmo_box.inp / cmo_boxa addmesh/merge/cmptmp/cmptmp/cmo_boxa/ cmo / delete / cmo_boxa dump / avs / merged2.inp / cmptmp cmo / delete / cmotmp read / avs / merged2.inp / cmo1_3daaa dump / gmv / merged2.gmv / cmo1_3daaa filter/1,0,0/ rmpoint/compress/ geniee dump / gmv / box_w_sphere.gmv / cmo1_3daaa * remove sphere rmmat / sph_mat / element rmpoint/compress geniee * dump / gmv / box_w_no_sphere.gmv / cmo1_3daaa * * Get rid of everything but a single octant. * pset / pkeep / geom / xyz / 1 0 0 / xcen, ycen, zcen, xmax, ymax, zmax pset / premove / not pkeep rmpoint/pset,get,premove/inclusive rmpoint / compress geniee * dump / gmv / octant.gmv / cmo1_3daaa finish