#include #include #include #include extern "C" void FOR_NAME(stdb_abqerr, STDB_ABQERR) (int&, const char*, const int*, const double*, const char**); void TerminateExecution(const char* errMsg); extern "C" void FOR_NAME(disp,DISP)(double* U, const int& KSTEP, const int& KINC, const double* TIME, const int& NODE, const int& NOEL, const int& JDOF, const double* COORDS) { constexpr int no_error{0}; double uValPrev[1]{0.}; double uValCrt[1]{0.}; // COORDS contains the original coordinates (NLGEOM = NO) // Func eval of NN used in the previous step if (nntk_ffd_eval_funcC(KSTEP - 1, COORDS, uValPrev) != no_error){ TerminateExecution("nntk_ffd_eval_funcC() evaluation failure"); } // Func eval of NN used in the current step if (nntk_ffd_eval_funcC(KSTEP, COORDS, uValCrt) != no_error){ TerminateExecution("nntk_ffd_eval_funcC() evaluation failure"); } // Compute the total displacement we need to apply to go from prev NN shape to current NN shape // and ramp the needed change using the step time U[0] = uValPrev[0] + (uValCrt[0] - uValPrev[0]) * TIME[0]; } void TerminateExecution(const char* errMsg) { int i{0}; double d{0.}; const char* c = "\0"; int jop = -3; //error CALL_NAME(stdb_abqerr, STDB_ABQERR) (jop, errMsg, &i, &d, &c); }