PCL Examples > Property Assignment Functions > Materials
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Materials
This section contains examples of some of the functions that pertain to material composites.
.  
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function material.create()
#
#                      This function creates a material in the
#                      database.
#
#                      In this example a new database is opened and
#                      a material (Aluminium) is created using this
#                      function. The number of materials present in
#                      the database is obtained, before and after the
#                      calling of this function for verification.
#
#                      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 material.create()
#  has the following arguments:
#
#  material.create
#     (  analysis_code_str,
#        analysis_code_id,
#        analysis_type_str,
#        analysis_type_id,
#        mat_name,
#        mat_id,
#        description,
#        mat_cat,
#        mat_cat_id,
#        dir_str,
#        dir_id,
#        lin_str,
#        lin_id,
#        mat_type_name,
#        mat_type_id,
#        cm_name,
#        cm_id,
#        opt_str,
#        opt_names,
#        opt_ids,
#        act_str,
#        act_flag,
#        action,
#        mat_exist,
#        ext_flag_str,
#        ext_flag,
#        prop_ids_str,
#        prop_names,
#        prop_ids,
#        string_va_str,
#        prop_values )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_analysis_code_str[64]
INTEGER  i_analysis_code_id
STRING   s_analysis_type_str[64]
INTEGER  i_analysis_type_id
STRING   s_mat_name[64]
INTEGER  i_mat_id
STRING   s_description[64]
STRING   s_mat_cat[64]
INTEGER  i_mat_cat_id
STRING   s_dir_str[64]
INTEGER  i_dir_id
STRING   s_lin_str[64]
INTEGER  i_lin_id
STRING   s_mat_type_name[64]
INTEGER  i_mat_type_id
STRING   s_cm_name[64]
INTEGER  i_cm_id
STRING   s_opt_str[64]
STRING   sa_opt_names[64](5)
INTEGER  ia_opt_ids(5)
STRING   s_act_str[64]
INTEGER  i_act_flag
STRING   s_action[64]
INTEGER  i_mat_exist
STRING   s_ext_flag_str[64]
LOGICAL  l_ext_flag
STRING   s_prop_ids_str[64]
STRING   sa_prop_names[64](3)
INTEGER  ia_prop_ids(4)
STRING   s_string_va_str[64]
STRING   sa_prop_values[64](4)
INTEGER  i_return_value
INTEGER  i_count
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Count the number of materials before creation of material
 
i_return_value =                                 @
   db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
#  Create Material "Aluminium"
 
s_analysis_code_str = "Analysis code ID"
i_analysis_code_id  = 1
s_analysis_type_str = "Analysis type ID"
i_analysis_type_id  = 1
s_mat_name          = "Aluminium"
i_mat_id            = 0
s_description       = ""
s_mat_cat           = "Isotropic"
i_mat_cat_id        = 1
s_dir_str           = "Directionality"
i_dir_id            = 1
s_lin_str           = "Linearity"
i_lin_id            = 1
s_mat_type_name     = "Homogeneous"
i_mat_type_id       = 0
s_cm_name           = "Linear Elastic"
i_cm_id             = 1
s_opt_str           = "Model Options & IDs"
sa_opt_names(1)     = ""
sa_opt_names(2)     = ""
sa_opt_names(3)     = ""
sa_opt_names(4)     = ""
sa_opt_names(5)     = ""
ia_opt_ids          = [0,0,0,0,0]
s_act_str           = "Active Flag"
i_act_flag          = 1
s_action            = "Create"
i_mat_exist         = 10
s_ext_flag_str      = "External Flag"
l_ext_flag          = FALSE
s_prop_ids_str      = "Property IDs"
sa_prop_names(1)    = "Elastic Modulus"
sa_prop_names(2)    = "Poisson Ratio"
sa_prop_names(3)    = "Density"
ia_prop_ids         = [2, 5, 16, 0]
s_string_va_str     = "Property Values"
sa_prop_values(1)   = "10E6"
sa_prop_values(2)   = "0.31"
sa_prop_values(3)   = "0.1"
sa_prop_values(4)   = ""
 
i_return_value =                                 @
   material.create                               @
      (  s_analysis_code_str,                    @
         i_analysis_code_id,                     @
         s_analysis_type_str,                    @
         i_analysis_type_id,                     @
         s_mat_name,                             @
         i_mat_id,                               @
         s_description,                          @
         s_mat_cat,                              @
         i_mat_cat_id,                           @
         s_dir_str,                              @
         i_dir_id,                               @
         s_lin_str,                              @
         i_lin_id,                               @
         s_mat_type_name,                        @
         i_mat_type_id,                          @
         s_cm_name,                              @
         i_cm_id,                                @
         s_opt_str,                              @
         sa_opt_names,                           @
         ia_opt_ids,                             @
         s_act_str,                              @
         i_act_flag,                             @
         s_action,                               @
         i_mat_exist,                            @
         s_ext_flag_str,                         @
         l_ext_flag,                             @
         s_prop_ids_str,                         @
         sa_prop_names,                          @
         ia_prop_ids,                            @
         s_string_va_str,                        @
         sa_prop_values )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value =                                 @
   db_count_materials ( i_count )
