() |
## Purpose : This file provides an example of a call to the# function fem_mod_elem_reverse()## This file creates a surface and meshes it. It# modifies the connectivity (reverses) of a# particular element. Before and after this# activity it gets the connectivity of that# element to show the effect.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_mod_elem_reverse()# has the following arguments:## fem_mod_elem_reverse# ( element_select,# elements_reversed )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_element_select[32]STRING sv_elements_reversed[VIRTUAL]INTEGER i_return_valueSTRING sv_create_patch_xy_ids[VIRTUAL]INTEGER i_create_surfa_nodesINTEGER i_create_surfa_elemsSTRING sv_s_nodes_created[VIRTUAL]STRING sv_s_elems_created[VIRTUAL]INTEGER i_num_elemsINTEGER i_max_connectINTEGER ia_elem_ids(1) = [23]INTEGER ia_connectivity(4)#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_create_patch_xy_ids )dump i_return_value#---------------------------------------------------------------------# Mesh the surfacei_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_create_surfa_nodes, i_create_surfa_elems, @ sv_s_nodes_created, sv_s_elems_created )dump i_return_value#---------------------------------------------------------------------# Get the connectivity of elements i_num_elems = 1i_max_connect = 4i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, ia_elem_ids, ia_connectivity)dump i_return_valuedump ia_connectivity#---------------------------------------------------------------------# Modify the connectivity of the selected elements_element_select = "Elm 23"i_return_value = @ fem_mod_elem_reverse @ ( s_element_select, @ sv_elements_reversed )dump i_return_valuedump sv_elements_reversed#---------------------------------------------------------------------# Get the connectivity of elements i_return_value = @db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, ia_elem_ids, ia_connectivity)dump i_return_valuedump ia_connectivitysys_free_string(sv_create_patch_xy_ids)sys_free_string(sv_elements_reversed)sys_free_string(sv_s_nodes_created)sys_free_string(sv_s_elems_created)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_mod_elem_separate()## This file creates a surface and meshes it. It# separates a element at specified nodes. # Before and after this activity it gets the # connectivity of that element to show the effect## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_mod_elem_separate()# has the following arguments:## fem_mod_elem_separate# ( element_select,# node_select,# separation,# keep_association,# num_nodes,# nodes_created )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_element_select[128]STRING s_node_select[128]INTEGER i_separationLOGICAL l_keep_associationINTEGER i_num_nodesSTRING sv_nodes_created[VIRTUAL]INTEGER i_return_valueSTRING sv_create_patch_xy_ids[VIRTUAL]INTEGER i_create_surfa_nodesINTEGER i_create_surfa_elemsSTRING sv_s_nodes_created[VIRTUAL]STRING sv_s_elems_created[VIRTUAL]INTEGER i_num_elemsINTEGER i_max_connectINTEGER ia_elem_ids(1) = [23]INTEGER ia_connectivity(4)#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_create_patch_xy_ids )dump i_return_value#---------------------------------------------------------------------# Mesh the surface i_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_create_surfa_nodes, i_create_surfa_elems, @ sv_s_nodes_created, sv_s_elems_created )dump i_return_value#---------------------------------------------------------------------# Get the element connectivity i_num_elems = 1i_max_connect = 4i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, @ ia_elem_ids, ia_connectivity)dump i_return_valuedump ia_connectivity#---------------------------------------------------------------------# Separate the element at specified nodess_element_select = "Elm 23 "s_node_select = "Node 34 28 "i_separation = 1l_keep_association = FALSEi_return_value = @ fem_mod_elem_separate @ ( s_element_select, @ s_node_select, @ i_separation, @ l_keep_association, @ i_num_nodes, @ sv_nodes_created )dump i_return_valuedump i_num_nodesdump sv_nodes_created#---------------------------------------------------------------------# Get the element connectivity i_return_value = @ db_get_nodes_for_elems @ ( i_num_elems, i_max_connect, @ ia_elem_ids, ia_connectivity)dump i_return_valuedump ia_connectivitysys_free_string(sv_create_patch_xy_ids)sys_free_string(sv_nodes_created)sys_free_string(sv_s_nodes_created)sys_free_string(sv_s_elems_created)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_mod_quad_split_nm()## This file opens the new database "new.db" and# creates a "quad" element. Then splits this# quadrilateral element in a pattern (3 x 2).# Before and after split action it gets the count# of elements present in the database## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_mod_quad_split_nm()# has the following arguments:## fem_mod_quad_split_nm# ( pattern,# auto_manual,# element_select,# orientation_element,# num_selected,# num_orientation,# num_nodes_created,# num_elems_created,# num_nodes_deleted,# num_elems_deleted,# nodes_created,# elements_created,# nodes_deleted,# elements_deleted )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_pattern[128]STRING s_auto_manual[128]STRING s_element_select[128]STRING s_orientation_element[128]INTEGER i_num_selectedINTEGER i_num_orientationINTEGER i_num_nodes_createdINTEGER i_num_elems_createdINTEGER i_num_nodes_deletedINTEGER i_num_elems_deletedSTRING sv_nodes_created[VIRTUAL]STRING sv_elements_created[VIRTUAL]STRING sv_nodes_deleted[VIRTUAL]STRING sv_elements_deleted[VIRTUAL]INTEGER i_return_valueSTRING sv_create_patch_xy_ids[VIRTUAL]STRING sv_fem_elems_created[VIRTUAL]INTEGER i_num_elems#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_create_patch_xy_ids )dump i_return_value#---------------------------------------------------------------------# Create a quadrilateral element using the points of the surfacei_return_value = @ fem_create_elems @ ( "Quad", "Quad4", "1", "Standard", @ FALSE, "Point 1 ", "Point 2 ", "Point 3 ", @ "Point 4 ", "", "", "", "", @ sv_fem_elems_created )dump i_return_valuequad_elem_label ( TRUE )#---------------------------------------------------------------------# Count the number of quadrilateral elementsi_return_value = @ db_count_elems (i_num_elems ) dump i_num_elemsdump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Split the quadrilateral elements_pattern = "nm_quad"s_auto_manual = "Manual"s_element_select = "Elm 1 "s_orientation_element = "Elm 1.1.3 "i_num_selected = 3i_num_orientation = 2i_return_value = @ fem_mod_quad_split_nm @ ( s_pattern, @ s_auto_manual, @ s_element_select, @ s_orientation_element, @ i_num_selected, @ i_num_orientation, @ i_num_nodes_created, @ i_num_elems_created, @ i_num_nodes_deleted, @ i_num_elems_deleted, @ sv_nodes_created, @ sv_elements_created, @ sv_nodes_deleted, @ sv_elements_deleted )dump i_return_valuedump i_num_nodes_createddump i_num_elems_createddump i_num_nodes_deleteddump i_num_elems_deleteddump sv_nodes_createddump sv_elements_createddump sv_nodes_deleteddump sv_elements_deleted #---------------------------------------------------------------------# Count the number of quadrilateral elementsi_return_value = @ db_count_elems (i_num_elems )dump i_num_elemsdump i_return_valuesys_free_string(sv_create_patch_xy_ids)sys_free_string(sv_fem_elems_created)sys_free_string(sv_nodes_created)sys_free_string(sv_elements_created)sys_free_string(sv_nodes_deleted)sys_free_string(sv_elements_deleted)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_modify_nodes()## This file opens a new database "new.db" and # creates four nodes and modifies these four# nodes. Before and after modification it # gets their attributes using a function.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_modify_nodes()# has the following arguments:## fem_modify_nodes# ( node_select,# new_node_id,# ref_coord_frame,# anly_coord_frame,# point_select,# modify_options,# nodes_modified )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_node_select[128]STRING s_new_node_id[128]STRING s_ref_coord_frame[128]STRING s_anly_coord_frame[128]STRING s_point_select[128]INTEGER ia_modify_options(10) = [1, 1, 1, 0, 1, 0, 0, 0, 0, 0]STRING sv_nodes_modified[VIRTUAL]INTEGER i_return_valueSTRING sv_cord_3po_created_ids[VIRTUAL]STRING sv_xyz_created_ids[VIRTUAL]STRING sv_nodes_created[VIRTUAL]INTEGER i_num_nodes = 4INTEGER ia_node_ids(4) = [1, 2, 3, 4 ]INTEGER ia_ref_coords(4)INTEGER ia_analy_coords(4)REAL ra_glob_xyzs(12)#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a coordinatei_return_value = @asm_const_coord_3point @ ( "1", "Coord 0", 2, "[0 0 0]", "[0 0 1]", @ "[1 0 0]", sv_cord_3po_created_ids )dump i_return_value#---------------------------------------------------------------------# Create 8 pointsi_return_value = @asm_const_grid_xyz @ ( "1", "[0 0 0][1 0 0][1 1 0][0 1 0]", "Coord 0", @ sv_xyz_created_ids )dump i_return_valuei_return_value = @asm_const_grid_xyz @ ( "5", "[2 0 0][1 2 0][2 1 0][0 2 0]", "Coord 0", @ sv_xyz_created_ids )dump i_return_value#---------------------------------------------------------------------# Create 4 nodes on points one to fouri_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", TRUE, "1", "Point 1:4 ", @ sv_nodes_created )dump i_return_valuenode_label ( TRUE )#---------------------------------------------------------------------# Get the node attributesi_return_value = @ db_get_nodes @ ( i_num_nodes, ia_node_ids, ia_ref_coords, @ ia_analy_coords, ra_glob_xyzs ) dump i_return_valuedump ia_ref_coordsdump ia_analy_coordsdump ra_glob_xyzs#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Modify the attributess_node_select = "Node 1:4"s_new_node_id = "1:4"s_ref_coord_frame = "Coord 1"s_anly_coord_frame = "Coord 1"s_point_select = "Point 5:8"i_return_value = @ fem_modify_nodes @ ( s_node_select, @ s_new_node_id, @ s_ref_coord_frame, @ s_anly_coord_frame, @ s_point_select, @ ia_modify_options, @ sv_nodes_modified )dump i_return_valuedump sv_nodes_modified#---------------------------------------------------------------------# Get the modified node attributesi_return_value = @ db_get_nodes @ ( i_num_nodes, ia_node_ids, ia_ref_coords, @ ia_analy_coords, ra_glob_xyzs ) dump i_return_valuedump ia_ref_coordsdump ia_analy_coordsdump ra_glob_xyzssys_free_string(sv_xyz_created_ids)sys_free_string(sv_nodes_modified)sys_free_string(sv_cord_3po_created_ids)sys_free_string(sv_nodes_created)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_modify_nodes_offset()## This file creates two nodes and offset them# through 1 unit along y axis. After this # action the new location is obtained.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_modify_nodes_offset()# has the following arguments:## fem_modify_nodes_offset# ( transformation_type,# ref_coord_frame,# vector_direction,# magnitude,# reverse_direction,# node_select,# nodes_modified )##---------------------------------------------------------------------# Variable DeclarationsLOGICAL l_transformation_typeSTRING s_ref_coord_frame[128]STRING s_vector_direction[128]STRING s_magnitude[128]LOGICAL l_reverse_directionSTRING s_node_select[128]STRING sv_nodes_modified[VIRTUAL]INTEGER i_return_valueSTRING sv_grid_xyz_created_ids[VIRTUAL]STRING sv_nodes_created[VIRTUAL]INTEGER i_num_nodes = 2INTEGER ia_node_ids(2) = [1, 2 ]INTEGER ia_ref_coords(2)INTEGER ia_analy_coords(2)REAL ra_glob_xyzs(6)#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create two nodesi_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[0 0 0][1 0 0]", sv_nodes_created )dump i_return_valuenode_label ( TRUE )#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Offset one nodel_transformation_type = FALSEs_ref_coord_frame = "Coord 0"s_vector_direction = "Coord 0.2"s_magnitude = "1."l_reverse_direction = FALSEs_node_select = "Node 1"i_return_value = @ fem_modify_nodes_offset @ ( l_transformation_type, @ s_ref_coord_frame, @ s_vector_direction, @ s_magnitude, @ l_reverse_direction, @ s_node_select, @ sv_nodes_modified )dump i_return_valuedump sv_nodes_modified#---------------------------------------------------------------------# Get the new location of the nodesi_return_value = @ db_get_nodes @ ( i_num_nodes, @ ia_node_ids, @ ia_ref_coords, @ ia_analy_coords, @ ra_glob_xyzs )dump i_return_valuedump ra_glob_xyzssys_free_string(sv_grid_xyz_created_ids)sys_free_string(sv_nodes_created)sys_free_string(sv_nodes_modified)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_modify_elems()## This file opens a new database "new.db" and# creates 25 elements and modifies their topology# Before and after modification it# gets their topology ID using a function.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_modify_elems()# has the following arguments:## fem_modify_elems# ( new_element_id,# new_shape,# new_element_type,# current_node_select,# new_node_select,# element_select,# modify_options,# elements_modified )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_new_element_id[128]STRING s_new_shape[128]STRING s_new_element_type[128]STRING s_current_node_select[128]STRING s_new_node_select[128]STRING s_element_select[128]INTEGER ia_modify_options(10)STRING sv_elements_modified[VIRTUAL]INTEGER i_return_valueSTRING sv_patch_xy_created_ids[VIRTUAL]INTEGER i_surfa_num_nodesINTEGER i_surfa_num_elemsSTRING sv_s_nodes_created[VIRTUAL]STRING sv_s_elems_created[VIRTUAL]INTEGER i_num_elems = 25INTEGER ia_elem_ids(25) = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, @ 11, 12, 13, 14, 15, 16, 17, 18, @ 19, 20, 21, 22, 23, 24, 25 ]INTEGER ia_topo_codes(25)#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @ sv_patch_xy_created_ids )dump i_return_value#---------------------------------------------------------------------# Mesh the surfacei_return_value = @ fem_create_mesh_surf_2 @ ( "IsoMesh", 0, "Surface 1 ", 1, [0.2], @ "Quad4", "1", "1", "Coord 0", "Coord 0", @ i_surfa_num_nodes, i_surfa_num_elems, @ sv_s_nodes_created, sv_s_elems_created )dump i_return_valuenode_label ( TRUE )#---------------------------------------------------------------------# Get the topology of the elementsi_return_value = @ db_get_elem_etop @ ( i_num_elems, @ ia_elem_ids, @ ia_topo_codes ) dump i_return_valuedump ia_topo_codes#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Modify the element topologys_new_shape = "Quad"s_new_element_type = "Quad8"s_element_select = "Elm 1:25 "ia_modify_options = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0] i_return_value = @ fem_modify_elems @ ( s_new_element_id, @ s_new_shape, @ s_new_element_type, @ s_current_node_select, @ s_new_node_select, @ s_element_select, @ ia_modify_options, @ sv_elements_modified )dump i_return_valuedump sv_elements_modified#---------------------------------------------------------------------# Get the modified topologyi_return_value = @ db_get_elem_etop @ ( i_num_elems, @ ia_elem_ids, @ ia_topo_codes ) dump i_return_valuedump ia_topo_codessys_free_string(sv_patch_xy_created_ids)sys_free_string(sv_s_nodes_created)sys_free_string(sv_s_elems_created)sys_free_string(sv_elements_modified)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_modify_mpc_nodal()## This file opens a new database and creates# four nodes. It creates explicit MPC with # node 3 and node 1, 2. Then modifies the # MPC , changing the independent nodes as# node 2, 4.## This file can be run by starting a session of# Patran, and running this session file # through the "File","Session","Play" pulldown # menus on the menu bar.## The function fem_modify_mpc_nodal()# has the following arguments:## fem_modify_mpc_nodal# ( mpc_id,# constant,# num_terms,# dependency_flag,# coefficient,# node_select,# degrees_of_freedom )##---------------------------------------------------------------------# Variable DeclarationsINTEGER i_mpc_idREAL r_constantINTEGER i_num_termsLOGICAL la_dependency_flag(3)REAL ra_coefficient(3)STRING saa_node_select[6](3)STRING saa_degrees_of_freedom[14](3)INTEGER i_return_valueSTRING sv_nodes_created[VIRTUAL]STRING sv_elems_created[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create four nodesi_return_value = @ fem_create_nodes @ ( "Coord 0", "Coord 0", FALSE, "1", @ "[0 0 0][1 0 0][1 1 0][0 1 0]", sv_nodes_created )dump i_return_valuenode_label ( TRUE )#---------------------------------------------------------------------# Create a MPCi_return_value = @ fem_create_mpc_nodal @ ( 1, "Explicit", 1., 2, [TRUE, FALSE], [0., 1.], @ ["Node 3", "Node 1 2"], @ ["UX,UY,UZ,RX,RY", "UX,UY,UZ,RX,RY"] )dump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Modify the MPCi_mpc_id = 1r_constant = 1.0i_num_terms = 3la_dependency_flag = [TRUE, FALSE, FALSE]ra_coefficient = [0., 1., 1.]saa_node_select = ["Node 3", "Node 1", "Node 4"]saa_degrees_of_freedom = ["UX,UY,UZ,RX,RY", @ "UX,UY,UZ,RX,RY", "UX,UY,UZ,RX,RY"]i_return_value = @ fem_modify_mpc_nodal @ ( i_mpc_id, @ r_constant, @ i_num_terms, @ la_dependency_flag, @ ra_coefficient, @ saa_node_select, @ saa_degrees_of_freedom )dump i_return_valuesys_free_string(sv_nodes_created)sys_free_string(sv_elems_created)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_mod_bar_split()## This file opens a new database "new.db" and # creates a bar element, then splits it into# two. Before and after this action it gets# the number of elements in the database.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_mod_bar_split()# has the following arguments:## fem_mod_bar_split# ( element_select,# num_nodes_created,# num_elems_created,# num_nodes_deleted,# num_elems_deleted,# nodes_created,# elements_created,# nodes_deleted,# elements_deleted )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_element_select[32]INTEGER i_num_nodes_createdINTEGER i_num_elems_createdINTEGER i_num_nodes_deletedINTEGER i_num_elems_deletedSTRING sv_nodes_created[VIRTUAL]STRING sv_elements_created[VIRTUAL]STRING sv_nodes_deleted[VIRTUAL]STRING sv_elements_deleted[VIRTUAL]INTEGER i_return_valueSTRING sv_elemen_elems_created[VIRTUAL]INTEGER i_num_elems#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a bar elementi_return_value = @ fem_create_elems @ ( "Bar ", "Bar2", "1", "Standard", TRUE, @ "[0 0 0]", "[1 0 0]", "", "", "", "", "", "", @ sv_elemen_elems_created )dump i_return_valuebar_elem_label ( TRUE )#---------------------------------------------------------------------# Count the number of elementsi_return_value = @ db_count_elems (i_num_elems )dump i_num_elemsdump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Split the bar element into twos_element_select = "Elem 1"i_return_value = @ fem_mod_bar_split @ ( s_element_select, @ i_num_nodes_created, @ i_num_elems_created, @ i_num_nodes_deleted, @ i_num_elems_deleted, @ sv_nodes_created, @ sv_elements_created, @ sv_nodes_deleted, @ sv_elements_deleted )dump i_return_valuedump i_num_nodes_createddump i_num_elems_createddump i_num_nodes_deleteddump i_num_elems_deleteddump sv_nodes_createddump sv_elements_createddump sv_nodes_deleteddump sv_elements_deleted#---------------------------------------------------------------------# Count the number of elementsi_return_value = @ db_count_elems (i_num_elems )dump i_num_elemssys_free_string(sv_elemen_elems_created)sys_free_string(sv_nodes_created)sys_free_string(sv_elements_created)sys_free_string(sv_nodes_deleted)sys_free_string(sv_elements_deleted)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_mod_tria_split()## This file opens a new database "new.db" and# creates a tria element, then splits it in# a pattern. Before and after this action it gets# the number of elements in the database.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_mod_tria_split()# has the following arguments:## fem_mod_tria_split# ( pattern,# auto_manual,# element_select,# orientation_node,# num_nodes_created,# num_elems_created,# num_nodes_deleted,# num_elems_deleted,# nodes_created,# elements_created,# nodes_deleted,# elements_deleted )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_pattern[128]STRING s_auto_manual[128]STRING s_element_select[128]STRING s_orientation_node[128]INTEGER i_num_nodes_createdINTEGER i_num_elems_createdINTEGER i_num_nodes_deletedINTEGER i_num_elems_deletedSTRING sv_nodes_created[VIRTUAL]STRING sv_elements_created[VIRTUAL]STRING sv_nodes_deleted[VIRTUAL]STRING sv_elements_deleted[VIRTUAL]INTEGER i_return_valueSTRING sv_elemen_elems_created[VIRTUAL]INTEGER i_num_elems#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a triangular elementi_return_value = @ fem_create_elems @ ( "Tri ", "Tria3", "1", "Standard", FALSE, @ "[0 0 0]", "[1 0 0]", "[.5 1 0]", "", "", @ "", "", "", sv_elemen_elems_created )dump i_return_valuetri_elem_label (TRUE )#---------------------------------------------------------------------# Count the number of elementsi_return_value = @ db_count_elems (i_num_elems )dump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Split the triangular elements_pattern = "4_tria"s_auto_manual = "Auto"s_element_select = "Elm 1 "i_return_value = @ fem_mod_tria_split @ ( s_pattern, @ s_auto_manual, @ s_element_select, @ s_orientation_node, @ i_num_nodes_created, @ i_num_elems_created, @ i_num_nodes_deleted, @ i_num_elems_deleted, @ sv_nodes_created, @ sv_elements_created, @ sv_nodes_deleted, @ sv_elements_deleted )dump i_return_valuedump i_num_nodes_createddump i_num_elems_createddump i_num_nodes_deleteddump i_num_elems_deleteddump sv_nodes_createddump sv_elements_createddump sv_nodes_deleteddump sv_elements_deleted#---------------------------------------------------------------------# Count the number of elementsi_return_value = @ db_count_elems (i_num_elems )dump i_num_elemsdump i_return_valuesys_free_string(sv_elemen_elems_created)sys_free_string(sv_nodes_created)sys_free_string(sv_elements_created)sys_free_string(sv_nodes_deleted)sys_free_string(sv_elements_deleted)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function fem_mod_quad_split()## This file opens the new database "new.db" and# creates a "quad" element. Then splits this# quadrilateral element in a pattern.# Before and after split action it gets the count# of elements present in the database## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function fem_mod_quad_split()# has the following arguments:## fem_mod_quad_split# ( pattern,# auto_manual,# element_select,# orientation_node,# orientation_element,# num_nodes_created,# num_elems_created,# num_nodes_deleted,# num_elems_deleted,# nodes_created,# elements_created,# nodes_deleted,# elements_deleted )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_pattern[128]STRING s_auto_manual[128]STRING s_element_select[128]STRING s_orientation_node[128]STRING s_orientation_element[128]INTEGER i_num_nodes_createdINTEGER i_num_elems_createdINTEGER i_num_nodes_deletedINTEGER i_num_elems_deletedSTRING sv_nodes_created[VIRTUAL]STRING sv_elements_created[VIRTUAL]STRING sv_nodes_deleted[VIRTUAL]STRING sv_elements_deleted[VIRTUAL]INTEGER i_return_valueSTRING sv_create_patch_xy_ids[VIRTUAL]STRING sv_fem_elems_created[VIRTUAL]INTEGER i_num_elems#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", @ "Coord 0", sv_create_patch_xy_ids )dump i_return_value#---------------------------------------------------------------------# Create a quadrilateral element using the points of surfacei_return_value = @ fem_create_elems @ ( "Quad", "Quad4", "1", "Standard", @ FALSE, "Point 1 ", "Point 2 ", "Point 3 ", @ "Point 4 ", "", "", "", "", @ sv_fem_elems_created )dump i_return_valuequad_elem_label ( TRUE )#---------------------------------------------------------------------# Count the number of elementsi_return_value = @ db_count_elems (i_num_elems )dump i_num_elems#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Split the quadrilateral elements_pattern = "4_quad"s_auto_manual = "Auto"s_element_select = "Elm 1 "i_return_value = @ fem_mod_quad_split @ ( s_pattern, @ s_auto_manual, @ s_element_select, @ s_orientation_node, @ s_orientation_element, @ i_num_nodes_created, @ i_num_elems_created, @ i_num_nodes_deleted, @ i_num_elems_deleted, @ sv_nodes_created, @ sv_elements_created, @ sv_nodes_deleted, @ sv_elements_deleted )dump i_return_valuedump i_num_nodes_createddump i_num_elems_createddump i_num_nodes_deleteddump i_num_elems_deleteddump sv_nodes_createddump sv_elements_createddump sv_nodes_deleteddump sv_elements_deleted#---------------------------------------------------------------------# Count the number of elementsi_return_value = @ db_count_elems (i_num_elems )dump i_num_elemssys_free_string(sv_create_patch_xy_ids)sys_free_string(sv_fem_elems_created)sys_free_string(sv_nodes_created)sys_free_string(sv_elements_created)sys_free_string(sv_nodes_deleted)sys_free_string(sv_elements_deleted)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function modify_mesh_seed()## This file creates a surface and creates mesh# seed on one of it’s curves. Then it changes# the mesh seed of the same curve. ## This file can be run by starting a session of# Patran, and running this session file # through the "File","Session","Play" pulldown# menus on the menu bar.## The function modify_mesh_seed()# has the following arguments:## modify_mesh_seed# ( curve_list,# input_option,# num_elem,# ratio,# length1,# length2 )##---------------------------------------------------------------------# Variable DeclarationsSTRING sv_curve_list[VIRTUAL]INTEGER i_input_optionINTEGER i_num_elemREAL r_ratioREAL r_length1REAL r_length2INTEGER i_return_valueSTRING sv_patch_xy_created_ids[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @ sv_patch_xy_created_ids )dump i_return_value#---------------------------------------------------------------------# Create mesh seed on one curvei_return_value = @ mesh_seed_create @ ( "Surface 1.2 ", 1, 5, 0., 0., 0. )dump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Modify the mesh seedsv_curve_list = "Surface 1.2 "i_input_option = 3i_num_elem = 2r_ratio = 1.5r_length1 = 0.0r_length2 = 0.0i_return_value = @ modify_mesh_seed @ ( sv_curve_list, @ i_input_option, @ i_num_elem, @ r_ratio, @ r_length1, @ r_length2 )dump i_return_valuesys_free_string(sv_patch_xy_created_ids)sys_free_string(sv_curve_list)#---------------------------------------------------------------------() |
## Purpose : This file provides an example of a call to the# function modify_mesh_seed_tabular()## This file creates a surface and creates mesh# seed on one of it’s curves. Then it changes# the mesh seed of the same curve by tabular# method.## This file can be run by starting a session of# Patran, and running this session file# through the "File","Session","Play" pulldown# menus on the menu bar.## The function modify_mesh_seed_tabular()# has the following arguments:## modify_mesh_seed_tabular# ( curve_list,# coord_type,# num_nodes,# node_locs,# point_list )##---------------------------------------------------------------------# Variable DeclarationsSTRING sv_curve_list[VIRTUAL]STRING sv_coord_type[VIRTUAL]INTEGER i_num_nodesREAL ra_node_locs(3)STRING sv_point_list[VIRTUAL]INTEGER i_return_valueSTRING sv_patch_xy_created_ids[VIRTUAL]#---------------------------------------------------------------------# Open a new database "new.db"uil_file_new.go("","new.db")$? YES 36000002#---------------------------------------------------------------------# Create a surfacei_return_value = @ asm_const_patch_xyz @ ( "1", "<1 1 0>", "[0 0 0]", "Coord 0", @ sv_patch_xy_created_ids )dump i_return_value#---------------------------------------------------------------------# Create mesh seed on one curvei_return_value = @ mesh_seed_create_tabular @ ( "Surface 1.2 ", "Arc_Length", 11, @ [0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.] )dump i_return_value#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Modify the mesh seed by tabular methodsv_curve_list = "Surface 1.2 "sv_coord_type = "Arc_Length"i_num_nodes = 3ra_node_locs = [0., 0.5, 1.0 ]i_return_value = @ modify_mesh_seed_tabular @ ( sv_curve_list, @ sv_coord_type, @ i_num_nodes, @ ra_node_locs, @ sv_point_list, @ [-12345.] )dump i_return_valuesys_free_string(sv_patch_xy_created_ids)sys_free_string(sv_curve_list)sys_free_string(sv_coord_type)sys_free_string(sv_point_list)#---------------------------------------------------------------------