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
  • A pressure load on 2D elements has three possible entries on the form (top, bottom, and edge pressures), so the PCL function needs an array of three entries. One easy way of checking what you should be using for input is to create the required thing in Patran and look at the command that's issued in the history window. For a pressure load on 2D elements, this is what you get:
     
    loadsbcs_create2( "press", "Pressure", "Element Uniform", "2D", "Static", ["Element 1:25"], "FEM", "", "1.", [" 10", " ", " "], ["", "", ""] )
     
    The last two arguments are string arrays of size 3. Your arrays are size 1.
     
    Most PCL functions also have example code in the documentation that can help with understanding how they're supposed to work.
Reply
  • A pressure load on 2D elements has three possible entries on the form (top, bottom, and edge pressures), so the PCL function needs an array of three entries. One easy way of checking what you should be using for input is to create the required thing in Patran and look at the command that's issued in the history window. For a pressure load on 2D elements, this is what you get:
     
    loadsbcs_create2( "press", "Pressure", "Element Uniform", "2D", "Static", ["Element 1:25"], "FEM", "", "1.", [" 10", " ", " "], ["", "", ""] )
     
    The last two arguments are string arrays of size 3. Your arrays are size 1.
     
    Most PCL functions also have example code in the documentation that can help with understanding how they're supposed to work.
Children
No Data