4.8.3.55. GET_RFLEX_NMODE
The GET_RFLEX_NMODE subroutine returns the number of selected modes. GET_RFLEX_ NMODE is an auxiliary subroutine for MODAL_FORCE or MODAL_FORCE_EXT.
Language type |
Subroutine |
FORTRAN |
call get_rflex_nmode(ifbody, nmode, errflg) |
C/C++ |
get_rflex_nmode(ifbody, &nmode, &errflg)) |
Variable Name |
Size |
Description |
ifbody |
int |
Sequential id of RFlex body defined in RecurDyn/Solver. |
nomode |
int |
Number of selected modes. |
Errflg |
int |
Error flag.
If the result of this argument is -1
(means TRUE in Fortran logical value),
there is no error.
The others mean that there is an error.
|
C---- SUB. MODAL_FORCE
SUBROUTINE MODAL_FORCE
& (ID,TIME,UPAR,NPAR,IFBODY,POS,VEL,ACC,
& NMODE,NNODE,NMODALLOAD,MODALLOADS,
& JFLAG,IFLAG,RESULT)
implicit none
C---- TO EXPORT * SUBROUTINE
!DEC$ ATTRIBUTES DLLEXPORT,C::MODAL_FORCE
C---- INCLUDE SYSTEM CALL
INCLUDE 'SYSCAL.F'
INTEGER ID, NPAR, IFBODY
DOUBLE PRECISION TIME, UPAR(*), POS(12), VEL(6), ACC(6)
INTEGER NMODE, NNODE, NMODALLOAD
DOUBLE PRECISION MODALLOADS(6+NMODE, NMODALLOAD)
LOGICAL JFLAG, IFLAG
DOUBLE PRECISION RESULT[REFERENCE](6+NMODE)
C----USER STATEMENT
INTEGER check_nmode,ierr
call get_rflex_nmode(ifbody,check_nmode,ierr)
call errmes(ierr,"MForce",ID,"hyc_usub_test");
if(check_nmode.ne.nmode) then
call errmes(0,"MForce",ID
& "Selected number of mode is wrong!!!
& There's an error!")
endif
do i=1, 6+nmode
result(i)=0.0d0
enddo
RETURN
END
#include "stdafx.h"
#include "DllFunc.h"
#include "math.h"
using namespace rd_syscall;
ModalForce_API void __cdecl modal_force
(int id, double time, double upar[], int npar, int ifbody, double pos[12],
double vel[6], double acc[6], int nmode, int nnode, int nModalLoad,
double *ModalLoads, int jflag, int iflag, double *result)
{
// User Statement
int check_nmode,ierr;
// Check number of selected mode
get_rflex_nmode(ifbody,&check_nmode,&ierr);
errmes(ierr,"MForce",id,"hyc_usub_test");
// The number of selected modes must be the same
// between "get_rflex_nmode()" funtion and "nmode" argument of ModalForceUSUB.
if(nmode!=check_nmode)
{
errmes(0,"MForce",id,"Selected number of mode is wrong!!! There's an error!");
}
for(int i=0;i<6+nmode;i++) result[i]=0.0;
}