PCL and Customization > Accessing the Patran Database > Element Properties
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Element Properties
Exporting Element Property Data
Element properties are grouped together in element property regions. Determine the number of element property regions, extract the IDs of all the regions and then extract the property data associated with each region. The count of property regions in the Patran is given by the function described below.
 
db_count_region_ids
( <num_regions> )
 
Output:
 
 
INTEGER
<num_regions>
The number of element property regions defined in the database.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFCountRegionIds.
 int DbFCountRegionIds ( num_regions )
 int 	*num_regions
The IDs of all the element property regions defined in the database can be obtained by using “db_get_all_region_ids”.
 
db_get_all_region_ids
( <num_regions>, <region_ids> )
 
Input:
 
 
INTEGER
<num_regions>
The number of regions defined in the database.
Output:
 
 
INTEGER ARRAY
<region_ids>
The <num_regions> IDs of all the element property regions defined in the database.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
 
Notes:
The C name differs. It is DbFGetAllRegionIds.
int DbFGetAllRegionIds ( num_regions, region_ids )
 int 	num_regions
 int 	*region_ids
Next, examine the definition of the property region to determine the element attributes assigned to all the elements belonging thereto. The function used to extract element property region definitions is “db_get_region_definition”:
 
db_get_region_definition
( <region_id>, <set_name>, <gener_elem_type>, <dof_set_flag>, <condense_flag>, <geom_flag>, <form_flag>, <lam_flag>, <layer_count>, <material_id>, <material_lin>, material_dir> )
 
Input:
 
 
INTEGER
<region_id>
The ID of the element property region of interest.
Output:
 
 
CHARACTER ARRAY
 
 
<set_name>
The name of the property set assigned to this property region.
INTEGER
<gener_elem_type>
 
 
The ID of the generic element type of the elements belonging to this property region. See Generic Element Types, 481.
INTEGER
<dof_set_flag>
The ID of the degree-of-freedom set option chosen for this region.
INTEGER
<condense_flag>
The ID of the condensation option chosen for this region.
INTEGER
<geom_flag>
The ID of the geometric option chosen for this region.
INTEGER
<form_flag>
The ID of the formulation option chosen for this region.
INTEGER
<lam_flag>
The ID of the lamination option chosen for this region.
INTEGER
<layer_count>
Obsolete variable: should be ignored.
INTEGER
<material_id>
The internal ID of the first material reference in the property set. Zero if no material reference.
INTEGER
<material_lin>
The linearity code of the first material reference in the property set. Zero if no material reference.
INTEGER
<material_dir>
The directionality code of the first material reference in the property set. Zero if no material reference.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
 
Notes:
The C name differs. It is DbFGetRegionDefinition.
int DbFGetRegionDefinition ( region_id, set_name, gener_elem_type, dof_set_flag,
	 condense_flag, geom_flag, form_flag, lam_flag, layer_count,
	 material_id, material_lin, material_dir )
 int 	region_id
 char 	*set_name
 int 	*gener_elem_type
 int 	*dof_set_flag
 int 	*condense_flag
 int 	*geom_flag
 int 	*form_flag
 int 	*lam_flag
 int 	*layer_count
 int 	*material_id
 int 	*material_lin
 int 	*material_dir
The function “db_count_props” will determine the number of property words associated with the property region.
 
db_count_props
( <region_id>, <num_words> )
 
Input:
 
 
INTEGER
<region_id>
The ID of the element property region of interest.
Output:
 
 
INTEGER
<num_words>
The number of property words associated with this property region.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFCountProps.
int DbFCountProps ( region_id, num_words )
 int 	region_id
 int 	*num_words
The IDs of the property words associated with a specific property region are gotten through the use of “db_get_props_by_region”.
 
db_get_props_by_region
( <num_words>, <region_id>, <word_ids> )
 
Input:
 
 
INTEGER
<num_words>
The number of property words associated with the property region specified by <region_id>.
INTEGER
<region_id>
The internal ID of the element property region of interest.
Output:
 
 
INTEGER ARRAY
<word_ids>
The number of property words associated with this property region.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFGetPropsByRegion.
int DbFGetPropsByRegion ( num_words, region_id, word_ids)
 int 	num_words
 int 	region_id
 int 	*word_ids
The type and value assigned to each property word in a given property region can be extracted by using the following functions.
 
db_get_prop_value
( <region_id>, <word_id>, <material_id>, <data_type>, <integer_val>, <real_values>, <character_val>, <coord_id>, <node_id>, <field_id> )
  
