hexagon logo

Error while Creating pressure using fields. please see error description.

FUNCTION field_pr()
## Variable Declaration
STRING s_name[32]
STRING type[32]
STRING elm_type[32]
INTEGER e_dim
STRING a_kind[32]
STRING elm[256](1)
STRING ap_region[32]
STRING field_name[256](1)
STRING dummy[32]
INTEGER d_const
INTEGER k
INTEGER i_return_value
INTEGER lc_count
lc_count = 10
FOR (k=1 TO lc_count)
 
s_name  = "pr" // str_from_integer(k)
type  = "Pressure"
elm_type = "Element Uniform"
e_dim  = "2D"
a_kind  = "Static"
elm(1)  = "Element xxxxxxxxxxxx"
ap_region = "FEM"
dummy  = ""
d_const  = 1.
field_name(1)= "f:field" // str_from_integer(k)
FOR (k=1 TO 10)
# Create Load case "load_case" and assign it a variable k
i_return_value = loadsbcs_create( s_name, type, elm_type, @
e_dim, a_kind, elm, ap_region, dummy, d_const, field_name )
END FOR
END FUNCTION
​#####################
​PCL Error description:
​########################
​$# (PCL) Mismatched end type. Want: END FOR
​$# File: field_pr.pcl, Line: 46
​$# Line is "end function"
​$# Compilation aborted
Parents
  • @Darrel Sinclair  I have included Real number in my variable declaration. The new error is :
    ​$# Error reported from application LOADS_BCS
    ​$#    "1" is an invalid number of input data fields for the specified Load/BC definition. "3" input data fields are needed.
    ​My code is:
    ​FUNCTION field_pr()
    ## Variable Declaration
    STRING s_name[32]
    STRING type[32]
    STRING elm_type[32]
    STRING e_dim[32]
    STRING a_kind[32]
    STRING elm[256](1)
    STRING ap_region[32]
    STRING field_name[256](1)
    STRING dummy[32]
    REAL d_const
    STRING int_c[32](1)
    INTEGER k
    INTEGER i_return_value
    INTEGER lc_count
    lc_count = 10
    FOR (k=1 TO lc_count)
    loadcase_current_set( "load_case"//str_from_integer(k))
    s_name  = "pr" // str_from_integer(k)
    type  = "Pressure"
    elm_type = "Element Uniform"
    e_dim  = "2D"
    a_kind  = "Static"
    elm(1)  = "Element XXXXX"
    ap_region = "FEM"
    dummy  = ""
    d_const  = 1.
    field_name(1)= "f:field" // str_from_integer(k)
    int_c(1) = ""
    # Create Load case "load_case" and assign it a variable k
    i_return_value = loadsbcs_create( s_name, type, elm_type, @
    e_dim, a_kind, elm, ap_region, dummy, d_const, field_name, int_c )
    END FOR
    END FUNCTION
    ​Rgs,
    ​Vishal
Reply
  • @Darrel Sinclair  I have included Real number in my variable declaration. The new error is :
    ​$# Error reported from application LOADS_BCS
    ​$#    "1" is an invalid number of input data fields for the specified Load/BC definition. "3" input data fields are needed.
    ​My code is:
    ​FUNCTION field_pr()
    ## Variable Declaration
    STRING s_name[32]
    STRING type[32]
    STRING elm_type[32]
    STRING e_dim[32]
    STRING a_kind[32]
    STRING elm[256](1)
    STRING ap_region[32]
    STRING field_name[256](1)
    STRING dummy[32]
    REAL d_const
    STRING int_c[32](1)
    INTEGER k
    INTEGER i_return_value
    INTEGER lc_count
    lc_count = 10
    FOR (k=1 TO lc_count)
    loadcase_current_set( "load_case"//str_from_integer(k))
    s_name  = "pr" // str_from_integer(k)
    type  = "Pressure"
    elm_type = "Element Uniform"
    e_dim  = "2D"
    a_kind  = "Static"
    elm(1)  = "Element XXXXX"
    ap_region = "FEM"
    dummy  = ""
    d_const  = 1.
    field_name(1)= "f:field" // str_from_integer(k)
    int_c(1) = ""
    # Create Load case "load_case" and assign it a variable k
    i_return_value = loadsbcs_create( s_name, type, elm_type, @
    e_dim, a_kind, elm, ap_region, dummy, d_const, field_name, int_c )
    END FOR
    END FUNCTION
    ​Rgs,
    ​Vishal
Children
No Data