View Full Version : LS Dyna
pamCrash
2007-02-21, 04:33
Hi,
Does any one of you implemented LS-Dyna user material subroutines in C language rather than fortran. Can you please give me some advice on how to deal with Fortran common variables in C. I will appreciate ur your help.
Thanks,
Rajesh
I have written user-subroutines in various languages, including C. It typically works fine, but it can be tricky to get the correct function arguments.
I would not attempt to share global (common) variables between Fortran and C, instead pass the global variables as part of a function call and then set up a separate set of global variables in C.
Note, however, it is not recommended to use global (common) variables at all when writing a user material subroutine. This is specifically a problem when you run on a multiple CPU computer/cluster.
- Jorgen
pamCrash
2007-02-27, 13:40
Hello Jorgen,
Thank you for the advice. If I understood you well then the procedure is, from LS DYNA USRMAT() subroutine pass on the all the necessary arguments common block etc to a C subroutine. Am I right? By doing so, you think I wont get in to troubles when it comes to parallel computing.
For example if I want to access the rotation matrix in order to transform from global to local axis then I need this common block
common/aux131oc/gl11(nlq), gll2(nlq) ...etc
Thx,
Rajesh
Your statement sounds OK. I recommend not using common blocks.
- Jorgen
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.