Input:
 
 
INTEGER
<region_id>
The internal ID of the element property region of interest.
INTEGER
<word_id>
The internal ID of the element property word of interest.
Output:
 
 
INTEGER
<material_id>
The ID of the referenced material, if this word is a material reference.
INTEGER
<data_type>
A flag whose absolute value specifies the type of data assigned to this property word:
1 = real scalar applied at element centroid
2 = real vector
3 = integer
4 = character string
5 = material reference
6 = list of real values
7 = real scalar applied at element nodes
8 = node reference
9 = coordinate frame reference
11 = beam section. Translator is to use the section.
12 = beam section props. Translator is to use the section’s properties.
If <data_type> is negative, the data was input
through a field reference instead of through a
constant value.
INTEGER
<integer_val>
The integer value assigned to the property word, if the word is an integer. The ID of the referenced beam section, if this word is a beam section or beam section props.
REAL ARRAY
<real_values>
A array of three values. If the word is a real scalar, the first component of the array will contain the value assigned to the property word and the other two components will be zero. If the word is a real vector, the array will contain the three components of the vector. If the data was input through a field instead as a constant value (i.e., <field_id> > 0), then the value of this property word should be determined through field evaluation, and the value stored in <real_values> should be ignored.
CHARACTER STRING
 
 
<character_val>[31]
The character string assigned to this property word, if the word type is character string (<data_type> = 4).
INTEGER
<coord_id>
The ID of the referenced coordinate frame, if the word type is coordinate frame reference.
INTEGER
<node_id>
The ID of the referenced node, if the word type is node reference.
INTEGER
<field_id>
The ID of the field through which the property data is input. If zero, there is no field reference and the value of the word should be read from the appropriate output argument listed above (e.g., <real_values>). If a valid field reference (<field_id> > 0), then the value of the word should be determinedthrough field evaluation and the values supplied in the above output arguments (e.g., <real_values>) should be ignored.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFGetPropValue.
int DbFGetPropValue ( region_id, word_id, material_id, data_type, integer_val,
	 real_values, character_val, coord_id, node_id, field_id )
 int 	region_id
 int 	word_id
 int 	*material_id
 int 	*data_type
 int 	*integer_val
 float 	*real_values
 char 	*character_val
 int 	*coord_id
 int 	*node_id
 int 	*field_id
For more on the evaluation or exportation of data fields, review to Data Fields, 643.
 
ep_get_app_reg_str
(region_count, region_id, app_reg_content)
Description:
 
 
This function retrieves the content of element property application regions.
Input:
 
 
INTEGER
region_count
This value specifies the number of element property region ids.
INTEGER
region_id(region_count)
This array specifies the element property region ids.
Output:
 
 
STRING
return_list[VIRTUAL]
This value returns a list processor string of entities.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate an error.
Error Conditions:
 
-1
This is an internal error status condition. There is no corresponding status message in the message database.
Remarks:
Memory is allocated for the output variable within this function. If memory was allocated prior to the call, it is released prior to re-allocation. Therefore, if this function is used within a loop, there is no need to release the memory of the output variable.
Example:
INTEGER status, region_count, region_id(10)
STRING return_list[VIRTUAL]
 
region_count = 1
region_id(1) = 1
status = ep_get_app_reg_str(region_count, region_id, return_list)
IF (0 < status) THEN
   msg_to_form(status, 4, 0, 0, 0.0, ““)
ELSE
   IF (0 > status) THEN
      /* Error information already displayed */
   ELSE
      write_line(“return_list =”, return_list)
   END IF
END IF
 
 
ep_word_val_at_el_cen
(word_id, word_component, search_element_count, search_element_id, found_element_count, found_element_id, found_element_value)
Description:
 
 
This function evaluates an element property word value at element centroids for all element property region..
Input:
 
 
INTEGER
word_id
This value specifies the element property word id. Element properties without this word_id will be ignored. See function db_create_phys_prop_defn() for word_id value table.
INTEGER
word_component
This value specifies the component of the data to extract (values can range from 1 to 3) this value is ignored in the case the data is scalar.
INTEGER
search_element_count
This value specifies the number of elements for which we seek an element property word value. In order to obtain values for all elements associated to the region_id, pass a value of -1. The purpose of having a list of elements for which we seek a value, is to limit the quantity of field evaluations for the elements associated to an element property because each evaluation will require to calculate the centroid of the elements when non entity data fields are involved.
INTEGER
search_element_id()
This array specifies the element ids for which we seek an element property word value. If search_elem_qtt=-1, this array is not used. Array must be sorted in an increasing order and duplicated must be removed. This is not done within the function for performance reasons, as this function may be used in a loop, using the same input array. Sort/duplicates is verified within the function.
Output:
 
 
INTEGER
found_element_count
This value returns the number of element associated to the region_id, which could be found in search_element_id.
INTEGER
found_element_id (VIRTUAL)
This array returns the element ids associated to the region_id, which could be found in search_element_id.
REAL
found_element_value (VIRTUAL)
This array returns the element property word component values at the centroid of the elements ids in found_element_id.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate an error.
Error Conditions:
 
