0% found this document useful (0 votes)
8 views

Python Manual Pages 5

The document provides a reference for various PyPost methods used in Python for analyzing post-processing data. It includes methods for retrieving nodal displacements, scalar values, vector values, and set data from post files, along with their descriptions, arguments, and examples of usage. Additionally, it outlines arithmetic and database functions available in the Mentat environment.

Uploaded by

qq2109235237
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Python Manual Pages 5

The document provides a reference for various PyPost methods used in Python for analyzing post-processing data. It includes methods for retrieving nodal displacements, scalar values, vector values, and set data from post files, along with their descriptions, arguments, and examples of usage. Additionally, it outlines arithmetic and database functions available in the Mentat environment.

Uploaded by

qq2109235237
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

CHAPTER 2 60

PyPost References

node_displacement Returns the nodal displacement values at a particular node

Synopsis
Float, Float, Float node_displacement(Integer index)

Arguments
index Node index number

Description
Return the values of the nodal displacement at node index if available. The node_displacements method should
be called prior to calling the node_displacement method to make sure that nodal displacements are available.
This method returns three floats.

Also See
node_displacements

Example
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.nodes()
have_disp = p.node_displacements()
if have_disp:
for i in range(0,n):
x,y,z = p.node_displacement(i)
61 Marc Python Reference

node_displacements Returns a 1 if nodal displacements available; 0 otherwise

Synopsis
Integer node_displacements()

Arguments
None

Description
This method should be used prior to calling the node_displacement method to determine if nodal displacements
are available. Returns 1 if nodal displacements are available; 0 otherwise.

Example
# print the name of each scalar label
p = post_open(’c07_job1.t19’)
p.moveto(1)
if p.node_displacements() :
print "Nodal displacements available"
CHAPTER 2 62
PyPost References

node_id Returns the ID of a particular node

Synopsis
Integer node_id(Integer node)

Arguments
node The node index number

Description
Returns ID of node at index node.

Example
p = post_open(‘c08_job1.t19’)
# print the id’s of each node
p.moveto(0)
n = p.nodes()
for i in range(0,n):
print ‘Node ‘,i,’ has id ‘, p.node_id(i)
63 Marc Python Reference

node_scalar Returns the value of a particular node scalar at a particular node

Synopsis
Float node_scalar(Integer index, Integer scalar)

Arguments
index Node index number
scalar Scalar index number

Description
Return the value of a particular node scalar scalar at a particular node index.
This method returns a float.

Example
# get each scalar for node at index 4
f = [ ]
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.node_scalars()
id = node_id(4)
print ‘node scalars for node id ‘,id
for i in range(0,n):
f.append(p.node_scalar(4, i))
print ‘scalar ‘,f[i]
CHAPTER 2 64
PyPost References

node_scalars Returns the number of node scalars available

Synopsis
Integer node_scalars()

Arguments
None

Description
Returns the number of node scalars available.

Example
# print the name of each scalar label
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.node_scalars()
for i in range(0, n):
print p.node_scalar_label(i)
65 Marc Python Reference

node_scalar_label Returns the name of a particular scalar

Synopsis
String node_scalar_label(Integer index)

Arguments
index Scalar index number

Description
Return the name of node scalar index.
This method returns a string.

Example
# print the name of each scalar label
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.node_scalars()
for i in range(0, n):
print p.node_scalar_label(i)
CHAPTER 2 66
PyPost References

node_sequence Returns the index number of a particular node ID

Synopsis
Integer node_sequence(Integer node)

Arguments
node The node ID

Description
Returns the index number of node with ID node. This is the inverse of the node_id method.

Example
p = post_open(‘c08_job1.t19’)
p.moveto(0)
# print the index of each node
n = p.nodes()
for i in range(0,n):
print ‘Node Id ‘,i,’ has index ‘, p.node_sequence(i)
67 Marc Python Reference

node_vector Returns the value of a particular node vector at a particular node

Synopsis
PyVector node_vector(Integer index, Integer nv)

Arguments
index Node index number
nv Vector index number

Description
Return the vector of a particular node vector nv at a particular node index.
This method returns a PyVector.

Example
# get each vector for node 4
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.node_vectors()
for i in range(0,n):
v = p.node_vector(4, i)
print ‘Vector ‘,i,’ is ‘, v.x, v.y, v.z
CHAPTER 2 68
PyPost References

node_vectors Returns the number of node vectors available

Synopsis
Integer node_vectors()

Arguments
None

Description
Returns the number of node vectors available.

Example
# print the name of each vector label
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.node_vectors()
for i in range(0, n):
print p.node_vector_label(i)
69 Marc Python Reference

node_vector_label Returns the name of a particular node vector

Synopsis
String node_vector_label(Integer index)

Arguments
index Vector index number

Description
Return the name of node vector index.
This method returns a string.

Example
# print the name of each vector label
p = post_open(‘c07_job1.t19’)
p.moveto(1)
n = p.node_vectors()
for i in range(0, n):
print p.node_vector_label(i)
CHAPTER 2 70
PyPost References

post_open Open a post file and return the PyPost object

Synopsis
PyPost post_open(String filename)

Arguments
filename Post file name.

Description
This method opens the specified post file and returns a PyPost object. This is the first PyPost routine that a Python
script should call. A call to moveto( ) should follow to force a reading of the increment data at the first increment
on the post file.

Members
position - current increment position
filename - the post file name
revision - the revision of the post file

The following members are updated when the moveto method is called:

increment - the increment number of post file


time - the time for the current increment
frequency - the frequency of this increment

Example
p1 = post_open(‘e7x14_solver0.t19’)
p1.moveto(0)
p2 = post_open(‘e7x14_solver1.t19’)
p2.moveto(0)
print ‘Comparing ‘,p1.filename, ‘ to ‘,p2.filename
71 Marc Python Reference

set Returns the data for a particular set

Synopsis
PyPostSet set(int nset)

Arguments
nset The set index number

Description
Returns a PyPostSet object containing the set data for set nset in the models.

Members
name - set name
type - set type
len - number of items in the set
items - list of data that comprise the set

Example
p = post_open(‘c08_job1.t19’)
p.moveto(0)
n = p.sets()
for i in range(0,n):
s = p.set(i)
print ‘Name:’,s.name, ‘Type: ‘,s.type
for j in range(0,s.len):
print ‘Item:’,j, ‘Value: ‘,s.items[j]
CHAPTER 2 72
PyPost References

sets Returns the number of sets in the post file

Synopsis
Integer sets()

Arguments
None

Description
Returns the number of sets in the post file.

Example
p = post_open(‘c07_job1.t19’)
p.moveto(0)
n = p.sets()
73 Marc Python Reference

title Returns the title of the post file

Synopsis
String title( )

Arguments
None

Description
Returns the title of the model stored in the post file.
This method returns a string.

Example
# print the title
p = post_open(‘c08_job1.t19’)
print ‘Title: ‘,p.title()
CHAPTER 2 74
PyPost References

