PCL and Customization > PATRAN 2.5 Database Compatibility > PATRAN 2.5 Compatible Database Functions
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
PATRAN 2.5 Compatible Database Functions
 
db_create_element_list
(get, numelm, loc )
 
Description:
 
 
Create a List of Existing Element ID’s in Virtual Memory.
If element indexing is on, generate or release a sorted list of existing element ID’s in virtual memory. If element indexing is off, just return the maximum element ID.
Input:
 
 
LOGICAL
get
If true, create list; if false, release list.
Output:
 
 
INTEGER
numelm
Number of elements processed (if indexing is off, this is maximum element ID).
INTEGER
loc
Index relative to IVAL(1) in common XMEM where node ID list begins (set to zero if node indexing is off).
Error Conditions:
 
None.
 
 
 
db_create_node_list
(get, numnod, loc )
 
Description:
 
 
Create a List of Existing Node ID’s in Virtual Memory.
Input:
 
 
LOGICAL
get
If true, create list; if false, release list.
Output:
 
 
INTEGER
numnod
Number of nodes processed (if indexing is off, this is maximum node ID).
INTEGER
loc
Index relative to IVAL(1) in common XMEM where node ID list begins (set to zero if node indexing is off).
Error Conditions:
 
None.
 
 
 
db_element
(elno, shape, nodes, conf, pid, ceid, data, node, adata, noasoc, nodbem, status )
 
Description:
 
 
Get Data Associated with an Element.
Input:
 
 
INTEGER
elno
Element number for which data is requested.
Output:
 
 
INTEGER
shape
2 = bar
3 = triangle
4 = quadrangle
5 = tetrahedron
7 = wedge
8 = hexagon
INTEGER
nodes
Number of nodes.
INTEGER
conf
Element configuration.
INTEGER
pid
Property ID or material ID (if.lt. 0). In MSC Patran, the region ID.
INTEGER
ceid
Congruent element ID.
REAL(3)
data
Material orientation angles. For bars, these are the coordinates of the bar ends if offset.
INTEGER(64)
node
ID of the node defining the XY-plane
REAL(6)
adata
Associated data. For bars, these are the coordinates of the bar ends if offset.
INTEGER
noasoc
Number of associated data values.
INTEGER
nodbem
ID of the node defining the XY-plane.
INTEGER
status
Return status:
0 = normal
1 = non-existent element
Error Conditions:
 
None.
 
 
 
db_entity_counts
(size1, size2, ncount, gcount, names, ndfeg, dftabl, mpc, status )
 
Description:
 
 
Count Database Entities.
Return the number of nodes, elements, materials and element properties in “ncount”, maximum ID’s of Phase I entities in “size1”. Maximum of Phase II entities in “size2”, total number of GFEG records in “gcount” and the total number of named components in “names”.
Input:
 
 
None.
 
 
Output:
 
 
INTEGER(12)
size1
Maximum of Phase I entities.
size1 [0] = Max point ID’s
size1 [1] = Max curve ID’s
size1 [2] = Max surface ID’s
size1 [3] = Max solid ID’s
size1 [4] = Max Coord ID’s
size1 [5] = Max Dline ID’s ->0
size1 [6] = Max Dpat ID’s UNDEFINED
size1 [7] = Max Dhpat ID’s UNDEFINED
size1 [8] = Max Pmat ID’s
size1 [9] = Max List ID’s UNDEFINED
size1 [10] = Max Data ID’s UNDEFINED
size1 [11] = Max Field ID’s
INTEGER(30)
size2
Maximum of Phase II entities.
size2 [0] = Max Node ID’s
size2 [1] = Max Beam ID’s
size2 [2] = Max Triangle ID’s
size2 [3] = Max Quadrangle ID’s
size2 [4] = Max Tetrahedron ID’s
size2 [5] = Max Pyramid ID’s
size2 [6] = Max Wedge ID’s
size2 [7] = Max Hexagon ID’s
size2 [8] = Max MaxEl ID’s
size2 [9] = Max MaxPid ID’s
size2 [10] = Max DofList1 ID’s
size2 [11] = Max DofList2 ID’s UNDEFINED
size2 [12] = Max DofList3 ID’s UNDEFINED
size2 [13] = Max DofList4 ID’s UNDEFINED
size2 [14] = Max DofList5 ID’s UNDEFINED
size2 [15] = Max DofList6 ID’s UNDEFINED
size2 [16] = Max DofList7 ID’s UNDEFINED
size2 [17] = Max DofList8 ID’s UNDEFINED
size2 [18] = Max DofList9 ID’s UNDEFINED
size2 [19] = Max DofList10 ID’s UNDEFINED
size2 [20] = Max Mass ID’s
size2 [21] = Max Spring ID’s
size2 [22] = Max Weld ID’s UNDEFINED
size2 [23] = Max Part ID’s UNDEFINED
size2 [24] = Max Joint ID’s UNDEFINED
size2 [25] = Max Marker ID’s UNDEFINED
size2 [26] = RESERVED ID’s UNDEFINED
size2 [27] = Max Force ID’s UNDEFINED
size2 [28] = Max Output ID’s UNDEFINED
size2 [29] = Max MCP ID’s UNDEFINED
INTEGER(5)
ncount
Node, element, material, property and
coordinate frame counts.
ncount [0] = Node count
ncount [1] = Element count
ncount [2] = Material count
ncount [3] = Property count
ncount [4] = Coordinate Frame count
INTEGER
gcount
Number of GFEG records.
INTEGER
names
Number of named components. (groups).
INTEGER(15)
ndfeg
Number of DFEG records for each of packet 6 through 11 and 15 through 18.
INTEGER(3000)
dftabl
The set ID and the number of records in each set for each DFEG packet.
INTEGER(2)
mpc
Total MCP equations and maximum number of MPC equations.
mpc [0] = Total MPC equations
mpc [1] = Maxim MPC equations
INTEGER
status
= 0.
Error Conditions:
 
