PCL Examples > Finite Element Functions > Equivalence Action
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Equivalence Action
This section contains examples of some of the functions used to reduce all of the finite element model nodes that coexist at a point in the model space to a single node.
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_all_group()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is then called to reduce all the
#                      nodes that coexist at single points to single
#                      nodes.
#
#                      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_equiv_all_group()
#  has the following arguments:
#
#  fem_equiv_all_group
#     (  group_id,
#        num_groups,
#        tolerance_type,
#        tolerance,
#        updated_tolerance,
#        segment_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  ia_group_id(1)
INTEGER  i_num_groups
INTEGER  i_tolerance_type
REAL     r_tolerance
REAL     r_updated_tolerance
INTEGER  i_segment_id
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Equivalence all the nodes
#
ia_group_id      = [0]
i_num_groups     = 0
i_tolerance_type = 1
r_tolerance      = 0.005
 
i_return_value =                                 @
   fem_equiv_all_group                           @
      (  ia_group_id,                            @
         i_num_groups,                           @
         i_tolerance_type,                       @
         r_tolerance,                            @
         r_updated_tolerance,                    @
         i_segment_id )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
 
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_all_group2()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is then called to reduce all the
#                      nodes that coexist at single points to single
#                      nodes.
#
#                      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_equiv_all_group2()
#  has the following arguments:
#
#  fem_equiv_all_group2
#     (  group_id,
#        num_groups,
#        tolerance_type,
#        tolerance,
#        verify,
#        updated_tolerance,
#        segment_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
INTEGER  ia_group_id(1)
INTEGER  i_num_groups
INTEGER  i_tolerance_type
REAL     r_tolerance
LOGICAL  l_verify
REAL     r_updated_tolerance
INTEGER  i_segment_id
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Equivalence all the nodes
#
ia_group_id      = [0]
i_num_groups     = 0
i_tolerance_type = 1
r_tolerance      = 0.005
l_verify         = TRUE
 
i_return_value =                                 @
   fem_equiv_all_group2                          @
      (  ia_group_id,                            @
         i_num_groups,                           @
         i_tolerance_type,                       @
         r_tolerance,                            @
         l_verify,                               @
         r_updated_tolerance,                    @
         i_segment_id )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
 
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_all_group3()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is then called to reduce all the
#                      nodes that coexist at single points to single
#                      nodes.
#
#                      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_equiv_all_group3()
#  has the following arguments:
#
#  fem_equiv_all_group3
#     (  group_names,
#        num_groups,
#        crg,
#        tolerance_type,
#        tolerance,
#        verify,
#        updated_tolerance,
#        segment_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   sa_group_names[32](0)
INTEGER  i_num_groups
STRING   sa_crg
INTEGER  i_tolerance_type
REAL     r_tolerance
LOGICAL  l_verify
REAL     r_updated_tolerance
INTEGER  i_segment_id
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Equivalence all the nodes
#
sa_group_names   = [""]
i_num_groups     = 0
s_exclude_select = "Node 6 7"
i_tolerance_type = 1
r_tolerance      = 0.005
l_verify         = TRUE
 
i_return_value =                                 @
   fem_equiv_all_group3                          @
      (  sa_group_names,                         @
         i_num_groups,                           @
         s_exclude_select,                       @
         i_tolerance_type,                       @
         r_tolerance,                            @
         l_verify,                               @
         r_updated_tolerance,                    @
         i_segment_id )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
 
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_list()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is then called to reduce all the
#                      selected nodes that coexist at single point to
#                      a single node.
#
#                      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_equiv_list()
#  has the following arguments:
#
#  fem_equiv_list
#     (  node_select,
#        tolerance_type,
#        tolerance,
#        updated_tolerance,
#        segment_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_node_select[32]
INTEGER  i_tolerance_type
REAL     r_tolerance
REAL     r_updated_tolerance
INTEGER  i_segment_id
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Equivalence the selected nodes
#
s_node_select    = "Node 1:13"
i_tolerance_type = 1
r_tolerance      = 0.005
 
