PCL Examples > Property Assignment Functions > Loads and Boundary Conditions
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Loads and Boundary Conditions
This section contains examples of some of the functions that pertain to loads and boundary conditions (Loads/BCs).
.  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function loadsbcs_create()
#
#                      This function creates a new Load/BC set in the
#                      database.
#
#                      In this example a new database is opened and a
#                      cuboid of dimension 5 X 1 X 1 is created. Then
#                      this function is called to create a load set
#                      consisting of force, "New_Force" on the edge of
#                      the cuboid. The creation is verified by getting
#                      the number of lbcs present in the database
#                      before and after the creation of the load set.
#
#                      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 loadsbcs_create()
#  has the following arguments:
#
#  loadsbcs_create
#     (  lbc_name,
#        lbc_type,
#        lbc_category,
#        target_element,
#        load_case_type,
#        ap_list,
#        geo_filter,
#        alt_coord_frame,
#        lbc_scale_factor,
#        static_data,
#        dynamic_data)
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_lbc_name[32]
STRING   s_lbc_type[66]
STRING   s_lbc_category[32]
STRING   s_target_element[32]
STRING   s_load_case_type[32]
STRING   sa_ap_list[32](1)
STRING   s_geo_filter[32]
STRING   s_alt_coord_frame[200]
REAL     r_lbc_scale_factor
STRING   sa_static_data[100](2)
STRING   sa_dynamic_data[200](2)
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
INTEGER  i_load_count
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                 @
   ga_view_aa_set                                @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                 @
   asm_const_hpat_xyz                            @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",   @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count number of Loads/BCs before load set creation
i_return_value =                                 @
   db_count_lbc(i_load_count)
dump i_return_value
dump i_load_count
 
#---------------------------------------------------------------------
#  Create load set "New_Force"
 
s_lbc_name         = "New_Force"
s_lbc_type         = "Force"
s_lbc_category     = "Nodal"
s_target_element   = ""
s_load_case_type   = "Static"
sa_ap_list(1)      = "Solid 1.2.3"
s_geo_filter       = "Geometry"
s_alt_coord_frame  = "Coord 0"
r_lbc_scale_factor = 1.0
sa_static_data(1)  = "< 0. -100. 0. >"
sa_static_data(2)  = "< 0. 0.    0. >"
sa_dynamic_data(1) = ""
sa_dynamic_data(2) = ""
 
i_return_value =                                 @
   loadsbcs_create                               @
      (  s_lbc_name,                             @
         s_lbc_type,                             @
         s_lbc_category,                         @
         s_target_element,                       @
         s_load_case_type,                       @
         sa_ap_list,                             @
         s_geo_filter,                           @
         s_alt_coord_frame,                      @
         r_lbc_scale_factor,                     @
         sa_static_data,                         @
         sa_dynamic_data)
dump i_return_value
 
#  Count number of Loads/BCs after load set creation
i_return_value =                                 @
   db_count_lbc(i_load_count)
dump i_return_value
dump i_load_count
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
#---------------------------------------------------------------------
  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function loadsbcs_delete()
#
#                      This function deletes the specified Load/BC
#                      sets from the database.
#
#                      In this example a new database is opened and a
#                      cuboid of dimension 5 X 1 X 1 is created. Then
#                      a load set is created consisting of force,
#                      "New_Force" on the edge of the cuboid. Then
#                      this function is called to delete the created
#                      load set, after a pause.The deletion is
#                      verified by getting the number of lbcs present
#                      in the database before and after the deletion
#                      of the load set.
#
#                      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 loadsbcs_delete()
#  has the following arguments:
#
#  loadsbcs_delete
#     (  lbc_names )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   sa_lbc_names[32](1)
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
INTEGER  i_load_count
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                 @
   ga_view_aa_set                                @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                 @
   asm_const_hpat_xyz                            @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",   @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create load set "New_Force"
i_return_value =                                 @
   loadsbcs_create                               @
      (  "New_Force", "Force", "Nodal", "",      @
         "Static", ["Solid 1.2.3"], "Geometry",  @
         "Coord 0", 1., ["<0. -100. 0.>",        @
         "< 0. 0. 0.>"], ["", ""] )
dump i_return_value
 
#  Count number of Loads/BCs after load set creation
i_return_value =                                 @
   db_count_lbc(i_load_count)
dump i_return_value
dump i_load_count
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
 
#---------------------------------------------------------------------
#  Delete load set "New_Force"
 
sa_lbc_names(1) = "New_Force"
 
i_return_value =                                 @
   loadsbcs_delete                               @
      (  sa_lbc_names )
dump i_return_value
 
#  Count number of Loads/BCs after load set creation
i_return_value =                                 @
   db_count_lbc(i_load_count)