None.
 
 
db_get_maximum_id
(database_type, error_value )
Description:
 
 
This function will return the entity identifier with the highest numerical value used for a specific database entity type.
Input:
 
 
STRING
database_type
This value is used to identify the entity type. It should always be an uppercase value. See the table below for the entity types allowed.
Output:
 
 
INTEGER
error_value
This value is used to return an error or status value. This value will be set to 0 if the function succeeded and will be set to 1 if the input value database_type is set incorrectly. This value will be set to a non-zero value if a database error occurs.
INTEGER
<Return Value>
This function can return any value and the value returned has no meaning.
Remarks:
The input value database_type can have the following upper case values.
 
 
database_type
Description
 
Value
 
 
 
 
 
“GR”
grid
 
“LIN”
curve
 
“PA”
surface
 
“HP”
solid
 
“HY”
solid
 
“COR”
coordinate frame
 
“CID”
coordinate frame
 
“FI”
field
 
“NO”
node
 
“BE”
beam element
 
“BA”
beam element
 
“TR”
triangular element
 
“QU”
quad element
 
“TE”
tet element
 
“PY”
pyramid element
 
“WE”
wedge element
 
“HE”
hex element
 
“EL”
all elements
 
“NA”
Groups
Example:
None.
 
db_get_next_id
(listed, i, loc )
 
Description:
 
 
If indexing is on, get ID(i) from ID-list; otherwise return i.
Input:
 
 
LOGICAL
listed
If true, return NEXTID = ID-list (i). If false,
return NEXTID = i.
INTEGER
i
Index.
INTEGER
loc
ist of ID’s.
Output:
 
 
None.
 
 
Error Conditions:
 
None.
 
 
 
db_grid
(grid, rdata, status )
 
Description:
 
 
Get X-Y-Z Coordinates of a Grid.
Input:
 
 
INTEGER
grid
Grid number for which coordinates are requested.
Output:
 
 
REAL(3)
rdata
Coordinates of “grid.”
INTEGER
status
Return status:
0 = normal
1 = non-existent grid
2 = no data
Error Conditions:
 
None.
 
 
 
db_hyperpatch
(hpat, coef, grids, status )
 
Description:
 
 
Get Geometric Data for Hyperpatch “label.”
Input:
 
 
INTEGER
hpat
Hyperpatch label for which data is requested.
Output:
 
 
REAL
coef (192)
64x3 matrix of geometric hyperpatch coefficients.
INTEGER
grids (8)
Corner points grid ID’s.
INTEGER
status
Return status:
0 = normal
1 = non-existent hyperpatch
2 = no data
Error Conditions:
 
None.
 
 
 