-1
This is an internal error status condition. There is no corresponding status message in the message database.
Remarks:
Memory is allocated for the output variables within this function. If memory was allocated prior to the call, it is released prior to re-allocation. Therefore, if this function is used within a loop, there is no need to release the memory of the output variable.
Example:
INTEGER status, word_id, word_component, @
        search_element_count, search_element_id(1),
        found_element_count, found_element_id(VIRTUAL), i_elem
REAL found_element_value(VIRTUAL)
 
word_id = 6   /* Definition of XY Plane */
word_component = 3
search_element_count = -1
status = ep_word_val_at_el_cen(word_id, word_component, @
            search_element_count, search_element_id, @
            found_element_count, found_element_id, @
            found_element_value)
IF (0 < status) THEN
   msg_to_form(status, 4, 0, 0, 0.0, ““)
ELSE
   IF (0 > status) THEN
      /* Error information already displayed */
   ELSE
      write_line(“found_element_count =”, found_element_count)
      FOR (i_elem = 1 TO found_element_count)
         write_line(“found_element_id(“, i_elem, ”) =”, @
                    found_element_id(i_elem))
         write_line(“found_element_value(“, i_elem, ”) =”, @
                    found_element_value(i_elem))
      END FOR
   END IF
END IF
 
 
ep_word_val_at_el_cen_by_reg
(region_id, word_id, word_component, search_element_count, search_element_id, found_element_count, found_element_id, found_element_value)
Description:
 
 
This function evaluates an element property word value at element centroids for one element property region.
Input:
 
 
INTEGER
region_id
This value specifies the element property region id.
INTEGER
word_id
This value specifies the element property word id. If the word_id is not found to be associated with the region_id, this function will exit normally (Return Value =0) without allocating memory for the output variable. See function db_create_phys_prop_defn() for word_id value table.
INTEGER
word_component
This value specifies the component of the data to extract (values can range from 1 to 3) this value is ignored in the case the data is scalar.
INTEGER
search_element_count
This value specifies the number of elements for which we seek an element property word value. In order to obtain values for all elements associated to the region_id, pass a value of -1. The purpose of having a list of elements for which we seek a value, is to limit the quantity of field evaluations for the elements associated to an element property because each evaluation will require to calculate the centroid of the elements (when non entity data fields are involved).
INTEGER
search_element_id()
This array specifies the element ids for which we seek an element property word value. If search_elem_qtt=-1, this array is not used. Array must be sorted in an increasing order and duplicated must be removed. This is not done within the function for performance reasons, as this function may be used in a loop, using the same input array. Sort/duplicates is verified within the function.
Output:
 
 
INTEGER
found_element_count
This value returns the number of element associated to the region_id, which could be found in search_element_id.
INTEGER
found_element_id (VIRTUAL)
This array returns the element ids associated to the region_id, which could be found in search_element_id.
REAL
found_element_value (VIRTUAL)
This array returns the element property word component values at the centroid of the elements ids in found_element_id.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate an error.
Error Conditions:
 
-1
This is an internal error status condition. There is no corresponding status message in the message database.
Remarks:
Memory is allocated for the output variable within this function. If memory was allocated prior to the call, it is released prior to re-allocation. Therefore, if this function is used within a loop, there is no need to release the memory of the output variable.
Example:
INTEGER status, region_id, word_id, word_component, @
        search_element_count, search_element_id(1), @
        found_element_count, found_element_id(VIRTUAL), i_elem
REAL found_element_value(VIRTUAL)
 
region_id = 1
word_id = 6   /* Definition of XY Plane */
word_component = 3
search_element_count = -1
status = ep_word_val_at_el_cen_by_reg(region_id, word_id, @
            word_component, search_element_count, @
            search_element_id, found_element_count, @
            found_element_id, found_element_value)
IF (0 < status) THEN
   msg_to_form(status, 4, 0, 0, 0.0, ““)
ELSE
   IF (0 > status) THEN
      /* Error information already displayed */
   ELSE
      write_line(“found_element_count =”, found_element_count)
      FOR (i_elem = 1 TO found_element_count)
         write_line(“found_element_id(“, i_elem, ”) =”, @
                    found_element_id(i_elem))
         write_line(“found_element_value(“, i_elem, ”) =”, @
                    found_element_value(i_elem))
      END FOR
   END IF
