View Full Version : VUMAT precompiled in Windows XP and double precision
Kumar Kurambakurash
2009-05-16, 16:09
Hi Jorgen and all,
I have two questions which are listed below:
1) Can we create a compiled shared library version of our user subroutines
in windows. If so how? The subroutines require (v)aba_param includes as knowns.
2) As also clearly seen from other posts VUMAT is compiled twice by ABAQUS,
one with single precision and one with double. Under these circumstances
I am not allowed to use some built in double precision functions like
"dabs", "dexp", "dsqrt". Can I put a control statement which keeps track
of the precision required, or do you have a suggestion for that.
Thank you in advance for your time,
Kumar
Hi Kumar,
1) Yes, you can create a shared library user-material for Windows. I do this quite frequently, although my approach is non-standard.
I recommend that you check out the following two threads [thread1 (http://polymerfem.com/forums/showthread.php?t=582), thread2 (http://polymerfem.com/forums/showthread.php?t=576)].
In summary:
- I don't use (v)aba_params
- I use Fortran 90 with implicit none
- I manually compile the dll files without calling Abaqus
2) No I unfortunately I don't think you can keep track of that in an easy way. Instead I use compiler flags to set the precision for me.
-Jorgen
Kumar Kurambakurash
2009-05-16, 22:16
Thank you very much, I will check these out and turn back soon.
Best
Kumar
Kumar Kurambakurash
2009-05-17, 12:45
Dear Jorgen,
I have checked the threads that you have sent. They are quite promising for my progress. However it is told that:
"This particular command works for a 64-bit Linux computer running ABAQUS v6.7."
Accordingly I have 2 questions:
1) Is not it possible to compile my own code written in a style without (v)apa_param includes with my compaq Visual Fortran compiler, and use the object files as a substitute for my subroutine. If so there should be a command
in submitting a job which takes into account the object files, god knows where it is.
2) If 1 is not possible, do you know the substitute particular command for yours which works not for 64-bit linux but for windows.
I'll be glad if you put a light on this issue,
Best
Kumar
The problem is that you cannot provide an VUMAT in object file format to Abaqus/Explicit if you want to use double precision, since the simulation uses single precision in the packaging stage and then switches over to double precision.
You can also pre-compile the VUMAT into a dll-file and then just have Abaqus use the dll-file when running the simulation. This is the approach that I use.
I want to emphasis that what most people do is to use (v)aba_param include files and then simply use generic function call such as sqrt(), and not double precision function calls such as dsqrt().
I personally do not want to write Fortran 77 code with implicitly defined variables. I think that is very poor and outdated programming style. I have jumped through a number of hoops in order to enable me to use modern Fortran style and use a single code base base for both single and double precison VUMATs.
You will have to decide what approach will work best for you...
What material models are you working on implementing?
Thanks,
Jorgen
Kumar Kurambakurash
2009-05-18, 07:30
Dear Jorgen,
Thank you for your suggestions.
My problem is a finite strain orthotropic plasticity model
which follows in the line of Papaodopulos and his colleagues.
I have completed the derivations and initially I will test it with VUMAT for the sake of simplicity. Then I will use my VUMAT as a core and expand it to UMAT
with supplying DDSDDE and required transformations and indicial modifications.
Everything in the code is double precision except for the unfortunate built in functions like exp[], sqrt[], etc. I will compile my code as a dll as you have mentioned and try to use it with ABAQUS and see what happens.
Best
Kumar
Kumar Kurambakurash
2009-05-18, 07:35
Dear Jorgen,
I want to add a line for everyone:
Those, who implement their local return mapping algorithms with Newton Raphson method, should supply a Linesearch to enhance the convergence behaviour.
Although its efficiency is disguised in an isotropic hardening plastic model under simple loads, you will see the its advantages for anisotropic media subjected to complex loading paths, where linesearches eliminate and regularize divergence and oscillations.
Best
Kumar
Kumar Kurambakurash
2009-05-18, 09:49
Dear Jorgen,
I have very important outputs on finite precision responses of ABAQUS and I want to share with you. Since I haven't seen a solution of this kind I will include a long explanation which may seem as if an "ABAQUS FOR DUMBS TUTORIAL". Sorry for that at the first place.
Previously you have mentioned that:
"I want to emphasis that what most people do is to use (v)aba_param include files and then simply use generic function call such as sqrt(), and not double precision function calls such as dsqrt()."
So I have the following noteworthy observations:
If we include "vaba_param.inc" and run the routine with DOUBLE PRECISION,
AT FIRST, ABAQUS runs a SINGLE PRECISION TEST is run with including "vaba_param_sp.inc".
This file is formed from the following lines:
implicit real (a-h,o-z)
parameter (j_sys_Dimension = 1)
parameter( n_vec_Length = 136 )
parameter( maxblk = n_vec_Length )
parameter(i_ipm_sta = -6)
character*5 j_ipm_Error
parameter(j_ipm_Error = "Error")
parameter(j_ipm_Aborted = 20)
After this first test, ABAQUS recompiles the subroutine but not with DOUBLE PRECISION according to our wish. Here the "vaba_param_dp.inc" is activated and in this file we have the statements as:
implicit double precision (a-h,o-z)
parameter (j_sys_Dimension = 2)
parameter( n_vec_Length = 136 )
parameter( maxblk = n_vec_Length )
parameter(i_ipm_sta = -6)
character*5 j_ipm_Error
parameter(j_ipm_Error = "Error")
parameter(j_ipm_Aborted = 20)
We see that, the parameter "j_sys_Dimension" changes in these two files, moreover this is a GLOBAL variable thus may be used as a CONTROLLING GLOBAL PARAMETER for the PRECISION of our codes.
This means that we may use certain if statements and call the DOUBLE or SINGLE PRECISION versions of the functions.
Now check this out:
Suppose that one wants to carry out the following operation at an arbitrary place of the subroutine with a DOUBLE PRECISION analysis code. Since he wants to gather DOUBLE PRECISION results
he uses DEXP instead of EXP.
rrr=3.0d0
aaa=dexp(rrr*rrr)
This will NOT PASS the SINGLE PRECISION TEST RUN and give an error of the following kind:
VUMAT.obj : error LNK2001: unresolved external symbol _DEXP@4
Commonly one will justify DOUBLE PRECISION of DEXP and use EXP instead. However the code is no more double precision. Let us understand this:
DEXP(3x3)=8103.08392757539
EXP (3x3)=8103.084
The level of catasthrophy depends on your NUMERICAL TOLERANCE expectations.
So here is the solution that I have created for this problem. It uses PRECISION CONTROLLING IF STATEMENTS which takes into account the PARAMETER passed as "j_sys_Dimension" as follows:
if(j_sys_Dimension.eq.1)then ! i.e. single precision test run
rrr=3.0d0
aaa=exp(rrr*rrr)
write(6,*) "single precision run of the code and exp(3x3) is........:",aaa
else ! i.e. double precision run
ccc=3.0d0
bbb=dexp(ccc*ccc)
write(6,*) "double precision run of the code and exp(3x3) is........:",bbb
endif
The code works without problem, where first portion is activated in the SINGLE PRECISION TEST and the second portion runs with the DOUBLE PRECISION PORTION.
Best
Kumar
Please note that with ABAQUS STANDARD and UMAT abaparam.inc includes a similar variable named "nprecd".
That sounds like a good solution.
I have not seen that approach before.
Thanks for the info,
Jorgen
Dear Jorgen,
I have very important outputs on finite precision responses of ABAQUS and I want to share with you. Since I haven't seen a solution of this kind I will include a long explanation which may seem as if an "ABAQUS FOR DUMBS TUTORIAL". Sorry for that at the first place.
Previously you have mentioned that:
"I want to emphasis that what most people do is to use (v)aba_param include files and then simply use generic function call such as sqrt(), and not double precision function calls such as dsqrt()."
So I have the following noteworthy observations:
If we include "vaba_param.inc" and run the routine with DOUBLE PRECISION,
AT FIRST, ABAQUS runs a SINGLE PRECISION TEST is run with including "vaba_param_sp.inc".
This file is formed from the following lines:
implicit real (a-h,o-z)
parameter (j_sys_Dimension = 1)
parameter( n_vec_Length = 136 )
parameter( maxblk = n_vec_Length )
parameter(i_ipm_sta = -6)
character*5 j_ipm_Error
parameter(j_ipm_Error = "Error")
parameter(j_ipm_Aborted = 20)
After this first test, ABAQUS recompiles the subroutine but not with DOUBLE PRECISION according to our wish. Here the "vaba_param_dp.inc" is activated and in this file we have the statements as:
implicit double precision (a-h,o-z)
parameter (j_sys_Dimension = 2)
parameter( n_vec_Length = 136 )
parameter( maxblk = n_vec_Length )
parameter(i_ipm_sta = -6)
character*5 j_ipm_Error
parameter(j_ipm_Error = "Error")
parameter(j_ipm_Aborted = 20)
We see that, the parameter "j_sys_Dimension" changes in these two files, moreover this is a GLOBAL variable thus may be used as a CONTROLLING GLOBAL PARAMETER for the PRECISION of our codes.
This means that we may use certain if statements and call the DOUBLE or SINGLE PRECISION versions of the functions.
Now check this out:
Suppose that one wants to carry out the following operation at an arbitrary place of the subroutine with a DOUBLE PRECISION analysis code. Since he wants to gather DOUBLE PRECISION results
he uses DEXP instead of EXP.
rrr=3.0d0
aaa=dexp(rrr*rrr)
This will NOT PASS the SINGLE PRECISION TEST RUN and give an error of the following kind:
VUMAT.obj : error LNK2001: unresolved external symbol _DEXP@4
Commonly one will justify DOUBLE PRECISION of DEXP and use EXP instead. However the code is no more double precision. Let us understand this:
DEXP(3x3)=8103.08392757539
EXP (3x3)=8103.084
The level of catasthrophy depends on your NUMERICAL TOLERANCE expectations.
So here is the solution that I have created for this problem. It uses PRECISION CONTROLLING IF STATEMENTS which takes into account the PARAMETER passed as "j_sys_Dimension" as follows:
if(j_sys_Dimension.eq.1)then ! i.e. single precision test run
rrr=3.0d0
aaa=exp(rrr*rrr)
write(6,*) "single precision run of the code and exp(3x3) is........:",aaa
else ! i.e. double precision run
ccc=3.0d0
bbb=dexp(ccc*ccc)
write(6,*) "double precision run of the code and exp(3x3) is........:",bbb
endif
The code works without problem, where first portion is activated in the SINGLE PRECISION TEST and the second portion runs with the DOUBLE PRECISION PORTION.
Best
Kumar
Please note that with ABAQUS STANDARD and UMAT abaparam.inc includes a similar variable named "nprecd".
Hi Kumar,
I want to compile my subroutine into an *.o file and want to get around the "include aba_param.inc". Seemingly one method is to define own parameters. I wanted to keep the "include aba_param.inc" in my subroutine and wanted to get rid of the Error: aba_param.inc not found.
I was wondering if you could give any suggestion on that.
Thanks,
The aba_param.inc file should be found Abaqus without any specific work on your part. If for some reason you want to use your own version of that file, you can find it in the "site" directory in your Abaqus installation directory.
-Jorgen
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.