# read the file with the 3D polygon mesh # this is a triangle mesh stacked into prism elements # such that tri faces show top and bottom, quads on sides # itetclr materials have been defined, facesets have not read/proto_full_poly.inp/mo_pri cmo status mo_pri ## Extract the outside surface of the polygon mesh # The extracted surface will have the element and element face # that were extracted from the 3D mesh elements # attributes, idelem1 and idface1 are written to faceset files # with each file grouped into seperate faceset files #### IMPORTANT ################### # The cells MUST be pre-sorted by itetclr material values # Exodus will reorder elements internally, we do not want the # cells to be re-ordered. If they are, faceset correlation to # the cell numbers will no longer be correct. # Check that facesets are correct by reading the exo file into GMV # and selecting Surfaces under Display. #--------- BEFORE EXTRACT -------------------------------------- # sort based on itetclr values and cell location # secondary sort conventions are up to user # xmed, ymed, zmed will arrange into columns (after itetclr sort) createpts / median sort / mo_pri / index / ascending / ikey / itetclr xmed ymed zmed reorder / mo_pri / ikey dump / gmv / out_tmp_sort1.gmv / mo_pri cmo / DELATT / mo_pri / ikey # sort nodes based on mesh convention z, y, then x sort / mo_pri / index / ascending / ikey / zic yic xic reorder / mo_pri / ikey dump gmv tmp_sort.gmv mo_pri cmo DELATT mo_pri xmed cmo DELATT mo_pri ymed cmo DELATT mo_pri zmed cmo DELATT mo_pri ikey #---------------------------------------------------------------- extract / surfmesh / 1 0 0 / mo_surf / mo_pri / external cmo / printatt / mo_surf / -all- / minmax ## Set surface elements to direction they face based on normals # These values will be written to itetclr, copy to id_side attribute # 1 = bottom # 2 = top # 3 = east right # 4 = north back # 5 = west left # 6 = south front cmo / addatt / mo_surf / id_side / vint / scalar / nelements cmo / select mo_surf settets / normal cmo / copyatt / mo_surf mo_surf / id_side itetclr cmo / printatt / mo_surf / id_side / minmax # this was previous convention, use settets convention instead. # so that top is now 2 and 1 is bottom, etc. # the settets convention is more widely used # cmo / setatt / mo_surf / id_side / eltset get etop / 1 # cmo / setatt / mo_surf / id_side / eltset get ebot / 2 # cmo / setatt / mo_surf / id_side / eltset get efro / 3 # cmo / setatt / mo_surf / id_side / eltset get ebac / 4 # cmo / setatt / mo_surf / id_side / eltset get elef / 5 # cmo / setatt / mo_surf / id_side / eltset get erig / 6 define / FILENAME / fs_3_rig.faceset define / SS_ID / 3 infile output_faceset.mlgi define / FILENAME / fs_4_bac.faceset define / SS_ID / 4 infile output_faceset.mlgi define / FILENAME / fs_5_lef.faceset define / SS_ID / 5 infile output_faceset.mlgi define / FILENAME / fs_6_fro.faceset define / SS_ID / 6 infile output_faceset.mlgi define / FILENAME / fs_1_bot.faceset define / SS_ID / 1 infile output_faceset.mlgi define / FILENAME / fs_2_top.faceset define / SS_ID / 2 infile output_faceset.mlgi ## CHECK that top number of faces = bottom = layer # this version layer has number of elements = 6272 ############################ # write some informational files and output dump / gmv / surf_sides.gmv / mo_surf cmo printatt mo_surf -all- minmax cmo printatt mo_pri -all- minmax cmo printatt mo_pri -xyz- minmax cmo select mo_pri quality volume itetclr ############################ # write final mesh with multi material and all facesets # node imt does not seem to be included in exo files dump / exo / mesh_fsets.exo / mo_pri / / / facesets & fs_1_bot.faceset fs_2_top.faceset fs_3_rig.faceset & fs_4_bac.faceset fs_5_lef.faceset fs_6_fro.faceset dump / avs2 / mesh_fsets.inp / mo_pri dump / gmv / mesh_fsets.gmv / mo_pri ############################ # version with single material and top faceset only cmo setatt mo_pri itetclr 1 cmo setatt mo_pri imt 1 resetpts itp dump / exo / mesh_fsets_1mat.exo / mo_pri / / / facesets & fs_1_bot.faceset fs_2_top.faceset fs_3_rig.faceset & fs_4_bac.faceset fs_5_lef.faceset fs_6_fro.faceset dump / avs2 / mesh_fsets_1mat.inp / mo_pri dump / gmv / mesh_fsets_1mat.gmv / mo_pri cmo printatt mo_pri -all- minmax finish