i_return_value =                                 @
   fem_equiv_list                                @
      (  s_node_select,                          @
         i_tolerance_type,                       @
         r_tolerance,                            @
         r_updated_tolerance,                    @
         i_segment_id )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
 
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_list2()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is then called to reduce all the
#                      selected nodes that coexist at single point to
#                      a single node.
#
#                      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_equiv_list2()
#  has the following arguments:
#
#  fem_equiv_list2
#     (  node_select,
#        tolerance_type,
#        tolerance,
#        verify,
#        updated_tolerance,
#        segment_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_node_select[32]
INTEGER  i_tolerance_type
REAL     r_tolerance
LOGICAL  l_verify
REAL     r_updated_tolerance
INTEGER  i_segment_id
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Equivalence the selected nodes
#
s_node_select    = "Node 1:13"
i_tolerance_type = 1
r_tolerance      = 0.005
l_verify         = TRUE
 
i_return_value =                                 @
   fem_equiv_list2                               @
      (  s_node_select,                          @
         i_tolerance_type,                       @
         r_tolerance,                            @
         l_verify,                               @
         r_updated_tolerance,                    @
         i_segment_id )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
 
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_list3()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is then called to reduce all the
#                      selected nodes that coexist at single point to
#                      a single node.
#
#                      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_equiv_list3()
#  has the following arguments:
#
#  fem_equiv_list3
#     (  node_select,
#        exclude_select,
#        tolerance_type,
#        tolerance,
#        verify,
#        updated_tolerance,
#        segment_id )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_node_select[32]
STRING   s_exclude_select[32]
INTEGER  i_tolerance_type
REAL     r_tolerance
LOGICAL  l_verify
REAL     r_updated_tolerance
INTEGER  i_segment_id
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Equivalence the selected nodes
#
s_node_select    = "Node 1:13"
s_exclude_select = "Node 1 13"
i_tolerance_type = 1
r_tolerance      = 0.005
l_verify         = TRUE
 
i_return_value =                                 @
   fem_equiv_list3                               @
      (  s_node_select,                          @
         s_exclude_select,                       @
         i_tolerance_type,                       @
         r_tolerance,                            @
         l_verify,                               @
         r_updated_tolerance,                    @
         i_segment_id )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
 
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of 2 calls to the
#                      function fem_equiv_list_display.plot()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is called to save the display and
#                      erase all FEM entities. The function is then
#                      called again to plot only the nodes associated
#                      to free edges.
#
#                      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_equiv_list_display.plot()
#  has the following arguments:
#
#  fem_equiv_list_display.plot
#     (  plot_option,
#        entity_type,
#        entity_selection )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_plot_option[9]
INTEGER  i_entity_type
STRING   sv_entity_selection[VIRTUAL]
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   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 three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue.
sf_pause()
 
#---------------------------------------------------------------------
#  Save the display and erase all FEM entities
#
s_plot_option = "init"
i_entity_type = 0
 
i_return_value =                                 @
   fem_equiv_list_display.plot                   @
      (  s_plot_option,                          @
         i_entity_type,                          @
         sv_entity_selection )
dump i_return_value
dump sv_entity_selection
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue.
sf_pause()
 
#---------------------------------------------------------------------
#  Plot nodes associated to free edges
#
s_plot_option = "free_edge"
i_entity_type = 1
 
i_return_value =                                 @
   fem_equiv_list_display.plot                   @
      (  s_plot_option,                          @
         i_entity_type,                          @
         sv_entity_selection )
dump i_return_value
dump sv_entity_selection
 