version Returns the version of the PyPost module

Synopsis
String version( )

Arguments
None

Description
Return the version string of the PyPost module.
This method returns a string.

Example
print ‘PyPost version is ‘,version()
p = post_open(‘c08_job1.t19’)
Appendix A

Arithmetic and Database


A Functions

Introduction 80
 Arithmetic Functions 80

Database Functions 81

Utility Functions 101
 Post File Database Functions 102

Set Functions 104
CHAPTER A 80
Arithmetic and Database Functions

Introduction
This chapter describes the Arithmetic and Database function supported by Mentat. If the argument to any function is
shown in capital letters (such as ARGn), then the argument is an index and may be negative; in which case, the entities
are counted in reverse order (i.e., ARGn = -1 would refer to the last item). A good example of the usage of these
functions can be found in the Marc User’s Guide, Chapter 31 procedure file. If the argument to a database function is
in lower case (such as argn), then the value is an ID, such as a node ID or an element ID unless otherwise described.

Arithmetic Functions
The following are the Marc Mentat Arithmetic Functions which can be used in the py_get_float or py_get_int
functions or in a formula.

Table A-1 Arithmetic Functions


Function Description
cos(arg1) Cosine of arg1 radians
sin(arg1) Sine of arg1 radians
tan(arg1) Tangent of arg1 radians
dcos(arg1) Cosine of arg1 degrees
dsin(arg1) Sine of arg1 degrees
dtan(arg1) Tangent of arg1 degrees
acos(arg1) Arccosine of arg1 radians
asin(arg1) Arcsine of arg1 radians
atan(arg1) Arctangent of arg1 radians
atan2(arg1,arg2) Arctangent of (arg1/arg2) radians
dacos(arg1) Arccosine of arg1 degrees
dasin(arg1) Arcsine of arg1 degrees
datan(arg1) Arctangent of arg1 degrees
datan2(arg1,arg2) Arctangent of (arg1/arg2) degrees
log(arg1) Base-10 logarithm of arg1
ln(arg1) Natural logarithm of arg1
exp(arg1) E to the power arg1
cosh(arg1) Hyperbolic cosine of arg1
sinh(arg1) Hyperbolic sine of arg1
tanh(arg1) Hyperbolic tangent of arg1
acosh(arg1) Inverse hyperbolic cosine of arg1
asinh(arg1) Inverse hyperbolic sin of arg1
81 Marc Python Reference

Table A-1 Arithmetic Functions (continued)


Function Description
atanh(arg1) Inverse hyperbolic tangent of arg1
sqrt(arg1) Square root of arg1
rad(arg1) Angle in radians of arg1 degrees
deg(arg1) Angle in degrees of arg1 radians
abs(arg1) Absolute value of arg1
int(arg1) Largest integral value not greater than arg1
frac(arg1) Fractional part of arg1
max(arg1,arg2) Maximum of arg1 and arg2
min(arg1,arg2) Minimum of arg1 and arg2
dist2d(arg1,arg2,arg3,arg4) Distance in 2-D space between a point with coordinates (arg1,arg2) and a
point with coordinates (arg3,arg4)
dist3d(arg1,arg2,arg3,arg4,arg5,arg6) Distance in 3-D space between a point with coordinates (arg1,arg2,arg3) and
a point with coordinates (arg4,arg5,arg6)

Database Functions
The following are the Mentat Database Functions which can be used in the py_get_float, py_get_int, or
py_get_string functions.
Note that the database functions may also be used as the argument to many commands. For example:
*remove_elements element_id(-1)
would remove the last element of the model. To use numeric values in a string based command (such as
*job_title), a PARAMETER needs to be created from the database function and then used in the string command.
For example:
*eval_define num nnodes()
*job_title Model with $num nodes
will create an evaluated parameter named num using the nnodes( ) database function, and then use that in the
*job_title command (note the use of the $ to signify it is the name of a parameter). The job title for the CONTACT
demo would appear as:
Model with 72 nodes

Table A-2 Database Functions