dump i_return_value
dump i_load_count
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function loadsbcs_modify()
#
#                      This function modifies the specified Load/BC
#                      sets in the database.
#
#                      In this example a new database is opened and a
#                      cuboid of dimension 5 X 1 X 1 is created. Then
#                      a load set is created consisting of force,
#                      "New_Force" on the edge of the cuboid. Then
#                      this function is called to modify the created
#                      load set, after a pause. The application region
#                      and the name of the load set are modified.
#
#                      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 loadsbcs_modify()
#  has the following arguments:
#
#  loadsbcs_modify
#     (  old_name,
#        new_name,
#        lbc_type,
#        lbc_category,
#        target_element,
#        load_case_type,
#        ap_list,
#        geo_filter,
#        alt_coord_frame,
#        lbc_scale_factor,
#        static_data,
#        dynamic_data )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_old_name[32]
STRING   s_new_name[32]
STRING   s_lbc_type[32]
STRING   s_lbc_category[32]
STRING   s_target_element[32]
STRING   s_load_case_type[32]
STRING   sa_ap_list[32](1)
STRING   s_geo_filter[32]
STRING   s_alt_coord_frame[200]
REAL     r_lbc_scale_factor
STRING   sa_static_data[100](2)
STRING   sa_dynamic_data[200](2)
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                 @
   ga_view_aa_set                                @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                 @
   asm_const_hpat_xyz                            @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",   @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create load set "New_Force"