dump i_return_value
dump i_count
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function mat_create_lam()
#
#                      This function creates a laminated composite
#                      material in the database given the stacking
#                      sequence.
#
#                      In this example a new database is opened and
#                      two materials (MAT_1 and MAT_2) are created.
#                      Then this function is called to create a
#                      laminate composite (COMPOSITE_LAMINATE) with
#                      MAT_1 and MAT_2 as ply materials.
#                      The number of materials present in the database
#                      is obtained, before and after the calling of
#                      this function for verification.
#
#                      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 mat_create_lam()
#  has the following arguments:
#
#  mat_create_lam
#     (  mat_name,
#        description,
#        iconv,
#        ply_names,
#        thicks,
#        orients,
#        num_names,
#        offset_string,
#        action )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
STRING   s_description[32]
INTEGER  i_iconv
STRING   sa_ply_names[32](6)
REAL     ra_thicks(6)
REAL     ra_orients(6)
INTEGER  i_num_names
STRING   s_offset_string[32]
STRING   s_action[32]
INTEGER  i_return_value
INTEGER  i_count
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create Material "MAT_1" & "MAT_2"
 
i_return_value =                                                @
   material.create("Analysis code ID", 1, "Analysis type ID",1, @
      "MAT_1", 0,"", "Isotropic", 1, "Directionality", 1,       @
      "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1,    @
      "Model Options & IDs",["","","", "", ""], [0, 0, 0, 0, 0],@
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Elastic Modulus", "Poisson Ratio",      @
      "Density"], [2, 5, 16,0],"Property Values",["10E6","0.31",@
      "0.1", ""] )
dump i_return_value
 
i_return_value =                                                @
   material.create("Analysis code ID", 1, "Analysis type ID",1, @
      "MAT_2", 0,"", "Isotropic", 1, "Directionality", 1,       @
      "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1,    @
      "Model Options & IDs",["","","", "", ""], [0, 0, 0, 0, 0],@
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Elastic Modulus", "Poisson Ratio",      @
      "Density"], [2, 5, 16,0],"Property Values",["20E6","0.32",@
      "0.2", ""] )
dump i_return_value
#---------------------------------------------------------------------
#  Count the number of materials before creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
#  Create Laminate "COMPOSITE_LAMINATE"
 
s_mat_name       = "COMPOSITE_LAMINATE"
s_description    = ""
i_iconv          = 1
sa_ply_names(1)  = "MAT_1"
sa_ply_names(2)  = "MAT_2"
sa_ply_names(3)  = "MAT_1"
sa_ply_names(4)  = "MAT_2"
sa_ply_names(5)  = "MAT_1"
sa_ply_names(6)  = "MAT_2"
ra_thicks        = [0.01, 0.02, 0.01, 0.02,0.01, 0.02]
ra_orients       = [-60., 0., -60., 0., -60., 0.]
i_num_names      = 6
s_offset_string  = ""
s_action         = "Create"
 
i_return_value =                                                @
   mat_create_lam                                               @
      (  s_mat_name,                                            @
         s_description,                                         @
         i_iconv,                                               @
         sa_ply_names,                                          @
         ra_thicks,                                             @
         ra_orients,                                            @
         i_num_names,                                           @
         s_offset_string,                                       @
         s_action )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function mat_create_mix()
#
#                      This function creates a Rule-of-mixture
#                      material in the database.
#
#                      In this example a new database is opened and
#                      two materials (MAT_1 and MAT_2) are created.
#                      Then this function is called to create a
#                      Rule-of-mixture material(COMPOSITE_RULE_OF_MIX)
#                      with MAT_1 and MAT_2 as constituent materials.
#                      The number of materials present in the database
#                      is obtained before and after the calling of
#                      this function for verification.
#
#                      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 mat_create_mix()
#  has the following arguments:
#
#  mat_create_mix
#     (  mat_name,
#        description,
#        phase_string,
#        vf_string,
#        orient_string,
#        action )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
STRING   s_description[32]
STRING   s_phase_string[32]
STRING   s_vf_string[32]
STRING   s_orient_string[32]
STRING   s_action[32]
INTEGER  i_return_value
INTEGER  i_count
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create Material "MAT_1" & "MAT_2"
 