Function Description
filename( ) Returns the name of the model file without the path.
getcwd( ) Returns the current directory.
CHAPTER A 82
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
model_name( ) Returns the current model name.
revision Returns the string for the base version (such as 2011).
version Returns the string for the version (same as for *version command).
npoints( ) Number of points in database
point_id(arg1) ID of arg1-th point in database
max_point_id( ) Largest point ID in database
point_surface_id(arg1) ID of surface trimmed by point arg1
point_x(arg1) Global X-coordinate of point arg1
point_y(arg1) Global Y-coordinate of point arg1
point_z(arg1) Global Z-coordinate of point arg1
point_u1(arg1) First user coordinate of point arg1
point_u2(arg1) Second user coordinate of point arg1
point_u3(arg1) Third user coordinate of pointarg1
point_s1(arg1) First surface parametric coordinate of point arg1
point_s2(arg1) Second surface parametric coordinate of point arg1
ncurves( ) Number of curves in database
curve_id(arg1) ID of arg1-th curve in database
max_curve_id( ) Largest curve ID in database
ncurve_points(arg1) Number of points of curve arg1
curve_point_id(arg1,arg2) ID of arg2 -th point of curve arg1
curve_surface_id(arg1) ID of surface trimmed by curve arg1
curve_length(arg1) Length of curve arg1
curve_ndiv(arg1) Number of divisions of curve arg1
ncurve_seedpoints(arg1) Number of seed points of a curve. It is identical to
curve_ndiv(arg1)+1.
curve_seedpoint(arg1,arg2) Returns the curve coordinate (between 0 and 1) of the arg2-th seedpoint.
If arg2 is negative, seed points are counted in reverse order (arg2 = -1
would return the last seed point).
nsurfaces( ) Number of surfaces in database
surface_id(arg1) ID of arg1-th surface in database
max_surface_id( ) Largest surface ID in database
nsurface_curves(arg1) Number of trimming curves of surface arg1
surface_curve_id(arg1,arg2) ID of arg2-th curve in database that trims surface arg1
83 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
nsurface_points_x(arg1) Number of defining points in first parametric direction of surface arg1
nsurface_points_y(arg1) Number of defining points in second parametric direction of surface
arg1
surface_point_id(arg1,arg2,arg3) ID of (arg2, arg3) -the defining point of surface arg1
nsolids( ) Number of solids in database
solid_id(arg1) ID of arg1-th solid in database
nsolid_lumps(arg1) Number of lumps of solid arg1
nsolid_faces(arg1) Number of faces of solid arg1
nsolid_edges(arg1) Number of edges of solid arg1
nsolid_vertices(arg1) Number of vertices of solidarg1
solid_area(arg1) Surface area of solid arg1
solid_volume(arg1) Volume of solid arg1
solid_element_type(arg1,arg2) Element type associated with solid arg1 for elements of class arg2. The
element class argument must be one of the following strings:
line2
line3
tria3
tria6
quad4
quad6
quad8
quad9
tetra4
tetra10
solid_cbody(arg1) Name of the contact body associated with solid arg1
solid_geom(arg1) Name of the geometric property associated with solid arg1
solid_mater(arg1) Name of the material associated with solid arg1
solid_orient(arg1) Name of the material orientation associated with solid arg1
solid_vertex_tform(arg1,arg2) Name of the transformation associated with vertex arg2 of solid arg1
CHAPTER A 84
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
solid_vertex_final_tform(arg1,arg2) Name of the effective transformation of vertex arg2 of solid arg1. If the
vertex has a transformation, then the name of this transformation is
returned. If the vertex does not have a transformation itself, then it
inherits the transformation from one of the edges of the solid which
share the vertex, or (if the edges do not have a transformation either)
from one of the faces of the solid which share the vertex, or (if neither
the edges nor the faces have a transformation) from the solid. In that
case, the name of the inherited transformation is returned.
solid_edge_tform(arg1,arg2) Name of the transformation of edge arg2 of solid arg1
solid_edge_final_tform(arg1,arg2) Name of the effective transformation of edge arg2 of solid arg1. If the
edge has a transformation, then the name of this transformation is
returned. If the edge does not have a transformation itself, then it
inherits the transformation from one of the faces of the solid which
share the edge, or (if the faces do not have a transformation either) from
the solid. In that case, the name of the inherited transformation is
returned.
solid_face_tform(arg1,arg2) Name of the transformation of face arg2 of solid arg1
solid_face_final_tform(arg1,arg2) Name of the effective transformation of face arg2 of solid arg1. If the
face has a transformation, then the name of this transformation is
returned. If the face does not have a transformation itself, then it inherits
the transformation from the solid. In that case, the name of the inherited
transformation is returned.
solid_tform(arg1) Name of the transformation of solid arg1
nnodes( ) Number of nodes in database
node_id(arg1) ID of arg1-th node in database
max_node_id( ) Largest node ID in database
node_x(arg1) Global X-coordinate of node arg1
node_y(arg1) Global Y-coordinate of node arg1
node_z(arg1) Global Z-coordinate of node arg1
node_u1(arg1) First user coordinate of node arg1
node_u2(arg1) Second user coordinate of node arg1
node_u3(arg1) Third user coordinate of node arg1
node_tform(arg1) Transform name of node arg1.
85 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
node_final_tform(arg1) Name of the effective transformation of node arg1; i.e. the
transformation that the node will have in the Marc analysis. This is the
same as node_tform(arg1), unless the node is associated with a solid
vertex, a solid edge, a solid face or a solid and the latter has an
(effective) transformation. In that case, the node inherits the
transformation from the solid entity.
nelements( ) Number of elements in database
element_id(arg1) ID of arg1-th element in database
max_element_id( ) Largest element id in database
element_node_id(arg1,arg2) ID of arg2-th node of element arg1
job_name( ) Name of the job
job_title( ) Title of the job
element_class(arg1) Class of element arg1. Returns an integer:
line2 = 0
line3 = 1
tria3 = 2
tria6 = 3
quad4 = 4
quad6 = 5
quad8 = 6
quad9 = 7
hex8 = 8
hex12 = 9
hex20 = 10
hex27 = 11
tetra4 = 12
tetra10 = 13
penta6 = 14
penta15 = 15
element_class_name(arg1) Similar to element_class(arg1), but returns the name of the element
class of element arg1 as a string, i.e. returns one of:
line2
line3
CHAPTER A 86
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
tria3
tria6
quad4
quad6
quad8
quad9
hex8
hex12
hex20
hex27
tetra4
tetra10
penta6
penta15
element_dimension(arg1) Dimension of element arg1 (returns either 2 or 3)
element_family(arg1) Family of element arg1. Returns an integer:
line = 1
tria = 2
quad = 3
hex = 4
tetra = 5
penta = 6
element_edges(arg1) Number of edges for element arg1
element_edge_area(arg1,arg2) Edge area of the arg2-th face of element arg1. If the edge ID arg2 is -1,
then it returns the total edge area of the element.
If the element number arg1 is -1, then it returns the total edge area of all
elements. If the element number arg1 is zero, then it returns the total
edge area of the selected elements.
element_edge_length(arg1,arg2) Edge length of the arg2-th face of element arg1. If the edge ID arg2 is -
1, then it returns the total edge length of the element.
If the element number arg1 is -1, then it returns the total edge length of
all elements. If the element number arg1 is zero, then it returns the total
edge length of the selected elements.
87 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
element_faces(arg1) Number of faces for element arg1
element_face_area(arg1,arg2) Face area of the arg2-th face of element arg1. If the face ID arg2 is -1,
then it returns the total face area of the element
If the element number arg1 is -1, then it returns the total face area of all
elements. If the element number arg1 is zero, then it returns the total
face area of the selected elements.
element_face_volume(arg1,arg2) Face volume of the arg2-th face of element arg1. If the face ID arg2 is
-1, then it returns the total face volume of the element.
If the element number arg1 is -1, then it returns the total face volume of
all elements. If the element number arg1 is zero, then it returns the total
face volume of the selected elements.
element_mass(arg1) Mass of element arg1. If the element number arg1 is -1, then it returns
the total mass of all elements. If the element number arg1 is zero, then
it returns the total mass of the selected elements.
element_nodes(arg1) Number of nodes for element arg1
element_volume(arg1) Volume of element arg1. If the element number arg1 is -1, then it returns
the total volume of all elements. If the element number arg1 is zero, then
it returns the total volume of the selected elements.
element_type(arg1) Element type associated with element ID arg1.
For example, obtain type of last element:
element_type(element_id(-1))
element_final_type(arg1) The effective element type of element ID arg1; i.e., the element type that
the element will have in the Marc analysis. This is the same as
element_type(arg1), unless the element is associated with a solid and an
element type has been associated with the solid for the element class of
this element. In that case, the element inherits the element type from the
solid.
element_cbody(arg1) Contact body name associated with element ID arg1
element_final_cbody(arg1) Name of the effective contact body associated with element ID arg1;
i.e., the contact body with which the element will be associated in the
Marc analysis. This is the same as element_cbody(arg1), unless the
element is associated with a solid and the solid is associated with a
contact body. In that case, the element inherits the contact body from the
solid.
element_geom(arg1) Geometric property name associated with element ID arg1
CHAPTER A 88
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
element_final_geom(arg1) Name of the effective geometric property associated with element ID
arg1; i.e., the geometric property that the element will have in the Marc
analysis. This is the same as element_geom(arg1), unless:
1. The element is associated with a solid and the solid has a geometric
property (in which case, the element inherits the geometry property
from the solid); or
2. The element is a line element and does not have a geometric
property itself, but its edge is attached to a curve with a geometric
property (in which case, the element inherits the geometric property
from the curve); or
3. The element is a triangular or quadrilateral element and does not
have a geometric property itself, but its face is attached to a surface
with a geometric property (in which case, the element inherits the
geometric property from the surface).
element_mater(arg1) Material name associated with element ID arg1
element_final_mater(arg1) Name of the effective material associated with element ID arg1; i.e., the
material that the element will have in the Marc analysis. This is the same
as element_mater(arg1), unless the element is associated with a solid
and the solid has a material. In that case, the element inherits the
material from the solid.
element_orient(arg1) Orientation property name associated with element ID arg1
element_final_orient(arg1) Name of the effective orientation property associated with element ID
arg1; i.e., orientation property that the element will have in the Marc
analysis. This is the same as element_orient(arg1), unless the element is
associated with a solid and the solid has an orientation property. In that
case, the element inherits the property from the solid.
nadapgs( ) Number of global remeshing criterion in the database
adapg_par(arg1,arg2) Parameter value named arg2 for the global remeshing criteria named
arg1. If arg1 is empty, then it uses the current global remeshing criteria.
Example:
adapg_par(adapg1,nelems)
adapg_name_index(ARG1) Global remeshing criterion name of ARG1-th global remeshing
criterion in database.
89 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
adapg_opt(arg1,arg2) Option string for option arg2 for the current global remeshing criterion
named arg1. If arg1 is empty, then it uses the current global remeshing
criterion.
Example:
adapg_opt(adapg1,immediate_crit)
adapg_type(arg1) Global remeshing criterion type for global remeshing criterion arg1. If
arg1 is empty, then it uses the current global remeshing criterion.
napplys( ) Number of boundary conditions in the database
apply_name_index(arg1) Boundary condition name of arg1-th boundary condition criterion in
database.
apply_opt(arg1,arg2) Option string for option named arg2 for the apply named arg1. If arg1 is
empty, then it uses the current apply. Option strings use same syntax as
in the *apply_option command.
Example:
apply_opt(apply1,ref_position)
apply_par_table(apply1,x) Parameter table name parameter named arg2 for the apply named arg1.
If arg1 is empty, then it uses the current apply. Parameter values use
same syntax as in the *apply_dof_table command
Example:
apply_par_table(apply1,x)
apply_type(arg1) Boundary condition type for boundary condition named arg1. If arg1 is
empty, then it uses the current boundary condition.
apply_par(arg1,arg2) Parameter value named arg2 for the apply (boundary condition) named
arg1. If arg1 is empty, then it uses the current boundary condition.
Example:
apply_par(apply1,temp_inf)
Valid parameters:
ambient_pressure, cavity_id, convection_coef, current_<x|y|z>,
diff_h_<1..10>, diff_z_e_<1..10>, diff_z_s_<1..10,
diffusion_coef, drag_coef, emp_corr_fl_fac,
emp_corr_fl_nfthp,emp_corr_fl_temp1, emp_corr_fl_temp2,
emp_corr_rr_fac, enth_ablation, enth_froz_comp, enth_pyr_twall,
enth_recovery, enth_wall_gas, flm_eff_view_fac, flm_emissivity,
flm_ext_dist_flux, flm_nat_conv_coef, flm_nat_conv_exp,
fluid_drag_factor, glocal_ext_tol, glocal_timeshift,
gradient_<x|y|z>, gravity_const, in_mass_density, in_surf_elev,
CHAPTER A 90
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
inertia_coef, init_weld_pos_<x|y|z>, liq_ph_enth_<1..10>,
liq_ph_massrt_<1..10>,nfam_particles, nliq_phases,
nterm_diffusion, out_mass_density, out_surf_elev,
part_correl_f_<1..10>, part_diameter_<1..10>,
part_enth_react_<1..10>, part_incid_ang_<1..10>,
part_massrt_<1..10>, part_velocity_x_<1..10>,
part_velocity_y_<1..10>, part_velocity_z_<1..10>, post_file_inc,
post_file_steps, pump_pressure, pyr_recession, rho_v_wall,
rot_axis_<x|y|z>1, rot_axis_<x|y|z>2, rot_axis_v<x|y|z>
sea_bed_elev, sol_abl_gas, sol_abl_liq_part, sol_abl_part_imp,
sol_massrt_eros, sol_massrt_gas, sol_massrt_part,
srf_nrg_diffusion, state_var_id, temp_inf, temp_inf_bot,
transpiration_f, view_fac_rec_inc, view_fac_rec_motion,
wave_dir_cos<1|2>, wave_height, wave_period, wave_phase,
weld_depth, weld_efficiency, weld_fwd_length,
weld_max_distance, weld_power, weld_rear_length,
weld_scale_factor, weld_surf_radius, weld_velocity, weld_width,
weldpath_offset_<x|y>
apply_dof_val(arg1,arg2) Degrees of freedom value named arg2 for the boundary condition
named arg1. If arg1 is empty, then it uses the current boundary
condition.
Example:
icond_dof_val(apply1,x)
icond_dof_val(,x)
Valid parameters:
h, kf, q, p, su, w, x1, x, y, z
apply_name( ) Returns the name of the current boundary condition.
ncbodys( ) Number of contact bodies in the database.
cbody_name_index(arg1) Contact body name of arg1-th global contact body in database.
cbody_opt(arg1,arg2) Option string for option named arg2 for contact body named arg1. If
arg1 is empty, then the current contact body is used. Option strings use
same syntax as in the *contact_option command.
Example:
cbody_opt(cbody1,wear)
91 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
cbody_par_table(arg1,arg2) Parameter table name for param named arg2 for contact body named
arg1. If arg1 is empty, then it uses the current contact body. Parameter
values use same syntax as in the *cbody_param_table command.
Example:
cbody_par_table(cbody1,filmk)
cbody_newtype(arg1) Contact body type for contact body named arg1. If arg1 is empty, then
it uses the current contact body. Function
cbody_type(arg1)should not be used anymore.
cbody_par(arg1,arg2) Parameter value named arg2 for the contact body named arg1. If arg1 is
empty, then it uses the current contact body.
Example:
cbody_par(cbody1,friction)
Valid parameters:
ac_bound_c1_inv, ac_bound_k1_inv, ax, ay, az, body_pressure,
body_voltage, brot, bx, by, bz, conductivity, contact,
contact_conductivity, contact_mass_flow_rate, cr, curve_div, cx,
cy, cz, dist_dep_conductivity, dist_dep_heat,
dist_dep_mass_flow_rate, film, friction, friction_class,
growth_factor_<x|y|z>, initvrot, initv<x|y|z>, mass_flow_rate,
natural_conv_coef, natural_conv_exp, near_contact_conductivity,
near_contact_heat, near_contact_mass_flow_rate, prot, px, py, pz,
sink_pressure, sink_voltage, spring_force, spring_lmax,
spring_lmin, spring_stiff, surf_div_u, surf_div_v,
surface_emissivity, tsink, tsurf, vrot, vx, vy, vz
cbody_class(arg1) Contact body class for contact body named arg1.
ctable_name( ) Returns the name of the current contact table.
nctables( ) Number of contact tables in the database
ctable_name_index(arg1) Contact table name of arg1-th contact table in database.
ctable_body_name_index(arg1) The name of the contact body that appears on row arg1 of a contact
table.
ctable_entry_exist(arg1,arg2,arg3) Returns 1 if an entry exists in contact table named arg1 for contact
bodies named arg2 and arg3 and returns 0 otherwise. If arg1 is empty,
then the current contact table is used.
Example:
ctable_entry_exist(ctable1,cbody1,cbody2)
CHAPTER A 92
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
ctable_opt(arg1,arg2,arg3,arg4) Option string for option named arg4 for the entry for contact bodies
named arg2 and arg3 in the contact table named arg1. If arg1 is empty,
then the current contact table is used. The contact table entry for the two
bodies must exist. Please see ctable_entry_exist() on how check
existence of the entry. Option strings use same syntax as in the
*contact_table_option command.
Example:
ctable_opt(ctable1,cbody1,cbody2,
contact_type)
ctable_par(arg1,arg2,arg3,arg4) Parameter value for parameter named arg4 for the entry for contact
bodies named arg2 and arg3 in the contact table named arg1. If arg1 is
empty, then the current contact table is used. The contact table entry for
the two bodies must exist. Please see ctable_entry_exist() on how check
existence of the entry. Parameter values use same syntax as in the
*contact_table_property command.
Example:
ctable_par(ctable1,cbody1,cbody2,friction)
ctable_par_table(arg1,arg2,arg3,arg4) Parameter table name for parameter named arg4 for the entry for contact
bodies named arg2 and arg3 in the contact table named arg1. If arg1 is
empty, then the current contact table is used. The contact table entry for
the two bodies must exist. Please see ctable_entry_exist() on how check
existence of the entry. Parameter values use same syntax as in the
*contact_table_property_table command.
Example:
ctable_par_table(ctable1,cbody1,cbody2,
friction)
niconds( ) Number of initial conditions in the database
icond_name_index(arg1) Initial condition name of arg1-th initial condition in database.
icond_opt(arg1,arg2) Option string for option named arg2 for the initial condition named
arg1. If arg1 is empty, then it uses the current initial condition. Option
strings use same syntax as in the *icond_option command.
Example:
icond_opt(icond1,dof_values)
icond_type(arg1) Initial condition type for icond arg1. If arg1 is empty, then it uses the
current initial condition.
93 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
icond_dof_val(arg1,arg2) Degrees of freedom value named arg2 for the initial condition named
arg1. If arg1 is empty, then it uses the current initial condition.
Example:
icond_dof_val(icond1,x)
icond_name( ) Returns the name of the current initial condition.
icond_par(arg1,arg2) Parameter value named arg2 for the initial condition named arg1. If arg1
is empty, then it uses the current initial condition.
Example:
icond_par(icond1,trans_x)
ngeoms( ) Number of geometric properties in the database
geom_name( ) Returns the name of the current geometric property
geom_name_index(arg1) Geometic property name of arg1-th geometry in database.
geom_opt(arg1,arg2) Option string for option named arg2 for geometry named arg1. If arg1
is empty, then it uses the current geometry. Option strings use same
syntax as in the *geometry_option command.
Example:
geom_opt(geom3,cdilatation)
geom_par(arg1,arg2) Parameter value for param named arg2 for geometry named arg1. If
arg1 is empty, then it uses the current geometry. Parameter values use
same syntax as in the *geometry_param command.
Example:
geom_par(geom3,thick)
geom_par_table(arg1,arg2) Parameter table name for value named arg2 for geometry named arg1.
If arg1 is empty, then it uses the current geometry. Parameter values use
same syntax as in the *geometry_param_table command.
Example:
geom_par_table(geom3,thick)
geom_type(arg1) Geometric property type for geometry arg1. If arg1 is empty, then it uses
the current geometry.
CHAPTER A 94
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
job_par(arg1,arg2) Parameter value named arg2 for job arg1. If arg1 is empty, then it uses
the current job.
Example:
job_par(lcase1,trans_x)
Valid parameters:
adapg_frequency, adapt_frequency, ambient_pressure,
bcond_pen_mp, bi_maxit, bi_tol, bm_bm_files_freq, condition,
conversion, cutoff, cycs_rot_axis_dir_<x|y|z>,
cycs_rot_axis_point_<x|y|z>, cycs_rot_nrepetitions,
cycs_tolerance, ddm_precond_level, ddm_sort_direction_<x|y|z>,
ddm_sort_point_<x|y|z>, ddm_tolerance, decomp_elweight_coeff,
des_act_cons, des_crit_cons, des_opt_cycles, disttol, disttolbias,
dyn_contact_pro_fact, ebe_heat_tol, ebe_maxit, ebe_stress_tol,
elec_heat_conv, fl_hardw_sparse_thresh,
flowl_grid_num_<x|y|z>, flowl_grid_pnt_<x|y|z>,
flowl_grid_siz_<x|y|z>, fluid_incomp_pen, fric_coeff_mult,
fric_force_tol, fric_heat_conv, hardw_sparse_thresh,
hemi_cube_axi_div, hemi_cube_pixels, hyper_post, id_post,
inc_strn_pred_mp, init_frict_stiff, instrain,
layers, limit_angle_<2d | 3d>, lmax, max_cont_nod,
max_cont_seg, max_el, max_fixed_dof, max_groups,
max_it_disp_comp, max_nod, maxsep, mean_strs_subtr, memory,
mi_high, mi_initshift mi_low, mi_maxfreq, mi_maxit, mi_nmodes,
mi_shiftmodes, mi_shiftpar, mi_tol, naggregates_domain,
nbmodes, ndomains, newm_beta_beta, newm_beta_gamma,
nmodes, npbmodes, pct_in_core, planck_radiation_2,
polytropic_proc_exp, post,
reauto_end, reauto_maxstep, reauto_percent, reauto_reassem,
reauto_recycles, reauto_steps, reauto_time, recess_file_freq,
rel_disp_threshold, rel_sepstress, restart, restart_time,
rp_incomp_pen, rstrt_ninc_bef_last,
sepforce, sepstress, shell_drill, si_st_hou_gamma,
si_st_hou_gamma1, singularity_thresh, slip_stick_trans,
solver_preallocation, sparse_maxit, sparse_tol,
specific_weight_<x|y|z>, speed_light_vacuum, spline_files_freq,
ss_roll_corn_axis_<dir|point>_<x|y|z>,
ss_roll_corn_axis_<dir|point>_<x|y|z>,
ss_roll_rot_axis_<dir|point>_<x|y|z>, start, state_variables,
stef_boltz, strline_file_freq,
95 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
temp_offset, thermal_prop_eval_fac, throat_axial_coord,
throat_circumf_div, throat_radial_coord, univ_gas_const,
usdata_alloc, user_nod_vects, view_fac_implic_ctff_frac,
view_fac_implic_thresh, view_fac_use_ctff_frac,
view_fac_use_thresh, vsliding
njobs( ) Number of jobs in the database.
job_class(arg1) Job class for job named arg1. If arg1 is empty, then it uses the current
job.
job_name_index(arg1) job name of arg1-th job in database.
job_opt(arg1,arg2) Option string for option named arg2 for the job named arg1. If arg1 is
empty, then it uses the current job. Option strings use same syntax as in
the *job_option command.
Example:
job_opt(job1,frictype)
nlcases( ) Number of loadcases in the database
lcase_opt(arg1,arg2) Option string for option named arg2 for the loadcase named arg1. If arg1
is empty, then it uses the current loadcase. Option strings use same
syntax as in the *loadcase_option command.
Example:
loadcase_opt(job1,stepping)
lcase_name_index(arg1) Loadcase name of arg1-th loadcase in database.
lcase_type(arg1) Loadcase type for loadcase named arg1. If arg1 is empty, then it uses the
current loadcase.
lcase_name( ) Returns the name of the current loadcase.
lcase_par(arg1,arg2) Parameter value named arg2 for loadcase arg1. If arg1 is empty, then it
uses the current loadcase.