i_return_value =                                 @
   loadsbcs_create                               @
      (  "New_Force", "Force", "Nodal", "",      @
         "Static", ["Solid 1.2.3"], "Geometry",  @
         "Coord 0", 1., ["<0. -100. 0.>",        @
         "< 0. 0. 0.>"], ["", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
 
#---------------------------------------------------------------------
#  Modify load set "New_Force" to "Modified_Force"
 
s_old_name         = "New_Force"
s_new_name         = "Modified_Force"
s_lbc_type         = "Force"
s_lbc_category     = "Nodal"
s_target_element   = ""
s_load_case_type   = "Static"
sa_ap_list(1)      = "Solid 1.4.3"
s_geo_filter       = "Geometry"
s_alt_coord_frame  = "Coord 0"
r_lbc_scale_factor = 1.0
sa_static_data(1)  = "< 0. -100. 0. >"
sa_static_data(2)  = "< 0. 0.    0. >"
sa_dynamic_data(1) = ""
sa_dynamic_data(2) = ""
 
i_return_value =                                 @
   loadsbcs_modify                               @
      (  s_old_name,                             @
         s_new_name,                             @
         s_lbc_type,                             @
         s_lbc_category,                         @
         s_target_element,                       @
         s_load_case_type,                       @
         sa_ap_list,                             @
         s_geo_filter,                           @
         s_alt_coord_frame,                      @
         r_lbc_scale_factor,                     @
         sa_static_data,                         @
         sa_dynamic_data )
dump i_return_value
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function loadsbcs_plot_contours()
#
#                      This function displays contour of the selected
#                      data variable on the selected group for an
#                      Load/BC in the current load case.
#
#                      In this example a new database is opened and a
#                      surface ( 5 X 1 ) in XZ plane is created. Then
#                      load set of varying pressure ("New_Press" - 0
#                      to 500 Units ) is created on the surface using
#                      field, "New_Field". Then this function is
#                      called to display the contours of
#                      "Top Surf Pressure" of load set "New_Press" for
#                      default group. Warnings generated during the
#                      execution of this example are to be ignored.
#
#                      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 loadsbcs_plot_contours()
#  has the following arguments:
#
#  loadsbcs_plot_contours
#     (  lbc_type,
#        dynamic_value,
#        data_variable,
#        vector_component,
#        lbc_name,
#        group_names )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_lbc_type[32]
REAL     r_dynamic_value
STRING   sa_data_variable[32]
STRING   sa_vector_component[32]
STRING   sa_lbc_name[32](1)
STRING   sa_group_names[32](1)
INTEGER  i_return_value
STRING   sv_create_patch_xy_created_ids[VIRTUAL]
INTEGER  i_fem_mesh_surfa_num_nodes
INTEGER  i_fem_mesh_surfa_num_elems
STRING   sv_fem_mesh_s_nodes_created[VIRTUAL]
STRING   sv_fem_mesh_s_elems_created[VIRTUAL]
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                  @
   ga_view_aa_set                                 @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create surface
i_return_value =                                  @
   asm_const_patch_xyz                            @
      (  "1", "<5 0 1>", "[0 0 0]", "Coord 0",    @
         sv_create_patch_xy_created_ids )
dump i_return_value
 
#  Create Finite Elements
i_return_value =                                  @
   fem_create_mesh_surf_2                         @
      (  "IsoMesh", 0, "Surface 1 ", 1, [1.],     @
         "Quad4", "1", "1" , "Coord 0","Coord 0", @
         i_fem_mesh_surfa_num_nodes,              @
         i_fem_mesh_surfa_num_elems,              @
         sv_fem_mesh_s_nodes_created,             @
         sv_fem_mesh_s_elems_created )
dump i_return_value
 
#  Create field "New_Field"
i_return_value =                                  @
   fields_create                                  @
      (  "New_Field", "Spatial", 1, "Scalar",     @
         "Real", "Coord 0", "", "Function",1,"X", @
         "", "", "100*’X", "", "", FALSE, [0.],   @
         [0.], [0.], [[[0.]]] )
dump i_return_value
 
#  Create load set "New_Press"
i_return_value =                                  @
   loadsbcs_create                                @
      (  "New_Press","Pressure","Element Uniform",@
         "2D", "Static",["Surface 1"],"Geometry", @
         "", 1., ["f:New_Field", " 0", " 0"],     @
         ["", "", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Plot contours
 
s_lbc_type             = "Pressure"
r_dynamic_value        = 0.
sa_data_variable       = "Top Surf Pressure"
sa_vector_component    = "Resultant"
sa_lbc_name(1)         = "New_Press"
sa_group_names(1)      = "default_group"
 
i_return_value =                                  @
   loadsbcs_plot_contours                         @
      (  s_lbc_type,                              @
         r_dynamic_value,                         @
         sa_data_variable,                        @
         sa_vector_component,                     @
         sa_lbc_name,                             @
         sa_group_names )
dump i_return_value
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_patch_xy_created_ids)
sys_free_string( sv_fem_mesh_s_nodes_created)
sys_free_string( sv_fem_mesh_s_elems_created)
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function loadsbcs_plot_markers()
#
#                      In this example a new database is opened and a
#                      cuboid of dimension 5 X 1 X 1 with a load set
#                      (New_Disp) is created. Then the markers of 
#                      "New_Disp" is displayed using this function 
#                      after a pause.
#
#                      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 loadsbcs_plot_markers()
#  has the following arguments:
#
#  loadsbcs_plot_markers
#     (  lbc_name,
#        group_names )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   sa_lbc_name[32](1)
STRING   sa_group_names[32](1)
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                 @
   ga_view_aa_set                                @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                 @
   asm_const_hpat_xyz                            @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",   @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create load sets "New_Disp"
i_return_value =                                 @
   loadsbcs_create                               @
      (  "New_Disp", "Displacement", "Nodal","", @
         "Static", ["Point 1 2 5 6"], "Geometry",@
         "Coord 0", 1., ["< 0. 0. 0. >",         @
         "<0. 0. 0.>"], ["", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Session file paused. Press "Resume" to continue..
sf_pause()
 
#---------------------------------------------------------------------
#  Plot markers for load set "New_Disp"
 
sa_lbc_name(1)    = "New_Disp"
sa_group_names(1) = "default_group"
 
i_return_value =                                 @
   loadsbcs_plot_markers                         @
      (  sa_lbc_name,                            @
         sa_group_names )
dump i_return_value
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function loadsbcs_show()
#
#                      This function shows a display of data for a
#                      selected Load/BC set on a spreadsheet.
#
#                      In this example a new database is opened and a
#                      cuboid of dimension 5 X 1 X 1 with a load set,
#                      "New_Force" is created. Then this function is
#                      called to display the tabular details of the
#                      lbc "New_Force".
#
#                      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 loadsbcs_show()
#  has the following arguments:
#
#  loadsbcs_show
#     (  lbc_name )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_lbc_name[32]
INTEGER  i_return_value
STRING   sv_create_hpat_xyz_created_ids[VIRTUAL]
#---------------------------------------------------------------------
#  Open a new database
uil_file_new.go( "", "new.db" )
$? YES 36000002
 
#  Set ISO-1 viewing
i_return_value =                                 @
   ga_view_aa_set                                @
      (  23., -34., 0. )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create cuboid
i_return_value =                                 @
   asm_const_hpat_xyz                            @
      (  "1", "<5 1 1>", "[0 0 0]", "Coord 0",   @
         sv_create_hpat_xyz_created_ids )
dump i_return_value
 
#---------------------------------------------------------------------
#  Create load set "New_Force"
i_return_value =                                 @
   loadsbcs_create                               @
      (  "New_Force", "Force", "Nodal", "",      @
         "Static", ["Solid 1.2.3"], "Geometry",  @
         "Coord 0", 1., ["<0. -100. 0.>",        @
         "< 0. 0. 0.>"], ["", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Display lbc details in Tabular form
 
s_lbc_name = "New_Force"
 
loadsbcs_show( s_lbc_name )
 
#---------------------------------------------------------------------
#  Free allocated memory
sys_free_string( sv_create_hpat_xyz_created_ids)
#---------------------------------------------------------------------