udfGetMmoRgdData()

Return data from a rigid body mesh motion.

Syntax

mmoRgdData = udfGetFbdData( udfHd, mmoRgdName, dataName ) ;

Type

AcuSolve User-Defined Function Global

Parameters

udfHd
The opaque handle (pointer) which was passed to the user function.
mmoRgdName (string)
Name of the MESH_MOTION command (must be of rigid_body type).
dataName (integer)
Symbolic name of the requested data.
UDF_MMO_RGD_PREV_DISPLACEMENT
Displacement at step n.
UDF_MMO_RGD_PREV_VELOCITY
Velocity at step n.
UDF_MMO_RGD_PREV_ROTATION
Rotation at step n.
UDF_MMO_RGD_PREV_ANG_VELOCITY
Angular velocity at step n.
UDF_MMO_RGD_CURR_DISPLACEMENT
Displacement at step n+1.
UDF_MMO_RGD_CURR_VELOCITY
Velocity at step n+1.
UDF_MMO_RGD_CURR_ROTATION
Rotation at step n+1.
UDF_MMO_RGD_CURR_ANG_VELOCITY
Angular velocity at step n+1.
UDF_MMO_RGD_EXTERNAL_FORCE
External force at step n+1.
UDF_MMO_RGD_EXTERNAL_MOMENT
External moment at step n+1.

Return Value

mmoRgdData (real)
Pointer to one dimensional real array of the requested data. The dimension of the array is three for all values of dataName.

Description

This routine returns data from a rigid body mesh motion. For example,
Void usrUdfMmo(
   UdfHd udfHd, /* Opque handle for accessing data */
   Real* outVec, /* Output vector */
   Integer nItems, /* Number of items in outVec */
   Integer        vecDim /* Vector dimension of outVec */
)  {
   Real* rotOrg ; /* rotation center */
   Real* rot ;        /* rotation */
   Real* trans ; /* displacement */
   String*        usrStrs ; /* user strings */
   String rgdMmoName ; /* name of rigid body mmo */
   Integer timeStep ;/* time step */
   Integer i ; /* running index */ 
 

   udfCheckNumUsrStrs( udfHd, 1 ) ;
   udfCheckNumUsrVals( udfHd, 3 ) ;
 

   timeStep = udfGetTimeStep( udfHd ) ;
   usrStrs = udfGetUsrStrs( udfHd ) ;        
   rgdMmoName = usrStrs[0] ;                        
   rotOrg = udfGetUsrVals( udfHd ) ;        
   rot = udfGetMmoRgdData( udfHd, rgdMmoName, UDF_MMO_RGD_CURR_ROTATION ) ;
   trans = udfGetMmoRgdData( udfHd, rgdMmoName, UDF_MMO_RGD_CURR_DISPLACEMENT) ;
   udfPrintMess( udfHd, "time step = %d, rot = (%f,%f,%f), disp = (%f,%f,%f)", 
           timeStep, rot[0], rot[1], rot[2],
           trans[0], trans[1], trans[2]        ) ;
   udfBuildMmo( udfHd, rot, rotOrg, trans, outVec ) ;
 

   for ( i = 0 ; i < 12 ; i++ ) {
       udfPrintMess( udfHd, "mmoMtx[%d] = %f", i, outVec[i] );
   }
} /* end of usrUdfMmo */

Errors

  • This routine expects a valid udfHd.
  • mmoRgdName must be a valid name.
  • dataName must be one of the values given above.