db_import_database
(dbname, types, elist, offset, prefix, merge_flags, nsig, node_equiv, point_equiv, method, tolerance )
 
Description:
 
 
Main driver for the database import operation.
Input:
 
 
STRING[ ]
dbname
The name of the database whose data is to be imported.
STRING[20]()
types
A list of types of entities to be imported.
STRING[256]()
elist
Array of entity lists for each entity type ("All", "None", or a list of labels or names).
INTEGER()
offset
Array of ID offsets for each numbered entity conflict resolution (one offset per entity type).
STRING[31]()
prefix
Array of prefixes for named entity conflict resolution (one prefix per entity type).
LOGICAL()
merge_flags
The values of the merge toggles for materials, element properties, lbcs, load cases, fields, and groups respectively.
INTEGER
nsig
The number of significant digits for real number comparisons.
LOGICAL
node_equiv
Node equivalencing flag.
LOGICAL
point_equiv
Point equivalencing flag.
STRING[ ]
method
Equivalence method ("cube" or "sphere").
REAL
tolerance
Equivalence tolerance.
 
<Return Value>
= 0 Function was successful.
Output:
 
 
None.
 
 
Side Effects:
 
Messages
A summary spreadsheet will be displayed.
Database
The requested data will be imported to the primary database.
Graphics
The requested data will be posted to the current or specified group.
Error Conditions:
 
To be determined.
 
db_import_database_V2
(dbname, types, elist, offset, prefix, merge_flags, nsig, node_equiv, point_equiv, method, tolerance, dfem_combine, lbc_equivopt )
 
Description:
 
 
Version 2 of the main driver for the database import operation with the addition of LBC equivalencing.
Input:
 
 
STRING[ ]
dbname
The name of the database whose data is to be imported.
STRING[20]()
types
A list of types of entities to be imported.
STRING[256]()
elist
Array of entity lists for each entity type ("All", "None", or a list of labels or names).
INTEGER()
offset
Array of ID offsets for each numbered entity conflict resolution (one offset per entity type).
STRING[31]()
prefix
Array of prefixes for named entity conflict resolution (one prefix per entity type).
LOGICAL()
merge_flags
The values of the merge toggles for materials, element properties, lbcs, load cases, fields, and groups respectively.
INTEGER
nsig
The number of significant digits for real number comparisons.
LOGICAL
node_equiv
Node equivalencing flag.
LOGICAL
point_equiv
Point equivalencing flag.
STRING[ ]
method
Equivalence method ("cube" or "sphere").
REAL
tolerance
Equivalence tolerance.
LOGICAL
dfem_combine
Discrete FEM field combining flag.
STRING[8]()
lbc_equivopt
Array of equivalence options for BCs, Vector Loads, and Scalar Loads (“useprim”, ”add” or “average”).
 
<Return Value>
= 0 Function was successfu
Output:
 
 
None.
 
 
Side Effects:
 
Messages
A summary spreadsheet will be displayed.
Database
The requested data will be imported to the primary database.
Graphics
The requested data will be posted to the current or specified group.
Error Conditions:
 
To be determined.
  
db_import_database_V3
(dbname, types, elist, offset, prefix, merge_opts, nsig, node_equiv, point_equiv, method, tolerance, dfem_combine, lbc_equivopt )
 
Description:
 
 
Version 3 of the main driver for the database import operation with the addition of Material and Property merging with non-duplicate names. The only difference from db_import_database_V2, is the merge_opts argument.
Input:
 
 
STRING[ ]
dbname
The name of the database whose data is to be imported.
STRING[20]()
types
A list of types of entities to be imported.
STRING[256]()
elist
Array of entity lists for each entity type ("All", "None", or a list of labels or names).
INTEGER()
offset
Array of ID offsets for each numbered entity conflict resolution (one offset per entity type).
STRING[31]()
prefix
Array of prefixes for named entity conflict resolution (one prefix per entity type).
STRING[ ]()
merge_opts
The values of the merge options for materials, element properties, lbcs, load cases, fields, groups, and DOF lists respectively. Valid options for materials and element properties are:
“NONE”=Do not merge
“DATA_ONLY”=Ignore name on merge, only data must                   match. Merges to the first alphanumeric found with                   duplicate data.
“DATA_CHECK_NAME”=Check for duplicate name first. If                   found, and data is duplicate, merge. If not found, or                   found and data is not duplicate, behave same as                   “DATA_ONLY”.
“DATA_AND_NAME”=Name and data must be duplicate to                   merge.
Valid options for lbcs, load cases, fields, groups, and DOF lists are:
“NONE”=Do not merge
“DATA_AND_NAME”=Name and/or name and data must be                   duplicate to merge.
INTEGER
nsig
The number of significant digits for real number comparisons.
LOGICAL
node_equiv
Node equivalencing flag.
LOGICAL
point_equiv
Point equivalencing flag.
STRING[ ]
method
Equivalence method ("cube" or "sphere").
REAL
tolerance
Equivalence tolerance.
LOGICAL
dfem_combine
Discrete FEM field combining flag.
STRING[8]()
lbc_equivopt
Array of equivalence options for BCs, Vector Loads, and Scalar Loads (“useprim”, ”add” or “average”).
 