i_return_value =                                                @
   material.create("Analysis code ID", 1, "Analysis type ID",1, @
      "MAT_1", 0,"", "Isotropic", 1, "Directionality", 1,       @
      "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1,    @
      "Model Options & IDs",["","","", "", ""], [0, 0, 0, 0, 0],@
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Elastic Modulus", "Poisson Ratio",      @
      "Density"], [2, 5, 16,0],"Property Values",["10E6","0.31",@
      "0.1", ""] )
dump i_return_value
 
i_return_value =                                                @
   material.create("Analysis code ID", 1, "Analysis type ID",1, @
      "MAT_2", 0,"", "Isotropic", 1, "Directionality", 1,       @
      "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1,    @
      "Model Options & IDs",["","","", "", ""], [0, 0, 0, 0, 0],@
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Elastic Modulus", "Poisson Ratio",      @
      "Density"], [2, 5, 16,0],"Property Values",["20E6","0.32",@
      "0.2", ""] )
dump i_return_value
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
#  Create Composite "COMPOSITE_RULE_OF_MIX"
 
s_mat_name      = "COMPOSITE_RULE_OF_MIX"
s_description   = ""
s_phase_string  = "MAT_1 MAT_2"
s_vf_string     = "0.5 0.5"
s_orient_string = "10.0 20.0 30.  40. 50. 60."
s_action        = "Create"
 
i_return_value =                                                @
   mat_create_mix                                               @
      (  s_mat_name,                                            @
         s_description,                                         @
         s_phase_string,                                        @
         s_vf_string,                                           @
         s_orient_string,                                       @
         s_action )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function mat_hal_create()
#
#                      This function creates a Halpin-Tsai material in
#                      the database.
#
#                      In this example a new database is opened and
#                      two materials (ISO_MAT and ANISO_MAT) are
#                      created. Then this function is called to create
#                      a Halpin-Tsai material (Halpin_Tsai_CFC) with
#                      ANISO_MAT as fiber and ISO_MAT as matrix.
#                      The number of materials present in the database
#                      is obtained, before and after the calling of
#                      this function for verification.
#
#                      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 mat_hal_create()
#  has the following arguments:
#
#  mat_hal_create
#     (  mat_name,
#        description,
#        iopt,
#        fvf,
#        mvf,
#        theory,
#        aspect_ratios,
#        override,
#        fudge_factors,
#        fiber_name,
#        matrix_name,
#        action )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
STRING   s_description[32]
INTEGER  i_iopt
REAL     r_fvf
REAL     r_mvf
INTEGER  i_theory
STRING   sa_aspect_ratios[32](2)
LOGICAL  l_override
STRING   sa_fudge_factors[32](7)
STRING   s_fiber_name[64]
STRING   s_matrix_name[64]
STRING   s_action[64]
INTEGER  i_return_value
INTEGER  i_count
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create Material "ISO_MAT" & "ANISO_MAT"
i_return_value =                                                @
   material.create("Analysis code ID", 1, "Analysis type ID",1, @
      "ISO_MAT", 0,"", "Isotropic", 1, "Directionality", 1,     @
      "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1,    @
      "Model Options & IDs",["","","", "", ""], [0, 0, 0, 0, 0],@
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Elastic Modulus", "Poisson Ratio",      @
      "Density"], [2, 5, 16,0],"Property Values",["10E6","0.31",@
      "0.1", ""] )
dump i_return_value
 