END IF
 
Importing Element Property Data
In order to create a element property record within Patran first define the property region and then associate property words to that region. The function to create a property region is described below.
 
db_create_phys_prop_region
( <region_id>, <region_name>, <gener_elem_type>, <geom_id>, <condense_id>, <form_id>, <lam_id>, <dof_set_id> )
 
Input:
 
 
INTEGER
<region_id>
The internal ID assigned to the new element property region by Patran.
CHARACTER STRING
 
 
<region_name>
The external name used to reference the element property region.
INTEGER
<gener_elem_type>
 
 
The ID of the generic element type of the elements belonging to this property region. See Generic Element Types, 481.
INTEGER
<geom_id>
The ID of the geometry option of this property region.
INTEGER
<condense_id>
The ID of the condensation option of this property region.
INTEGER
<form_id>
The ID of the formulation option of this property region.
INTEGER
<lam_id>
The ID of the lamination option of this property region.
INTEGER
<dof_set_id>
The degree-of-freedom set ID of this property region.
Output:
 
 
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFCreatePhysPropRegion.
int DbFCreatePhysPropRegion ( region_id, region_name, gener_elem_type, geom_id, condense_id, form_id, lam_id, dof_set_id )
int 	region_id
char 	*region_name
int 	gener_elem_type
int 	geom_id
int 	condense_id
int 	form_id
int 	lam_id
int 	dof_set_id
<region_id> is an input in this case, not an output as is typical. In order to determine a valid value for <region_id> the user can use the following routing to retrieve the highest physical property region ID and then increment this value by one.
  
db_get_max_physical_property
( <max_region_id> )
 
Output:
 
 
INTEGER
<max_region_id>
The highest physical property region ID defined in the database.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name is DbGetMaxPhysicalProperty.
int DbGetMaxPhysicalProperty ( max_region_id )
int 	*max_region_id
The function which associates element property words with an element property region is “db_create_phys_prop_value”.
 
db_create_phys_prop_value
( <region_id>, <word_id>, <material_id>, <data_type>, <integer_val>, <real_val>, <character_val>, <node_id>, <coord_id>, <field_id> )
  
Input:
 
 
INTEGER
<region_id>
The internal ID of the element property region to which the specified element property word is to be added.
INTEGER
<word_id>
The ID of the property word to be added.
INTEGER
<material_id>
The ID of the referenced material. Only applicable when <data_type> is 5.
INTEGER
<data_type>
A flag whose absolute value specifies the type of data assigned to this property word. If the value of <data_type> is positive, the word references a constant value such as a real number or a node reference. If the value of <data_type> is negative, the word references a data field. The meaning of the absolute value of <data_type> is as follows:
1 = real scalar applied at element centroid
2 = real vector
3 = integer
4 = character string
5 = material reference
6 = list of real values
7 = real scalar applied at element nodes
8 = node reference
9 = coordinate reference
INTEGER
<integer_val>
The integer value of the property word if <data_type> = 3.
REAL ARRAY
<real_val>
The array containing the three possible components of the real value. If <data_type> is 1 or 7, then only the first component has meaning and the other two components are zero. Values should only be input here if there is no field reference for this property word (<field_id> = 0 and/or <data_type> > 0).
CHARACTER STRING
 
 
<character_val>
The character string value of the property word if <data_type> = 4. A blank string if not applicable. Maximum length of this string is 31 characters.
INTEGER
<node_id>
The ID of the referenced node if <data_type> = 8.
INTEGER
<coord_id>
The ID of the referenced coordinate frame if
<data_type> = 9.
INTEGER
<field_id>
The ID of the referenced data field. Should be zero if there is no referenced data field.
Output:
 
 
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFCreatePhysPropValue.
int DbFCreatePhysPropValue ( region_id, word_id, material_id, data_type, integer_val,
	real_val, character_val, node_id, coord_id, field_id )
int 	region_id
int 	word_id
int 	material_id
int 	data_type
int 	integer_val
float 	real_val[ ]
char 	*character_val
int 	node_id
int 	coord_id
int 	field_id
For more on the importation of data fields, refer to Data Fields, 643.
  
db_modify_phys_prop_region_name
( old_name, new_name )
  
Description:
 
 
This function renames a property set.
Input:
 
 
STRING[32]
old_name
Property name to be modified.
STRING[32]
new_name
New property name.
Output:
 
 
INTEGER
<Return Value>
0=success, otherwise failure.