Plaxis 2D allows user-definition of material models using fortran. Their documentation recommends that the fortran project be compiled into a dll with a specific name (usrmod.dll) and also provides access to subroutines that can do additional work (Appendix C of their material model manual). I'm guessing the user has no access to the source code of these subroutines and that the user must access them using a dll.
One compile line they recommend is as follows:
- ifort /winapp USRMOD.FOR DFUsrLib.lib /dll
I'm guessing that DFUsrLib.lib is they library where the common functions are contained. However I can't find it anywhere in the root directory of the program and thus have no idea what or where it is.
Has anyone else used this part of Plaxis2D before? For more general fortran users out there, does the above compile line look like it expects USRMOD.FOR to call some common subroutines in DFUsrLib.lib??
Thanks for your help and look forward to your answers!
So, I googled.
I think that the authors of the documentation did not have ifort in front of them.
Please try this command:
ifort /winapp /dll USRMOD.FOR /link /implib:DFUsrLib.lib
Or, if you don't really care what the import library is called, simply do this:
ifort /winapp /dll usrmod.for
It will still create usrmod.dll, and call the import library usrmod.lib.
Thanks for googling. It turns out I found some of the common functions in a separate .FOR file and therefore succeeded in compiling the dll. I will keep your response in mind however for cases where I would like to use common functions not listed in the .FOR file I found.
I have a follow up question. Again in their material model manual (slightly under the compile line statements) they are showing the following:
"In all cases USRMOD.DLL file will be created. It can be renamed to 'any' .dll. This file should be p[laced in the udsm folder under the PLAXIS program directory, thereafter it can be used together with the existing PLAXIS calculations program (PLASW.EXE in PLAXIS2D or PLASW3DF.EXE in Plaxis 3D). Once the UD model is used, Plaxis will execute the commands as listed in the USRMOD.DLL file."
I can't help but wonder if there is a way to 'debug' this usrmod.dll using their executables (Plasw.exe or Plasw3df.exe) in Visual Studio? Can this be done?
I know nothing about PLAXIS but in other FEA fortran "USER" code applications it is often very useful to create a simple console main program that calls your user functions with test data. You can then compile this project with debug options and step through the code to see how it is behaving under controlled conditions.