Week - 9 - Reflecting the geometry
Objective: To create a code to reflect elements for similar components and create components for them and properties depending on solver type
Procedure:
1. Provide the name for reflected components elements
2. Select source geometry
3. Select reflect to geometry
4. Select fe of components to be reflected
5. get centroid for both geomentry and create mid node of cog
6. Copy elements for duplicated components
6. Using mid node creating plane with distance for vector for reflecting elements

CodE:
proc nastran {n t} {
*createentity comps includeid=0 name=$n$t
set cid [hm_getvalue component name=$n$t dataname=id]
*createentity props cardimage=PSHELL includeid=0 name=$n$t
set pid [hm_getvalue property name=$n$t dataname=id]
*setvalue props id=$pid STATUS=1 95=$t
*setvalue comps id=$cid propertyid={props $pid}
*autocolor components
}
proc radioss {n t} {
*createentity comps cardimage=part includeid=0 name=$n$t
set cid [hm_getvalue component name=$n$t dataname=id]
*createentity props cardimage=P1_SHELL includeid=0 name=$n$t
set pid [hm_getvalue property name=$n$t dataname=id]
*setvalue props id=$pid STATUS=1 431=$t
*setvalue comps id=$cid propertyid={props $pid}
*autocolor components
}
# proc reflect {} {
set name [hm_getstring components Name "Enter name of destination components for FE"]
*createmarkpanel components 1 "Select the Source geometry"
set S_geom [hm_getmark comps 1]
*createmarkpanel components 1 "Select the destination geometry"
set D_geom [hm_getmark comps 1]
*createmarkpanel components 1 "Select the Source FE"
set S_fea [hm_getmark comps 1]
set profile [hm_info templatetype]
foreach i $S_fea {
set thick [hm_getthickness components $i]
set old [hm_getcollectorname comps $i]
set n $name$thick
$profile $name $thick
*createmark elements 1 $old
*copymark elements 1 $n
*displaycollectorwithfilter comps off $old 1 0
}
*createmark comps 2 "displayed"
*autocolorwithmark comps 2
*createmark surfaces 1 "bycollector" $S_geom
set S_cog [hm_getcentroid surfaces 1]
*createnode [lindex $S_cog 0] [lindex $S_cog 1] [lindex $S_cog 1]
*createmark node 2 -1
set S_node [hm_getmark node 2]
*clearmarkall 1;*clearmarkall 2;
*createmark surfaces 1 "bycollector" $D_geom
set D_cog [hm_getcentroid surfaces 1]
*createnode [lindex $D_cog 0] [lindex $D_cog 1] [lindex $D_cog 1]
*createmark node 2 -1
set D_node [hm_getmark node 2]
*clearmarkall 1;*clearmarkall 2;
*createnodesbetweennodes $S_node $D_node 1
*createmark node 2 -1
set m_node [hm_getmark node 2]
set m_node_coord [hm_getnodeinitialcoords $m_node]
set dist [hm_getdistance nodes $S_node $D_node 0]
*createmark elements 1 "displayed"
*createplane 1 [lindex $dist 1] [lindex $dist 2] [lindex $dist 3] [lindex $m_node_coord 0 0] [lindex $m_node_coord 0 1] [lindex $m_node_coord 0 2]
*reflectmark elements 1 1
*createmark elements 1 "displayed"
*equivalence elements 1 0.1 1 0 0
# }
# reflect;
Conclusion:
Reflected components:
