Output
Class Output()
Output(parent='MODEL', name='Output_n', label='Output_n', active=True,
itype='DISP', subtype='TWO_POINTS', i_or_j='BOTH_MARKERS',
i_or_j_body='BOTH_MARKERS', p1='P_Global_Origin', p2='P_Global_Origin',
b1='B_Ground', b2='B_Ground', ent_type='Body', rm='Global_Frame', body_ref=None,
joint_ref=None, beam_ref=None, bush_ref=None, field_ref=None, force_ref=None,
spdp_ref=None, contact_ref=None, entset_type='BODIES', use_predefref=False,
predef_ref='GLOBAL', use_units=False, f2_expr='`0`', f3_expr='`0`', f4_expr='`0`',
f6_expr='`0`', f7_expr='`0`', f8_expr='`0`')
The output is used to specify what information to be output when a simulation is run. Output types include displacements, velocities, accelerations, forces, and quantities computed according to user- defined expressions.
getValue, setValue
Keyword Arguments
Argument | Data Type | Description | Default |
---|---|---|---|
name | String | The variable name. | Output_n, for next available integer n. |
label | String | The descriptive label. | Output_n, for next available integer n. |
parent | Object | The parent. | MODEL |
active | Bool | Used to activate or deactivate this entity. | True |
itype | Enum | Type of the output. One of: DISP, VEL, ACCL, FORCE, EXPR or USER. | DISP |
subtype | Enum | Subtype when itype is DISP, VEL, ACCL or FORCE. One of TWO_POINTS which creates output for two points attached to two different bodies, ENTITY which creates output for a given entity or ENTITY_SET which creates output for a given set of entities. | TWO_POINTS |
i_or_j | Enum | Selects the I marker, J marker or both for ent_type other than contact. One of I_MARKER, J_MARKER or BOTH_MARKERS. | BOTH_MARKERS |
i_or_j_body | Enum | Selects the I body, J body or both for ent_type of contact. One of I_MARKER, J_MARKER or BOTH_MARKERS. | BOTH_MARKERS. |
p1 | Point | The first point when sub_type is TWO_POINTS. | P_Global_Origin |
p2 | Point | The second point when sub_type is TWO_POINTS. | P_Global_Origin |
b1 | Body | The body on which point_1 lies when sub_type is TWO_POINTS. | B_Ground |
b2 | Body | The body on which point_2 lies when sub_type is TWO_POINTS. | B_Ground |
ent_type | MultiRef | The type of entity on which output is requested when subtype is ENTITY. Can take values Body, Joint, Beam, Bushing, Field, Force, SpringDamper or Contact. | Body |
rm | Marker | The marker in which the output is requested. | Global_Frame |
body_ref | Body | The body on which the output is requested when ent_type is Body. | None |
joint_ref | Joint | The Joint on which the output is requested when ent_type is Joint. | None |
beam_ref | Beam | The Beam on which the output is requested when ent_type is Beam. | None |
bush_ref | Bushing | The Bushing on which the output is requested when ent_type is Bushing. | None |
field_ref | Field | The Field on which the output is requested when ent_type is Field. | None |
force_ref | Force | The Force on which the output is requested when ent_type is Force. | None |
spdp_ref | SpringDamper | The SpringDamper on which the output is requested when ent_type is SpringDamper. | None |
contact_ref | Contact | The Contact on which the output is requested when ent_type is Contact. | None |
entset_type | Enum | Type of entities for which output is requested when subtype is ENTITY_SET. One of BODIES, JOINTS, BEAMS, BUSHINGS, FIELDS, FORCES, SPRINGDAMPERS or CONTACTS. | BODIES |
use_predefref | Bool | Use predefined reference frame when set to True. | False |
predef_ref | Enum | Predefined reference of type LOCAL, LPRF or GLOBAL when use_predefref is True. | GLOBAL |
use_units | Bool | Use custom name and units when set to True. | False |
f2_expr | Function | A number, MDL expression, or solver expression for the second component of the output. | ‘`0`' |
f3_expr | Function | A number, MDL expression, or solver expression for the third component of the output. | ‘`0`' |
f4_expr | Function | A number, MDL expression, or solver expression for the fourth component of the output. | ‘`0`' |
f6_expr | Function | A number, MDL expression, or solver expression for the sixth component of the output. | ‘`0`' |
f7_expr | Function | A number, MDL expression, or solver expression for the seventh component of the output. Defaults to ‘`0`'. * f8_expr (Function) - A number, MDL expression, or solver expression for the eighth component of the output. | ‘`0`' |
cunits | StringVector | A list of custom cunits. | [‘', ‘', ‘', ‘', ‘', ‘', ‘', ‘'] |
cnames | StringVector | A list of custom cnames. | [‘', ‘', ‘', ‘', ‘', ‘', ‘', ‘'] |
Notes
1. The parent parameter can only be initialized by the constructor and should not be modified directly.
2. Only parent can be used as a positional argument in the constructor.
Examples
Create and modify attributes of an Output.
>>> from hw import mview
>>> #Create entities to be analysed
>>> b1 = mview.Body(inertia_props_from_graphic = True)
>>> g1 = mview.Sphere(origin = 'P_Global_Origin',body = b1)
>>> #Create output for Body displacement and set multiple values at once
>>> o1 = mview.Output(name='gravity_disp',itype = 'DISP')
>>> o1.setValues(subtype = 'ENTITY',body_ref = b1)
>>> #Changing the model to analyse joint rotation
>>> j1 = mview.Joint(b1 = b1, b2 = 'B_Ground')
>>> f1 = mview.Force(itype = 'ROT',b1 = b1,origin = 'P_Global_Origin')
>>> j1.origin = 'P_Global_Origin'
>>> f1.tx.lin = 5
>>> #Change the Output type to Expressions and define the expression
>>> o1.itype = 'EXPR'
>>> o1.f2_expr = "`AX({Joint_1.i.idstring})`"
>>> #Similar steps can be done to create outputs for other entities
>>> #For Userdefined outputs
>>> o1.itype = 'USER'
>>> o2.use_local_dll = True
>>> o2.usr_type = 'USER'
>>> o2.usr_sub = 'FUNC()'
>>> o2.local_funcname = 'REQSUB_USER'
>>> o2.local_func_type = 'DLL'