MbdAnalysis (hwx.inspire.motion)

An analysis of the model using MotionSolve

Properties

Public Methods

classmethod load (cls, fname=None)

classmethod setupEvent (cls, mbdModel=None, end=None, dtout=None, type=None)

abortAnalysis (self)

analyze (self, mbdModel=None, end=None, dtout=None, type=None, animate=None, validate=True, **kwds)

getContactRunData (self, obj, component, frame=None)

getOutputPath (self)

getRunComponent (self, name, obj=None)

getRunData (self, obj, component, units=None, frame=None)

getRunObjects (self)

getRunPartPosition (self, part, frame)

getRunPosition (self, part, frame, pos=None)

getRunPositions (self, part, startFrame=0)

getRunTimeFrames (self, static=True, intermediate=True, animationRange=False)

getRunTimeSteps (self, convertUnits=True)

getRunTimeStepsForGui (self, **kwds)

getSystemRunPositions (self, system, startFrame=0)

getTypeOfRunContactData (self)

hasRunData (self, obj)

isValid (self)

onIntegrationStepDoneCB (self)

onSensorTriggered (self, **kwds)

onTimeStepDoneCB (self)

openHG (self)

openHV (self)

resetTheModel (self, redraw=True)

save (self, fname=None)

setAnimationRange (self, enabled=None, startFrame=None, endFrame=None)

setPositionsAtFrame (self, frame)

updateModelPositions (self, updateSpringPreloads=True)

usingUnits (self)

writePartDependentsLocations (self, part, file)

Property Details

property wrtPart

(inspire.Part | None) Animate parts relative to a reference part when calling setPositionsAtFrame.

Method Details

classmethod load(cls, fname=None)

Reload a saved analysis This creates and returns a new MbdAnalysis

classmethod setupEvent(cls, mbdModel=None, end=None, dtout=None, type=None)

Creates and returns an mbd.Event populated with input arguments if specified or mbdModel.analysisSettings if they were not specified

abortAnalysis(self)

Let the GUI abort the analysis

analyze(self, mbdModel=None, end=None, dtout=None, type=None, animate=None, validate=True, **kwds)

Run a analysis on the model

end[float] : Number of seconds to run the analysis. dtout[float] : Time between consecutive output steps. type[str] : TRANSIENT or STATICS or “STATICS TRANSIENT”. validate[bool] : Call valdidateMdb on the model, if there are any errors or warnings dont analyze. animate[bool] : Update part positions and redraw. **kwds : Passed to MbdModel constructor.

getContactRunData(self, obj, component, frame=None)

Get run data from contact. Can request: location, normal, tangential, regionLocation, regionNormal, regionTangential, off of a Contact object.

getOutputPath(self)

The directory for the solver output files generated from “Run history path in the settings made unique from the model name and a time stamp

getRunComponent(self, name, obj=None)

Called from the PlotManager to return a RunObject Component from the specified name

getRunData(self, obj, component, units=None, frame=None)

Return the list of values for the specified obj.component

obj is the inspire object component is a dot seperated name the identifies the mbd

request.component for the realized inspire object

To get the maximum force for a CoilSpring self.getRunData (spring, “FORCE.FM”, ‘force’)

This will return an empty list if the data can not be found because the component is invalid or the Request are turned off

getRunObjects(self)

Return all of the RunObjects for this run Used by MotionSolve.py to populate the compomemnts at each output step

getRunPartPosition(self, part, frame)

Return a Matrix44 for the part at the specified frame Used by MbdLoads to position transforce vectors to design position

getRunPosition(self, part, frame, pos=None)

Return the specified position wrt the part at the frame Used by Loads, Traceers, … to calculate a point on a part at a time

getRunPositions(self, part, startFrame=0)

Get list of part positions at every time step

getRunTimeFrames(self, static=True, intermediate=True, animationRange=False)

Return a list of output time frames This is a derived list of derived doubles It looks like the run timeSteps with additional functionality to make it useful in animation and plotting: it supports usingUnits can be filter out static and or intermediate (contact) steps can be trimmed to the range in the ReviewContext animation bar

getRunTimeSteps(self, convertUnits=True)

Return the time data for this run Useful for a plotting time in the X axis

getRunTimeStepsForGui(self, **kwds)

Return a filtered list of time steps for animation

the static steps are removed and if motionReviewsSettings.showOutputOnly the contact frames are removed

The returned list an instance of TimeFrames which is derived from list with extra functionality to map the filtered time steps to the true time steps. This so we can pass the list to the analimation frame as the time values, and when the user drags the animation tool bar slider we can get the true animation frame for setting the models part positions

use self.getRunTimeSteps for things like plotting where the number of xs need to match the number of ys since we dont filter non-time run data

getSystemRunPositions(self, system, startFrame=0)

Get list of system positions at every time step

getTypeOfRunContactData(self)

Used by the ForceDrawer to determine of it can sum the vectors Can not rely on the settings to because we have to support backward compatability

hasRunData(self, obj)

Any run data for the specified object?

isValid(self)

Did the analyze succeed in getting results

onIntegrationStepDoneCB(self)

Called at each integration step, updates the gui so the user can abort the simulation

onSensorTriggered(self, **kwds)

Called by MbdModel when a sensor is triggered

onTimeStepDoneCB(self)

Called at each output step, updates inspire part positions from the ‘solved’ mbd part positions from MotionSolve and calls user’s onTimeStepDone, which can redraw model or process GUI inputs

openHG(self)

Opens the current analyis results file in HG. Requires analysis to be run in same session.

openHV(self)

Opens the current analyis results file in HV. Requires analysis to be run in same session.

resetTheModel(self, redraw=True)

Called when analysis is done to reset model positions

save(self, fname=None)

Save the run to a file so it can be reloaded without running an analysys

setAnimationRange(self, enabled=None, startFrame=None, endFrame=None)

Called from the ReviewContext animation toolbar when the user changes the animation range.

setPositionsAtFrame(self, frame)

Set animation position of all the inspire parts to the specified frame.

Pass None to exit animation and reset the model

updateModelPositions(self, updateSpringPreloads=True)

Set the design space positions of all the inspire parts to their position in the current analysis frame

Spring preloads can also be updated

usingUnits(self)

Context manager to use when working with analysis run data. E.g. - Creating / updating core objects using run data - Get unit labels for showing run data in the gui

writePartDependentsLocations(self, part, file)

Write the locations of the i and j markers of the objects that are dependent on self.part