abscurrent, angle<0..5>, anneal_temp, bcond_pen_mp,


before_bdc_<x|y|z>, beta, buckle_tol, charge, cooling_time,
Example:
lcase_par(lcase1,trans_x)
Valid parameters:
cornering_velocity, crank_length, creeptime, current, cutoff_stress,
cutter_rapid_speed, cycle_time,
CHAPTER A 96
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
d_epot_allowed, d_srec_allowed, d_xsic_allowed,
d_xsip_allowed, d_xsiv_allowed, damping_ratio, desired,
displacement, dp_allowed, dp_assemble, dp_error, dt_allowed,
dt_assemble, dt_error, duplicate_nrep, dyn_contact_pro_fact,
eccentricity, efficiency, elec_pot, finish_nds_contact, fluid_force,
fluid_incomp_pen, fluid_maxforce, fluid_maxvelo,
fluid_minforce, fluid_minvelo, fluid_velo, force, friction_force,
gamma,
ground_velocity_<x|y|z>, high, inc_assemble, inc_strain,
inc_strn_pred_mp, init_frict_stiff, initfraction, initshift, inittime,
limit_angle_<2|3>d, low, magn_pot,
mass, max_it_disp_comp, max_num_adjustments, max_step_ratio,
maxcharge, maxcurrent, maxdisp, maxelec_pot, maxforce,
maxfraction, maxinc, maxit, maxjobinc, maxmagn_pot,
maxmoment, maxmultiplier, maxnsteps, maxrec, maxrotation,
maxsubinc, maxtime, mc_dely<1..4>_<1..12>,
mc_xmax<1|2|3_<1..12>, mean_strs_subtr,
membr_pre_strs_<incs|val>, min_arcl_ratio, min_step_ratio,
mincharge, mincurrent, mindisp, minelec_pot, minforce,
minfraction, minmagn_pot, minmoment, minmultiplier, minrec,
minrotation, mintstep, moment, motion_cbody_<x|y|z><0..5>,
motion_cbody_rot<0..5>, multiblow,
nfreq, ngsteps, nmodes, npmodes, nsteps, ntime_cuts, num_post,
post_increment, press_dir_<x|y|z>, press_finish, press_max_force,
process_in1_<min|max>, process_out1_max_ctff,
process_out1_smpl_ctff, process_out1_tgt, pshigh,
ref_point_<x|y|z>, relcurrent, rod_length, rotate_<x|y|z>, rotation,
rp_ctff_strn_rt, rp_incomp_pen, rp_init_strn_rt,
scale_step, sequence, shell_drill, shiftmodes, shiftpar,
si_st_hou_gamma, si_st_hou_gamma1, singularity_thresh,
spinning_velocity, ss_rolling_tolerance, state_var_id, strain,
strain_change, stress_change, symmetry_norm_<x|y|z>, t_dist,
t_dist_bodys, t_force, t_nodes, t_stroke, temp_change,
temp_finish, thermal_prop_eval_fac, time, time<1..5>, tolerance,
torque, tot_energy, translate_<x|y|z>, transport_time,
univ_gas_const, vel_def, vel_in, vel_out, weight_d<x|y|z>,
weight_r<x|y|z>
lcase_title( ) Returns the title of the current loadcase.
nmaters( ) Number of materials in the database.
97 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
mater_id(arg1) Returns the ID of the material named arg1 or of the current material if
arg1 is empty
mater_name( ) Returns the name of the current material in the database
mater_name_index(arg1) Material name of arg1-th material in database.
mater_opt(arg1,arg2) Option string for option named arg2 for material named arg1. If arg1 is
empty, then it uses the current material. Option strings use same syntax
as in the *mater_option command.
Example:
mater_opt(material3,structural:type)
mater_par(arg1,arg2) Parameter value for param named arg2 for material named arg1. If arg1
is empty, then it uses the current material. Parameter values use same
syntax as in the *mater_param command.
Example:
mater_par(material3,structural:youngs_ modulus)
mater_par_table(arg1,arg2) Parameter table name for value named arg2 for material named arg1. If
arg1 is empty, then it uses the current material. Parameter values use
same syntax as in the *mater_param_table command.
Example:
mater_par_table(material3,structural: youngs_modulus)