<Return Value>
= 0 Function was successful.
Output:
 
 
None.
 
 
Side Effects:
 
Messages
A summary spreadsheet will be displayed.
Database
The requested data will be imported to the primary database.
Graphics
The requested data will be posted to the current or specified group.
Error Conditions:
 
To be determined.
 
db_line
(line, coef, grids, status )
 
Description:
 
 
Get Geometric Data for Line “line.”
Input:
 
 
INTEGER
line
Line label for which data is requested.
Output:
 
 
REAL(12)
coef
4x3 matrix of geometric line coefficients.
NTEGER(2)
grids
End point grid ID’s.
INTEGER
status
Return status:
0 = normal
1 = non-existent line
2 = no data
Error Conditions:
 
None.
 
 
 
db_mpc
(mpcid, nterms, nbuf, ntot, ndep, idat, constr, mpcdat, num, status )
 
Description:
 
 
Not supported in MSC Patran.
Input:
 
 
INTEGER
mpcid
Unknown.
INTEGER
nterms
Unknown.
INTEGER
nbuf
Unknown.
Output:
 
 
INTEGER
nterms
Unknown.
INTEGER
ntot
Unknown.
INTEGER
ndep
Unknown.
INTEGER(12)
idat
Unknown.
REAL
constr
Unknown.
INTEGER()
mpcdat
Unknown.
INTEGER
num
Unknown.
INTEGER
status
Unknown.
Error Conditions:
 
None.
 
 
 
db_node
(node, xyz, conden, type, nodof, config, coordf, spcf, status)
 
Description:
 
 
Get Data Associated with a Nodal Point.
Input:
 
 
INTEGER
node
Node number for which data is requested.
Output:
 
 
REAL(3)
xyz
x, y, z global coordinates.
INTEGER
conden
Condensation flag (0 = unreferenced).
STRING
type
Node type (Hollerith).
INTEGER
nodof
Number of degrees-of-freedom.
INTEGER
config
Node configuration.
INTEGER
coordf
Reference coordinate system number.
INTEGER(6)
spcf
Up to 6 single point constraint flags.
INTEGER
status
Return status:
0 = normal
1 = non-existent node
Error Conditions:
 
None.
 
 
 
db_patch
(patch, coef, grids, status )
 
Input:
 
 
INTEGER
patch
Patch number for which data is requested.
Output:
 
 
REAL(48)
coef
16x3 matrix of geometric patch coefficients.
INTEGER(4)
grids
Corner point grid ID’s.
INTEGER
status
Return status:
0 = norma
1 = non-existent patch
2 = no data
Error Conditions:
 
None.
 
 
 
dbi_query_database
(dbname, report_flag, report_file, ntypes, types, counts, mins, maxs, geotol )
 
Description:
 
 
Query the contents of the specified database
Input:
 
 
STRING[ ]
dbname
The name of the database.
LOGICAL
report_flag
TRUE if a report is to be generated.
STRING[ ]
report_file
The name of the report file.
Output:
 
 
INTEGER
ntypes
The number of entity types.
INTEGER()
types
The entity types (e.g. DbTypPoint)
INTEGER()
counts
The number of entities of each type.
INTEGER()
mins
The minimum ID (label) for each type.
INTEGER()
maxs
The maximum ID (label) for each type.
REAL
geotol
Geometric tolerance in query database.
 
<Return Value>
= 0 Function was successful
Error Conditions:
 
None.