initial upload

This commit is contained in:
2025-12-17 11:00:57 +08:00
parent 2bc7b24a71
commit a09a73537f
4614 changed files with 3478433 additions and 2 deletions

View File

@@ -0,0 +1,309 @@
# Test stack and exodus
# include method notes in this command file
# Convert binary mesh_fsets.exo with ncdump executable:
# ncdump mesh_fsets.exo > mesh_fsets.exo.ascii.txt
# Note: exodus sorts elements by material ID
# So multi-material meshes may have an element order
# different than the non-exodus non-sorted mesh
# See Test 05
# define Z variables
define / Z1 / 0.1
define / Z2 / 0.2
###################################
# Test 01
# stack single triangle into a prism element
# Stack triangle surfaces into prism mesh
# The mesh should have itetclr set for exodus cell blocks
# The node properties are ignored as exodus is cell based
# Different from FEHM which has properties on nodes
# write files to stack
read / avs / input_one_tri.inp / mo1
cmo / setatt / mo1 / zic / 1 0 0 / Z1
dump / avs / out_one_tri_z1.inp / mo1 / 1 1 0 0
cmo / setatt / mo1 / zic / 1 0 0 / 0.0
dump / avs / out_one_tri_z0.inp / mo1 / 1 1 0 0
# stack
cmo / create / mostack / / / tri
stack / layers / avs / out_one_tri_z0.inp 1 out_one_tri_z1.inp
stack / fill / moprism / mostack
resetpts / itp
quality
dump / avs / out_prism_one.inp / moprism
dump / exo / out_prism_one.exo / moprism
cmo / delete / mo1
cmo / delete / mostack
cmo / delete / moprism
###################################
# Test 02
# stack triangle surface into 200 prisms
# single layer of prism elements mesh
cmo / create / mo1 / / / triplane
createpts / xyz / 11 11 1 / 0. 0. 0. / 1. 1. 0. / 1 1 1
cmo/setatt/mo1/ itetclr 1
cmo/setatt/mo1/ imt 1
resetpts/itp
cmo/setatt/mo1/ imt 1
connect
cmo/setatt/mo1/ itetclr 1
resetpts/itp
# write files to stack
cmo / setatt / mo1 / zic / 1 0 0 / Z1
dump / avs / out_one_tri_z1.inp / mo1 / 1 1 0 0
cmo / setatt / mo1 / zic / 1 0 0 / 0.0
dump / avs / out_one_tri_z0.inp / mo1 / 1 1 0 0
# stack
cmo / create / mostack / / / tri
stack / layers / avs / out_one_tri_z0.inp 1 out_one_tri_z1.inp
stack / fill / moprism / mostack
resetpts / itp
quality
dump / avs / out_prism_one_layer.inp / moprism
dump / exo / out_prism_one_layer.exo / moprism
cmo / delete / mo1
cmo / delete / mostack
cmo / delete / moprism
###################################
# Test 03
# stack triangle surface into 2 layers of prisms
# top layer 200 prisms materal 2
# bottom layer 200 prisms material 1
cmo / create / mo1 / / / triplane
createpts / xyz / 11 11 1 / 0. 0. 0. / 1. 1. 0. / 1 1 1
cmo/setatt/mo1/ imt 1
connect
cmo/setatt/mo1/ itetclr 1
resetpts/itp
# write files to stack
cmo / setatt / mo1 / zic / 1 0 0 / Z2
cmo / setatt / mo1 / itetclr / 1 0 0 / 1
dump / avs / out_one_tri_z2.inp / mo1 / 1 1 0 0
cmo / setatt / mo1 / zic / 1 0 0 / Z1
cmo / setatt / mo1 / itetclr / 1 0 0 / 1
dump / avs / out_one_tri_z1.inp / mo1 / 1 1 0 0
cmo / setatt / mo1 / zic / 1 0 0 / 0.0
cmo / setatt / mo1 / itetclr / 1 0 0 / 1
dump / avs / out_one_tri_z0.inp / mo1 / 1 1 0 0
# stack
cmo / create / mostack / / / tri
stack / layers / avs / out_one_tri_z0.inp 1 &
out_one_tri_z1.inp 2 &
out_one_tri_z2.inp
stack / fill / moprism / mostack
resetpts / itp
dump / avs / out_prism_two_layer.inp / moprism
dump / exo / out_prism_two_layer.exo / moprism
cmo / delete / mo1
cmo / delete / mostack
cmo / delete / moprism
###################################
# Test 04
# Prism Layers with perturbed elevations
# other layers are flat elevation
cmo / create / mo1 / / / triplane
createpts / xyz / 11 11 1 / 0. 0. 0. / 1. 1. 0. / 1 1 1
cmo/setatt/mo1/ imt 1
connect
cmo/setatt/mo1/ itetclr 1
resetpts/itp
cmo / setatt / mo1 / zic / 1 0 0 / Z2
cmo / setatt / mo1 / itetclr / 1 0 0 / 1
dump / avs / out_one_tri_z2.inp / mo1 / 1 1 0 0
cmo / setatt / mo1 / zic / 1 0 0 / Z1
perturb / 1 0 0 / 0. 0. 0.03
cmo / setatt / mo1 / itetclr / 1 0 0 / 1
dump / avs / out_one_tri_z1.inp / mo1 / 1 1 0 0
cmo / setatt / mo1 / zic / 1 0 0 / 0.0
cmo / setatt / mo1 / itetclr / 1 0 0 / 1
dump / avs / out_one_tri_z0.inp / mo1 / 1 1 0 0
cmo / create / mostack / / / tri
stack / layers / avs / out_one_tri_z0.inp 1 &
out_one_tri_z1.inp 2 &
out_one_tri_z2.inp
stack / fill / moprism / mostack
resetpts / itp
dump / avs / out_prism_two_layer_pb_z.inp / moprism
dump / exo / out_prism_two_layer_pb_z.exo / moprism
cmo / delete / mo1
cmo / delete / mostack
###################################
# Test 05
# Create facesets for each of 6 mesh directions
## IMPORTANT ###################
# For multi-material meshes, the elements need to be
# 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.
cmo / select / moprism
cmo / printatt / moprism / -all- minmax
# pre-sort the mesh by material value.
# sort based on itetclr values and the element median point
createpts / median
sort / moprism / index / ascending / ikey / itetclr xmed ymed zmed
reorder / moprism / ikey
cmo / DELATT / moprism / ikey
# Extract outside faces of mesh, these will have tri faces
# on the top and bottom with quad faces on the sides
# Attributes are created during extract used in exodus.
# idelem1 and idface1 (elem-face) are written to faceset files
# these faceset files are read by exodus to set side sets
extract / surfmesh / 1 0 0 / mo_surf / moprism / external
# Set surface elements to direction they face based on normals
cmo / addatt / mo_surf / id_side / vint / scalar / nelements
cmo / select mo_surf
settets / normal
cmo / copyatt / mo_surf mo_surf / id_side itetclr
dump avs out_prism_outside_faces.inp mo_surf
# Remove all attributes except idelem1 and idface1
cmo / printatt / mo_surf / -all- / minmax
cmo / DELATT / mo_surf / itetclr0
cmo / DELATT / mo_surf / itetclr1
cmo / DELATT / mo_surf / idnode0
cmo / DELATT / mo_surf / idelem0
cmo / DELATT / mo_surf / facecol
cmo / DELATT / mo_surf / idface0
cmo / DELATT / mo_surf / layertyp
# Set surface faces based on normal directions
# 1 = bottom
# 2 = top
# 3 = east right
# 4 = north back
# 5 = west left
# 6 = south front
# set some variables
define NUM_BOT 1
define FILE_FS_1 out_fs_1_bottom.faceset
define NUM_TOP 2
define FILE_FS_2 out_fs_2_top.faceset
define NUM_RIGHT 3
define FILE_FS_3 out_fs_3_right.faceset
define NUM_BACK 4
define FILE_FS_4 out_fs_4_back.faceset
define NUM_LEFT 5
define FILE_FS_5 out_fs_5_left.faceset
define NUM_FRONT 6
define FILE_FS_6 out_fs_6_front.faceset
# write the faceset files for each boundary
cmo/copy / mo_tmp / mo_surf
cmo/select / mo_tmp
eltset/ e_bottom / id_side / eq / NUM_BOT
eltset/ e_delete / not / e_bottom
rmpoint/element / eltset get e_delete
rmpoint/compress
cmo/DELATT/mo_tmp/id_side
dump/ avs / FILE_FS_1 / mo_tmp / 0 0 0 2
cmo/delete / mo_tmp
cmo/copy / mo_tmp / mo_surf
cmo/select / mo_tmp
eltset/ e_top / id_side / eq / NUM_TOP
eltset/ e_delete / not / e_top
rmpoint/element / eltset get e_delete
rmpoint/compress
cmo/DELATT/mo_tmp/id_side
dump/ avs / FILE_FS_2 / mo_tmp / 0 0 0 2
cmo/delete / mo_tmp
cmo/copy / mo_tmp / mo_surf
cmo/select / mo_tmp
eltset/ e_right / id_side / eq / NUM_RIGHT
eltset/ e_delete / not / e_right
rmpoint/element / eltset get e_delete
rmpoint/compress
cmo/DELATT/mo_tmp/id_side
dump/ avs / FILE_FS_3 / mo_tmp / 0 0 0 2
cmo/delete / mo_tmp
cmo/copy / mo_tmp / mo_surf
cmo/select / mo_tmp
eltset/ e_back / id_side / eq / NUM_BACK
eltset/ e_delete / not / e_back
rmpoint/element / eltset get e_delete
rmpoint/compress
cmo/DELATT/mo_tmp/id_side
dump/ avs / FILE_FS_4 / mo_tmp / 0 0 0 2
cmo/delete / mo_tmp
cmo/copy / mo_tmp / mo_surf
cmo/select / mo_tmp
eltset/ e_left / id_side / eq / NUM_LEFT
eltset/ e_delete / not / e_left
rmpoint/element / eltset get e_delete
rmpoint/compress
cmo/DELATT/mo_tmp/id_side
dump/ avs / FILE_FS_5 / mo_tmp / 0 0 0 2
cmo/delete / mo_tmp
cmo/copy / mo_tmp / mo_surf
cmo/select / mo_tmp
eltset/ e_front / id_side / eq / NUM_FRONT
eltset/ e_delete / not / e_front
rmpoint/element / eltset get e_delete
rmpoint/compress
cmo/DELATT/mo_tmp/id_side
dump/ avs / FILE_FS_6 / mo_tmp / 0 0 0 2
cmo/delete / mo_tmp
# After faceset files have been written, write the final files
# Note the file order will detirmine integer value of set in exo
# so have set 1 first, set 2 second, ...
dump / exo / out_mesh_fsets.exo / moprism / / / facesets &
FILE_FS_1 FILE_FS_2 FILE_FS_3 &
FILE_FS_4 FILE_FS_5 FILE_FS_6
dump / avs / out_mesh_fsets.inp / moprism
# Create single material mesh
cmo setatt moprism itetclr 1
cmo setatt moprism imt 1
resetpts itp
dump / exo / out_mesh_fsets_single_mat.exo / moprism / / / facesets &
FILE_FS_1 FILE_FS_2 FILE_FS_3 &
FILE_FS_4 FILE_FS_5 FILE_FS_6
dump / avs / out_mesh_fsets_single_mat.inp / moprism
finish