sys_free_string(sv_entity_selection)
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
 
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function fem_equiv_preview()
#
#                      This session file creates a new database by the
#                      name new.db. Two curves are created and meshed.
#                      This function is called to preview the effect
#                      of equivalencing the nodes. Nodes are counted
#                      before and after preview to demonstrate that
#                      no actual reduction has taken place.
#
#                      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_equiv_preview()
#  has the following arguments:
#
#  fem_equiv_preview
#     (  node_select,
#        exclude_select,
#        tolerance_type,
#        tolerance,
#        entity_type,
#        updated_tolerance,
#        segment_id,
#        nodes_previewed,
#        elements_previewed,
#        nodes_reduced,
#        elements_reduced )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_node_select[32]
STRING   s_exclude_select[32]
INTEGER  i_tolerance_type
REAL     r_tolerance
INTEGER  i_entity_type
REAL     r_updated_tolerance
INTEGER  i_segment_id
STRING   sv_nodes_previewed[VIRTUAL]
STRING   sv_elements_previewed[VIRTUAL]
STRING   sv_nodes_reduced[VIRTUAL]
STRING   sv_elements_reduced[VIRTUAL]
INTEGER  i_num_nodes
INTEGER  i_num_fem_nodes
INTEGER  i_num_fem_elements
STRING   sv_fem_nodes_created[VIRTUAL]
STRING   sv_fem_elements_created[VIRTUAL]
STRING   sv_created_ids[VIRTUAL]
STRING   sv_entity_selection[VIRTUAL]
INTEGER  i_return_value
 
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create three points for creating curves
 
i_return_value =                                 @
   asm_const_grid_xyz                            @
      (  "1", "[0 4 0][5 4 0][3 5 0]",           @
         "Coord 0", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Create the two curves
 
i_return_value =                                 @
   asm_const_line_2point                         @
      (  "1", "Point 2 ", "Point 1 ", 0, "",     @
         50., 1, sv_created_ids) 
dump i_return_value
 
i_return_value =                                 @
   sgm_const_curve_arc3point                     @
      (  "2", FALSE, "Point 1 ", "Point 3",      @
         "Point 2 ", sv_created_ids)
dump i_return_value
 
#---------------------------------------------------------------------
#  Mesh the two curves
 
i_return_value =                                 @
   fem_create_mesh_curv                          @
      (  "Curve 1 2", 1., "Bar2", "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_value
 
node_label( TRUE )
bar_elem_label( TRUE )
 
#---------------------------------------------------------------------
#  Count the nodes
#
i_return_value =                                 @
   db_count_nodes ( i_num_nodes )
dump i_return_value
dump i_num_nodes
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue.
sf_pause()
 
#---------------------------------------------------------------------
#  Erase all FEM entities from the viewport
#
i_return_value =                                 @
   fem_equiv_list_display.plot                   @
      (  "init", 0, sv_entity_selection )
dump i_return_value
 
#---------------------------------------------------------------------
#  Preview the effect of equivalencing
#
s_node_select    = "Node 1:13"
s_exclude_select = "Node 1 13"
i_tolerance_type = 1
r_tolerance      = 0.005
i_entity_type    = 1
 
i_return_value =                                 @
   fem_equiv_preview                             @
      (  s_node_select,                          @
         s_exclude_select,                       @
         i_tolerance_type,                       @
         r_tolerance,                            @
         i_entity_type,                          @
         r_updated_tolerance,                    @
         i_segment_id,                           @
         sv_nodes_previewed,                     @
         sv_elements_previewed,                  @
         sv_nodes_reduced,                       @
         sv_elements_reduced )
dump i_return_value
dump r_updated_tolerance
dump i_segment_id
dump sv_nodes_previewed
dump sv_elements_previewed
dump sv_nodes_reduced
dump sv_elements_reduced
 
sys_free_string(sv_nodes_previewed)
sys_free_string(sv_elements_previewed)
sys_free_string(sv_nodes_reduced)
sys_free_string(sv_elements_reduced)
sys_free_string(sv_fem_nodes_created)
sys_free_string(sv_fem_elements_created)
sys_free_string(sv_created_ids)
sys_free_string(sv_entity_selection)
 
#---------------------------------------------------------------------
#  Count the nodes again
#
i_return_value =                                 @
   db_count_nodes ( i_num_nodes )
dump i_return_value
dump i_num_nodes
 
#---------------------------------------------------------------------