mater_type(arg1) Material type for material named arg1. If arg1 is empty, then it uses the
current material.
mater_nsubmats(arg1) Number of submaterials of material named arg1, or of the current
material is arg1 is empty. The material must be a composite, mixture or
rebar material.
mater_vsubmat_name(arg1,arg2) Name of submaterial number arg2 of materal named arg1, or of the
current material if arg1 is empty. Material arg1 (or the current material
if arg1 is empty) must be a composite, mixture or rebar material.
mater_vsubmat_opt(arg1,arg2,arg3) Option string for the option named arg3 for submaterial number arg2 of
material named arg1, or of the current material if arg1 is empty. Material
arg1 (or the current material if arg1 is empty) must be a composite,
mixture or rebar material. Option argument uses same syntax as in the
*mater_submat_option command.
Example:
mater_vsubmat_opt(material3,5,general:thickdir)
CHAPTER A 98
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
mater_vsubmat_par(arg1,arg2,arg3) Value of parameter named arg3 for submaterial number arg2 of material
named arg1, or of the current marterial if arg1 is empty. Material arg1
(or the current material if arg1 is empty) must be a composite, mixture
or rebar material. Parameter argument uses same syntax as in the
*mater_submat_param command.
Example:
mater_vsubmat_par(material3,6,general:compos_ply_thick_percent)

