() |
## Purpose : This file provides an example of a call to the# function fem_optimize()## This session file creates a new database by the# name new.db. A surface is created and meshed.# This function is then called to renumber the# nodes so as to minimize the time required to# find a finite element solution.## 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_optimize()# has the following arguments:## fem_optimize# ( object,# method,# criterion,# starting_id,# bandwidth,# profile,# maximum_wavefront,# average_wavefront,# rms_wavefront )##---------------------------------------------------------------------# Variable DeclarationsSTRING s_object[8]STRING s_method[32]STRING s_criterion[32]INTEGER i_starting_idINTEGER ia_bandwidth(4)INTEGER ia_profile(4)INTEGER ia_maximum_wavefront(4)REAL ra_average_wavefront(4)REAL ra_rms_wavefront(4)INTEGER i_num_fem_nodesINTEGER i_num_fem_elementsSTRING sv_fem_nodes_created[VIRTUAL]STRING sv_fem_elements_created[VIRTUAL]STRING sv_created_ids[VIRTUAL]INTEGER i_return_value#---------------------------------------------------------------------# 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_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_num_fem_nodes, i_num_fem_elements, @ sv_fem_nodes_created, sv_fem_elements_created)dump i_return_valuenode_label( TRUE )#---------------------------------------------------------------------# Session file paused. Press "Resume" to continue.sf_pause()#---------------------------------------------------------------------# Optimize nodes in the model#s_object = "Nodes"s_method = "Both"s_criterion = "RMS Wavefront"i_starting_id = 1i_return_value = @ fem_optimize @ ( s_object, @ s_method, @ s_criterion, @ i_starting_id, @ ia_bandwidth, @ ia_profile, @ ia_maximum_wavefront, @ ra_average_wavefront, @ ra_rms_wavefront )dump i_return_valuedump ia_bandwidthdump ia_profiledump ia_maximum_wavefrontdump ra_average_wavefrontdump ra_rms_wavefrontsys_free_string(sv_fem_nodes_created)sys_free_string(sv_fem_elements_created)sys_free_string(sv_created_ids)#---------------------------------------------------------------------