MdlLikeMethods#
This module contains functions that can be helpful during the construction of simple models.
- Orientation(angles=None, degrees=False, rm=None, axis_type=None, axis=None, origin=Point(0.0, 0.0, 0.0), plane_type=None, plane=None, mirror=False)#
Returns the orientation for all supported MDL methods.
This includes:
One Axis - ‘axis_type’ points to ‘axis’, where:
axis_type can be “X”, “Y” or “Z”,
axis can be Point, Vector or list [DxDyDz] or (Dx,Dy,Dz).
Two Axes - ‘axis_type’ points to ‘axis’, ‘plane_type’ lies in ‘plane’, where:
plane_type can be “XY”, “XZ”, “YX”, “YZ”, “ZX”, “ZY”,
plane can be Point, Vector or list [DxDyDz] or (Dx,Dy,Dz).
Angles
angles are the euler angles with respect to the rm marker in Deg or Rad.
- Parameters
angles – Euler angles that define the orientation.
degrees (bool) – Specify whether Euler angles are specified in radian or degree.
rm (Marker) – Reference marker upon which the orientation is defined.
axis_type (Enum) – Specify which axis is defined by the argument axis.
axis – Define the direction of the axis. Choose from “X”, “Y”, “Z”.
origin (Point) – Define the origin. It is only used when axis or plane is defined by Point.
plane_type (Enum) – Specify the second axis defined by the argument plane. Choose from “XY”, “XZ”, “YX”, “YZ”, “ZX”, “ZY”.
plane – Define the direction of the second axis.
mirror –
- Returns
Two Points specifying the z-axis and x-axis of the Orientation.
- createBeam(id, i, j, label='', type='arbitrary', length=1, E=1, G=1, CRatio=1, AS2=1, AS3=1, OD=1, ID=1, AS=1, P2_DIM=1, P3_DIM=1, Area=1, I11=1, I22=1, I33=1, Fx=0, Fy=0, Fz=0, Tx=0, Ty=0, Tz=0)#
Create a Beam between markers i and j. The Beam object maintains its designability.
- Parameters
id (bool) – ID of Beam
i (Marker) – Marker i of Beam.
j (Marker) – Marker j of Beam.
label (str) – Label of Beam.
type (Enum) – Type of Beam. Choose from “arbitrary”, “rectangular”, “circular”.
length (Double) – Length of Beam.
E (Double) – Young’s modulus.
G (Double) – Shear modulus.
CRatio (Double) – Damping ratio of Beam.
AS2 (Double) – Shear area ratio in the y direction.
AS3 (Double) – Shear area ratio in the z direction.
OD (Double) – Outer diameter of circular beam.
ID (Double) – Inner diameter of circular beam.
AS (Double) – Shear area ratio of circular beam.
P2_DIM (Double) – Y dimension of rectangular beam.
P3_DIM (Double) – Z dimension of rectangular beam.
Area (Double) – Cross sectional area of arbitrary beam.
I11 (Double) – Torsional stiffness shape factor for the cross-section of arbitrary beam.
I22 (Double) – The second moment of inertia about the y axis of arbitrary beam.
I33 (Double) – The second moment of inertia about the z axis of arbitrary beam.
Fx (Double) – Translational preload force along x,y,z axes.
Fy (Double) – Translational preload force along x,y,z axes.
Fz (Double) – Translational preload force along x,y,z axes.
Tx (Double) – Rotational preload torque along x,y,z axes.
Ty (Double) – Rotational preload torque along x,y,z axes.
Tz (Double) – Rotational preload torque along x,y,z axes.
- Returns
A
Beam
entity.
- createCurveFor2DContact(paramCurveI, paramCurveJ, designableIndexI=[], boundsI=[], designableIndexJ=[], boundsJ=[])#
Create 2 curves that can be used to define a 2D Contact. The user can specify which points need to be made designable in the new curves created.
- Parameters
paramCurveI (Curve) – The first parametric curve upon which 2D contact is defined.
paramCurveJ (Curve) – The second parametric curve upon which 2D contact is defined.
designableIndexI – Specify the points in Curve I that should be made designable.
designableIndexJ – Specify the points in Curve J that should be made designable.
boundsI – Specify the upper and lower bounds of designable points in Curve I.
boundsJ – Specify the upper and lower bounds of designable points in Curve J.
- Returns
Two
Curve
entities that are equivalent to paramCurveI, paramCurveJ, and can be used for 2D Contact.
- createNewCurve(paramCurve, normal, designableIndex, bounds)#
Create a new Curve that can be used for 2D Contact.
- Parameters
- Returns
The new
Curve
entity created.
- generateExpression(request, component=1)#
Generate the solver expression for request object when its type is in:
DISPLACEMENT
VELOCITY
ACCELERATION
FORCE
- Parameters
request (Request) – A Request object. All properties of that request must be specified and they cannot be changed afterwards.
component (Int) – An integer between 1 and 8 and corresponds to the f1-f8 in mrf file.
- Returns
A string containing the specified expression.
- getCurveNormal(paramCurve)#
Computes the normal vector of a planar curve. The calculation is done in the local reference frame and then converted to the global coordinate system.
- Parameters
paramCurve (Curve) – The Curve entity.
- Returns
The normal Vector when paramCurve is a planar curve.
Zero vector when paramCurve is a line.
Raise an exception when the curve is not planar.
- getCurveTangential(paramCurve)#
Get the tangential vector of a Curve entity.
- Parameters
paramCurve – (Curve) Curve object which represents a straight line.
- Returns
The normalized tangential Vector of paramCurve.
- get_dc(marker)#
Returns three vectors parallel to the x, y, z axes of a Marker in the global reference frame.
- get_xaxis(marker)#
Returns a vector parallel to the x-axis of a Marker in the global reference frame.
- get_yaxis(marker)#
Returns a vector parallel to the y-axis of a Marker in the global reference frame.
- get_zaxis(marker)#
Returns a vector parallel to the z-axis of a Marker in the global reference frame.
- loc_along_dir(origin, vector, distance)#
Returns a set of three coordinate values in the Global Frame, to locate a point along the direction of a vector at a certain distance from an origin point.
- loc_between(first_point, end_point, dist_ratio)#
Returns a set of three coordinate values in the Global Frame, to locate a point between two points at a certain distance ratio.
- loc_cylindrical(coord, rm, degrees=True)#
Returns a set of three coordinate values in the Global Frame, to locate a given set of cylindrical coordinate values in a given reference frame.
- loc_mirror(master_point, ref_marker, plane)#
Returns a set of three coordinate values in the Global Frame, to locate a point symmetric with respect to a reference marker about its specified plane.
- loc_rel_to(point, marker)#
Returns a set of three coordinate values in the Global Frame, to locate a given set of coordinate values, or a point or marker in a given reference frame.