mater_vsubmat_par_table(arg1,arg2,arg3) Returns the parameter table name for the parameter named arg3 for
submaterial number arg2 or the material named arg1, or of the current
marterial if arg1 is empty. Material arg1 (or the current material if arg1
is empty) must be a composite, mixture or rebar material. Parameter
argument uses same syntax as in the
*mater_submat_param_table command.
mater_fsubmat_name(arg1,arg2) Name of submaterial arg2 of material named arg1, or of the current
marterial if arg1 is empty. Material arg1 (or the current material if arg1
is empty) must be an interface, gasket, pshell or pyrolysis material. The
submaterial argument arg2 takes the same values as the first argument
to the *mater_submat_set_mater command.
Example:
mater_fsubmat_name(material3,bend)
mesh_par(arg1) Meshing parameter value named arg1.
Example:
mesh_par(qt_max_elements)
Valid parameters:
angle_cylindrical_part, attempts, axis_orientation,
base_element_size_<x|y|z>, boundary_refine_level,
boundary_refine_tolerance, box_<1...10>_max_<x|y|z>,
box_<1...10>_min_<x|y|z>, box_<1...10>_active,
box_<1...10>_type, box_<1...10>_level, critical_ring_angle,
coarsening_level, coon_representation, curvature_tolerance,
edge_detection, edge_angle, edge_length, el_gap, edge_tolerance,
enhance_mode, hex_elements, gap, grid_type, in_rat, mesher_type,
self_contact, shrink_factor, ties, write_extended
99 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
pm_par(arg1) Returns parameter string named arg1.
Example:
pm_par(arg1)
Example:
*define aa MyText
pm_par(aa)
pr_par(arg1) Program data parameter value named arg1.
Example:
pr_par(curve_div_maxl)
Valid parameters:
curve_div_<maxl|minl|type|ndiv|tol|rest>, curve_div_tol_abs,
mesh_cv_div_avgl, mesh_<min|max|param>_tol, intersect_tol,
relative_tol, sweep_tolerance, overlay_ndiv_<x|y>
nlinks( ) Number of links of any class in the database
nservos( ) Number of links of class servo in the database
nsprings( ) Number of links of class spring in the database
nties( ) Number of links of class tie in the database
link_class(arg1) Link type name for link arg1. One of: servo, spring, tie. If arg1 is empty,
then it uses the current link.
tie_type(arg1) Tie type name for tie arg1. If arg1 is empty, then it uses the current tie.
link_name_index(arg1) Link name of arg1-th link in database.
link_name( ) Returns the name of the current link.
tie_name () Returns the name of the current tie.
servo_name( ) Returns the name of the current servo.
spring_name( ) Returns the name of the current spring.
spring_par(arg1) Spring parameter value named arg1 for the current spring.
Example:
spring_par(damping)
Valid parameters:
conductivity, current, damping, dynamic_force, flux, heat,
init_force, static_forcet, stiffness
CHAPTER A 100
Arithmetic and Database Functions

