C/C++ example for GET_FFLEX_BODYSEQID

 

TEST_API void __cdecl nodal_force_ext

           (int id, double time, double upar[], int npar, int ifbody, int nodarr[], int nonde, int jflag, int iflag, double result[])

{

           using namespace rd_syscall;

           // Parameter Information

           //   id      :  Nodal Force sequential identification. (Input)

           //   time    :  Simulation time of RD/Solver. (Input)

           //   upar    :  Parameters defined by user. (Input)

           //   npar    :  Number of user parameters. (Input)

           //   ifbody  :  FFLEX Body sequential ID. (Input)

           //   nodarr  :  Node sequential ID array of input node set. (Input)

           //   nonde   :  Number of node of node set. (Input)

           //   jflag   :  When RD/Solver evaluates a Jacobian, the flag is true. (Input)

           //   iflag   :  When RD/Solver initializes arraies, the flag is true. (Input)

           //   result  :  Returned nodal force vector. Acting point of the nodal force is each center of each node.

           //              Reference frame of each force vector must be the ground inertia marker. (Output, Size : nonde * 6)

 

           // User Statement

  using namespace rd_syscall;

 

  int errflg = 0;

  int targerBodySeq = 0;

  int targetNodeSeq = 0;

 

  int targerNodeID = 62;

 

  TCHAR targerBodyName[256];

 

  _tcscpy(targerBodyName,_T("FFlexBody1"));

  get_fflex_bodyseqid(targerBodyName,&targerBodySeq,&errflg);

  get_fflex_nodeseqid(targerBodySeq,targerNodeID,&targetNodeSeq,&errflg);

 

  for(int i=0;i<6;i++) result[i] = 0.0;

}