电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

Adams2024编译C语言用户子程序生成dll超详细教程

Adams2024编译C语言用户子程序生成dll超详细教程_第1页
1/8
Adams2024编译C语言用户子程序生成dll超详细教程_第2页
2/8
Adams2024编译C语言用户子程序生成dll超详细教程_第3页
3/8
1.操作系统:Windows xp 32 位2.软件版本:Adams 2024 32 位、Visual Studio 2024 专业版 32 位3.编译软件:Intel VisualFortran 11.04.环境配置:(1) 在操作系统环境变量 Path 中增加 Adams 启动文件 mdi.bat 的路径,如 D:\MSC.Software\Adams\2024\common\mdi.bat(2) 把 Fortran 安装路径,如D:\IVF2024\Intel\ComposerXE-2024\compiler\lib\ia32(3) 把libifcoremd.lib、libifcoremd.lib、libmmd.lib、libifportmd.lib、libirc.lib、svml_dispmd.lib 这 6个库文件复制到 Adams 安装路径下 win32 文件夹下5.编写用户子程序Adams 安装程序 D:\MSC.Software\Adams\2024\solver\c_usersubs 文件夹下有 C 语言编写的常用的用户子程序,其中 slv_c_utils.h 文件是用户子程序的头文件。编写用户子程序时,在这些程序的基础上进行更改会有事半功倍的效果。本文以编写 VForce 用户子程序为例,对其编写、编译操作过程进行说明。复制 vfosub.c 和 slv_c_utils.h 两个文件到个人工作文件夹 Adams_Matlab,本文直接使用vfosub.c 的原始代码,其代码为:#include"slv_c_utils.h"adams_c_Vfosub Vfosub;/** Note: * Use mixed case names for the Adams subroutine names when using the C * style interface. For the default subroutine name capitalize the first* letter and have the remaining letters lower case; Gfosub for example. * Doing this insures that Adams Solver correctly distinguishes a C style * subroutine from Fortran and calls with the appropriate interface.* */void Vfosub(conststruct sAdamsVforce* vfo, double time, int dflag, int iflag, double* result){/* Assign readable variable names to passed parameters */double c=vfo->PAR[0];int ipar[3]={(int)vfo->PAR[1], (int)vfo->PAR[2],(int)vfo->PAR[1]};/* Local variables */double vel[3];int nstates;int errflg;/* call SYSARY for translation velocities TVEL */ c_sysary("TVEL", ipar, 3, vel, &nstates, &errflg); c_errmes(errflg, "Error calling SYSARY for TVEL", vfo->ID, "STOP");/* --- Evaluate VFORCE components ------------------------- */ result[0] = -c ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

Adams2024编译C语言用户子程序生成dll超详细教程

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部