Table A-2 Database Functions (continued)


Function Description
spring_par_table(arg1,arg2) Spring table name for value named arg2 for lin named arg1. If arg1 is
empty, then it uses the current spring. Parameter values use same syntax
as in the *spring_param_table command.
Example:
spring_par_table(link2,stiffness)
spring_opt(arg1,arg2) Option string for option named arg2 for spring named arg1. If arg1 is
empty, then it uses the current spring. Option strings use same syntax as
in the *spring_option command.
Example:
geom_opt(link2,spring_type)
norients( ) Number of orientations in the database
orient_name( ) Returns the name of the current orientation.
orient_name_index(arg1) Orientation name of arg1-th orientation in database.
orient_type(arg1) Orientation type for orientation arg1. If arg1 is empty, then it uses the
current orientation.
orient_opt(arg1,arg2) Option string for option named arg2 for orientation named arg1. If arg1
is empty, then the current orientation is used. Option strings use same
syntax as in the *orient_option command.
Example:
orient_opt(orientation1,reverse_curves)
orient_par(arg1,arg2) Parameter value for parameter named arg2 for orientation named arg1.
If arg1 is empty, then the current orientation is used. Parameter values
use same syntax as in the *orient_param command.
Example:
orient_par(orientation1,rx)
ntforms( ) Number of transforms in the database
tform_name( ) Returns the name of the current transform.
tform_name_index(arg1) Transform name of arg1-th transform in database.
tform_opt(arg1,arg2) Option string for option named arg2 for transform named arg1. If arg1
is empty, then it uses the current transform. Option strings use same
syntax as in the *transform_option command.
Example:
tform_opt(tform2,method)
table_name( ) Returns the name of the current table.
101 Marc Python Reference

Table A-2 Database Functions (continued)


Function Description
wz_par(arg1) SuperForm Wizard parameter value named arg1.
Example:
wz_par(length)
Valid parameters:
angle, diam, elmax, elmin, fric, fric_class, heatcoef, height, length,
mvx, mvy, mvz, num, rep, rotx, roty, rotx, temp, thick, type1, type2,
type3, type4, width
wz_str(arg1) SuperForm Wizard string value named arg1.
Example:
wz_str(tool_name)
Valid parameters:
die, cat_string, tool_name, workpiece, wp_name

Utility Functions
The following are the Mentat Utility Functions which can be used in the py_get_float, py_get_int, or
py_get_string functions.

Table A-3 Utility Functions


Function Description
range(arg1,arg2,arg3) Generates a string list of integer items that can be used as a pick list.
Definitions:
arg1 - start number
arg2 - end number
arg3 - increment
If arg1 < arg2, then the list is generated in reverse.
For example:
range(10,26, 4)
will return “10 14 18 22 26”.
Example usage:
*add_nodes 3 4 range(10,26,4)
range2(arg1,arg2) Same as range except that arg3 (the increment value) is set as 1.
element_aspect_ratio(arg1) Aspect ratio of element arg1 as computed by the *check_aspect
command
CHAPTER A 102
Arithmetic and Database Functions

Table A-3 Utility Functions (continued)


Function Description
element_distortion(arg1) Distortion factor of element arg1 as computed by the
*check_distorted command
element_inside_out(arg1) Returns 1 if element arg1 is inside out; 0 otherwise
element_upside_down(arg1) Returns 1 if element arg1 is upside down; 0 otherwise
element_attach_curve(arg1, arg2) Returns the ID of the curve to which the arg2-th edge of element arg1 is
attached, 0 otherwise
element_attach_surface(arg1, arg2) Returns the ID of the surface to which the arg2-th face of element arg1 is
attached; 0 otherwise
node_point_id(arg1) Returns the ID of the point to which the node arg1 is attached, 0 otherwise
curve_x(arg1, u) X coordinate of a point on curve arg1 with natural coordinate u
curve_y(arg1, u) Y coordinate of a point on curve arg1 with natural coordinate u
curve_z(arg1, u) Z coordinate of a point on curve arg1 with natural coordinate u
surface_x(arg1, u, v) X coordinate of a point on surface arg1 with natural coordinates <u>,<v>
surface_x(arg1, u, v) Y coordinate of a point on surface arg1 with natural coordinates <u>,<v>
surface_x(arg1, u, v) Z coordinate of a point on surface arg1 with natural coordinates <u>,<v>
global_x(ux, uy, uz) Transform the user coordinates (<ux>,<uy>,uz>) to the global
coordinate system and return the X coordinate.
global_y(ux, uy, uz) Transform the user coordinates (<ux>,<uy>,uz>) to the global
coordinate system and return the Y coordinate.
global_z(ux, uy, uz) Transform the user coordinates (<ux>,<uy>,uz>) to the global
coordinate system and return the Z coordinate.
user_def(arg1) Returns the user defined data at the specified index arg1 that was set with the
user_defined_data command.
user_x(gx, gy, gz) Transform the global coordinates (<gx>,<gy>,gz>) to the current user
coordinate system and return the X coordinate.
user_x(gx, gy, gz) Transform the global coordinates (<gx>,<gy>,gz>) to the current user
coordinate system and return the Y coordinate.
user_x(gx, gy, gz) Transform the global coordinates (<gx>,<gy>,gz>) to the current user
coordinate system and return the Z coordinate.

