View Full Version : LS Dyna
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.
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.
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
Your statement sounds OK. I recommend not using common blocks.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.