i_return_value =                                                @
   material.create( "Analysis code ID", 1, "Analysis type ID",  @
      1, "ANISO_MAT",0,"", "3d Anisotropic", 3,"Directionality",@
      3, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @
      "Model Options & IDs",["","","","",""], [0, 0, 0, 0, 0],  @
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Stiffness 11", "Stiffness 12",          @
      "Stiffness 13","Stiffness 14","Stiffness 15",             @
      "Stiffness 16", "Stiffness 22", "Stiffness 23",           @
      "Stiffness 24", "Stiffness 25", "Stiffness 26",           @
      "Stiffness 33", "Stiffness 34", "Stiffness 35",           @
      "Stiffness 36", "Stiffness 44", "Stiffness 45",           @
      "Stiffness 46", "Stiffness 55", "Stiffness 56",           @
      "Stiffness 66", "Density", "Thermal Expan. Coeff",        @
      "Thermal Expan. Coeff 22", "Thermal Expan. Coeff 33",     @
      "Thermal Expan. Coeff 12", "Thermal Expan. Coeff 31",     @
      "Thermal Expan. Coeff 23", "Reference Temperature"],      @
      [54, 55, 56, 66, 67, 68, 57, 58, 69, 70, 71, 59, 72, 73,  @
      74, 60, 61, 62, 63, 64, 65, 16, 24, 25, 26, 27, 29, 28, 1,@
      0], "Property Values", ["0.11", "0.12", "0.13", "0.14",   @
      "0.15", "0.16", "0.22", "0.23", "0.24", "0.25", "0.26",   @
      "0.33", "0.34", "0.35", "0.36", "0.44", "0.45", "0.46",   @
      "0.55", "0.56", "0.66", "0.1", "0.11", "0.22", "0.33",    @
      "0.12", "0.31", "0.23", "20.0", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
 
s_mat_name          = "Halpin_Tsai_CFC"
s_description       = ""
i_iopt              = 1
r_fvf               = 0.5
r_mvf               = 0.5
i_theory            = 1
l_override          = FALSE
s_fiber_name        = "ANISO_MAT"
s_matrix_name       = "ISO_MAT"
s_action            = "Create"
 
i_return_value =                                                @
   mat_hal_create                                               @
      (  s_mat_name,                                            @
         s_description,                                         @
         i_iopt,                                                @
         r_fvf,                                                 @
         r_mvf,                                                 @
         i_theory,                                              @
         sa_aspect_ratios,                                      @
         l_override,                                            @
         sa_fudge_factors,                                      @
         s_fiber_name,                                          @
         s_matrix_name,                                         @
         s_action )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
   
()
#
#  Purpose          :  This file provides an example of a call to the
#                      function mat_sfc_create()
#
#                      This function creates a Short Fiber Composite
#                      in the database.
#
#                      In this example a new database is opened and
#                      a material (MAT_2D_ORTHO) is created. Then this
#                      function is called to create a Short Fiber
#                      Composite material (MAT_SFC) with MAT_2D_ORTHO
#                      as the phase material.  The number of materials
#                      present in the database is obtained, before and
#                      after the calling of this function for
#                      verification.
#
#                      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 mat_sfc_create()
#  has the following arguments:
#
#  mat_sfc_create
#     (  mat_name,
#        description,
#        iopt,
#        mo1,
#        mo2,
#        sd1,
#        sd2,
#        col,
#        niter,
#        uni_mat_name,
#        action )
#
#---------------------------------------------------------------------
#  Variable Declarations
STRING   s_mat_name[32]
STRING   s_description[32]
INTEGER  i_iopt
REAL     r_mo1
REAL     r_mo2
REAL     r_sd1
REAL     r_sd2
REAL     r_col
INTEGER  i_niter
STRING   s_uni_mat_name[32]
STRING   s_action[32]
INTEGER  i_return_value
INTEGER  i_count
#---------------------------------------------------------------------
#  Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
 
#---------------------------------------------------------------------
#  Create Material "MAT_2D_ORTHO"
 
i_return_value =                                                @
   material.create( "Analysis code ID", 1, "Analysis type ID",  @
      1,"MAT_2D_ORTHO",0,"","2d Orthotropic",5,"Directionality",@
      4, "Linearity", 1, "Homogeneous", 0, "Linear Elastic", 1, @
      "Model Options & IDs", ["", "", "", "", ""],[0,0,0, 0, 0],@
      "Active Flag", 1, "Create", 10, "External Flag", FALSE,   @
      "Property IDs", ["Elastic Modulus","Elastic Modulus 22",  @
      "Poisson Ratio", "Shear Modulus", "Shear Modulus 23",     @
      "Shear Modulus 31", "Density", "Thermal Expan. Coeff",    @
      "Thermal Expan. Coeff 22"], [2, 3, 5, 8, 9, 10, 16, 24,   @
      25, 0], "Property Values", ["0.11", "0.22", "0.12","0.12",@
      "0.23", "0.13", "0.1", "0.11", "0.22", ""] )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------
#  Create
 
s_mat_name      = "MAT_SFC"
s_description   = ""
i_iopt          = 1
r_mo1           = 0.0
r_mo2           = 0.0
r_sd1           = 10.
r_sd2           = 0.0
r_col           = 0.0
i_niter         = 1000
s_uni_mat_name  = "MAT_2D_ORTHO"
s_action        = "Create"
 
i_return_value =                                                @
   mat_sfc_create                                               @
      (  s_mat_name,                                            @
         s_description,                                         @
         i_iopt,                                                @
         r_mo1,                                                 @
         r_mo2,                                                 @
         r_sd1,                                                 @
         r_sd2,                                                 @
         r_col,                                                 @
         i_niter,                                               @
         s_uni_mat_name,                                        @
         s_action )
dump i_return_value
 
#---------------------------------------------------------------------
#  Count the number of materials after creation of material
 
i_return_value = db_count_materials ( i_count )
dump i_return_value
dump i_count
 
#---------------------------------------------------------------------