Post File Database Functions


The following are the Marc Post File Database Functions which can be used in the py_get_float, py_get_int,
or py_get_string functions.
103 Marc Python Reference

Table A-4 Post File Database Functions


Function Description
displace_x(arg1) Global X displacement of node arg1.
displace_y(arg1) Global Y displacement of node arg1.
displace_z(arg1) Global Z displacement of node arg1.
post_data(name) Returns the value for name, which is a string argument. It can be the name of any
PyPost attribute except for filename or extrapolate.
For example:
post_data(work)
post_data(time)
post_increments( ) If a post file is opened, it returns the number of increments in the post file.
post_node_extra(arg1) Returns 1 if node arg1 is an extra (dummy) node; 0 if a valid node.
scalar_1(arg1) First scalar component of node arg1
scalar_2(arg1) Second scalar component of node arg1
scalar_max_element( ) Returns the first element in which the scalar quantity is the maximum value.
scalar_min_element( ) Returns the first element in which the scalar quantity is the minimum value.
scalar_max_node( ) Returns the first node in which the scalar quantity is the maximum value.
scalar_min_node( ) Returns the first node in which the scalar quantity is the minimum value.
scalar_pos(x,y,z) Returns the value of the scalar quantity that is being postprocessed at position (x,y,z),
if that position is located somewhere in the finite element mesh or 0 if the position is
outside the finite element mesh. The value is obtained by interpolating the closest
element.
vector_x(arg1) Vector X value of node arg1. This can be a post file value or a value calculated from
*geomdist_surfaces or other vector creation commands.
vector_y(arg1) Vector Y value of node arg1. This can be a post file value or a value calculated from
*geomdist_surfaces or other vector creation commands.
vector_z(arg1) Vector Z value of node arg1. This can be a post file value or a value calculated from
*geomdist_surfaces or other vector creation commands.
add_disp(arg1, arg2) Increments (adds to) the global X,Y,Z displacement of node arg1 by arg2. If the node
number arg1 is -1, then it increments the global displacement X,Y,Zof all the nodes. If
the node number arg1 is zero, then it increments the global X,Y,Z displacement of the
selected nodes.
add_displ_x(arg1, arg2) Increments the global X displacement of node arg1 by arg2. If the node number arg1 is
-1, then it increments the global displacement X of all the nodes. If the node number
arg1 is zero, then it increments the global X displacement of the selected nodes.
CHAPTER A 104
Arithmetic and Database Functions

Table A-4 Post File Database Functions (continued)


Function Description
add_displ_y(arg1, arg2) Increments the global Y displacement of node arg1 by arg2. If the node number arg1 is
-1, then it increments the global displacement Y of all the nodes. If the node number
arg1 is zero, then it increments the global Y displacement of the selected nodes.
add_displ_z(arg1, arg2) Increments the global Zdisplacement of node arg1 by arg2. If the node number arg1 is
-1, then it increments the global displacement Zof all the nodes. If the node number
arg1 is zero, then it increments the global Z displacement of the selected nodes.
scale_disp(arg1, arg2) Scales the global X,Y,Z displacement of node arg1 by arg2. If the node number arg1 is
-1, then it scales the global displacement X,Y,Zof all the nodes. If the node number arg1
is zero, then it scales the global X,Y,Z displacement of the selected nodes.
scale_displ_x(arg1, arg2) Scales the global X displacement of node arg1 by arg2. If the node number arg1 is -1,
then it scales the global displacement X of all the nodes. If the node number arg1 is
zero, then it scales the global X displacement of the selected nodes.
scale_displ_y(arg1, arg2) Scales the global Y displacement of node arg1 by arg2. If the node number arg1 is -1,
then it scales the global displacement Y of all the nodes. If the node number arg1 is
zero, then it scales the global Y displacement of the selected nodes.
scale_displ_z(arg1, arg2) Scales the global Zdisplacement of node arg1 by arg2. If the node number arg1 is -1,
then it scales the global displacement Zof all the nodes. If the node number arg1 is zero,
then it scales the global Z displacement of the selected nodes.
set_displace_x(arg1, arg2) Sets the global X displacement of node arg1 to arg2.
set_displace_y(arg1, arg2) Sets the global Y displacement of node arg1 to arg2.
set_displace_x(arg1, arg2) Sets the global Z displacement of node arg1 to arg2.

Set Functions
The following are the Mentat Set functions which can be used in a call to the py_get_float or py_get_int
functions. The set_name and set_type functions return a string and must be used in a call to the
py_get_string function.

Table A-5 Set Functions


Function Description
is_curve_set(arg1) Returns 1 if set arg1 is a curve set, 0 otherwise.
is_edge_set(arg1) Returns 1 if set arg1 is a edge set, 0 otherwise.
is_element_set(arg1) Returns 1 if set arg1 is a element set, 0 otherwise.
is_face_set(arg1) Returns 1 if set arg1 is a face set, 0 otherwise.
is_node_set(arg1) Returns 1 if set arg1 is a node set, 0 otherwise.
105 Marc Python Reference

Table A-5 Set Functions (continued)


Function Description
is_point_set(arg1) Returns 1 if set arg1 is a point set, 0 otherwise.
is_surface_set(arg1) Returns 1 if set arg1 is a surface set, 0 otherwise.
nsets( ) Number of sets in database
nset_entries(arg1) Number of set entries for set arg1
set_edge(arg1, arg2) The ID of the arg2-th edge set entry in edge set arg1.
set_entry(arg1, arg2) The value of the arg2-th set entry in set arg1.
set_face(arg1, arg2) The ID of the arg2-th face set entry in face set arg1.
set_id(ARG1) ID of arg1-th set in database
set_name(arg1) Name of set arg1. This is a string value, and can only be used in py_get_string.
set_type(arg1) Type of set arg1. This is a string value, and can only be used in py_get_string. Returned
values will be one of the following strings: node, element, point, edge, curve, face, surface.

You might also like