Create Custom Results Output

Custom results output allows you to pass MotionSolve results directly to a user-written subroutine denoted by POST_SUB.

MotionSolve calls POST_SUB at every successful integration time step which uses the MotionSolve Result API for generating the results in a customized format. You have access to the same data as passed to the MotionSolve MRF file (shown here in HyperGraph) via POST_SUB, as shown in the image below.


Figure 1. HyperGraph Panel for POST_SUB Access
  1. Add the <Post_UserAPI/> element to the MotionSolve XML input file.


    Figure 2. <Post_UserAPI/> Element
  2. Write a POST_SUB:


    Figure 3. Code in POST_SUB
  3. From within POST_SUB, call access functions to get the states of selected entity types.
    These access functions are:
    • c_get_post_states
    • c_getnumid
    • c_getidlist

      as shown in the image below. Valid entity types are PART, POINT_MASS, FLEX_BODY, and REQUEST.



    Figure 4. POST_SUB's Three Access Functions
    The image below shows an example of the results accessed in POST_SUB in XML format:


    Figure 5. Results written out in XML Format