Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of *Parameter card and subroutines 1

Status
Not open for further replies.

barlume

Aerospace
Jun 10, 2015
15
I am still playing with subroutines in Abaqus 6.13 and I was trying to obtain the most from them.

I am using the *Parameter card to obtain a standard code which can be used for different studies, just changing the parameters at the beginning.
My problem is that these parameters are not passed in the subroutine, as far as I have seen.

Here you are my example:

Code:
*PARAMETER
TIME_LOAD = 0.04
N = 2.
h = 0.1

Code:
 do 100 k = 1, nblock
		X = coordMp(k,1)
		Y = coordMp(k,2)
		Z = coordMp(k,3)
c
        FIELD(k,1) = Z
		stateNew(k,1)= Z
		stateNew(k,2)=(Z+h)**N

My SDV_2 is always equal to 0 and when I print h or N, they are equal to 0.

What can I do in order to add them?
Do I have to redefine them in the subroutine in this way:

Code:
parameter(N=2.d0, h=0.1d0, TIME_LOAD=0.04d0)
?

Is there another method?
I defined many different parameters and I would prefer to avoid to repeat them.

Thank you very much
 
Replies continue below

Recommended for you

Parameters do not interact with subroutine. These are two completely separate things.

 
I know I can use Python for writing some scripts and do parametric analyses and the fortran subroutines have a different scope.

However, I would like to change the declaration vusdfld() at the beginning of the code to say I am adding also parameters from the INP file.

Or add some lines in the subroutine to recall the parameters I have already calculated in my INP file.

Is it possible?
In this way I would be able to have much more possibilities in my work (parametric analyses with subroutines).
 
You could run a script that manipulates the .inp and the subroutine code prior submitting the analysis.

But without knowing the overall thing you try to do, it is hard to recommend something.
 
Hi,

To pass any value from inputdeck to VUSDFLD subroutine you can use PROPERTIES option and props array.

Code:
**
*PARAMETER
myPar1 = 1.0 # 1st parameter value
myPar2 = 2.0 # 2nd parameter value
myPar3 = 3.0 # 3rd parameter value
**
*MATERIAL, NAME=myMaterial
*USER DEFINED FIELD, PROPERTIES=3
** props(1),  props(2),  props(3)
   <myPar1>,  <myPar2>,  <myPar3>
**

Code:
subroutine VUSDFLD ( ... )

! get values from inputdeck
rMyInpVal1 = props(1) ! here I got value of 1.0
rMyInpVal2 = props(2) ! here I got value of 2.0
rMyInpVal3 = props(3) ! here I got value of 3.0

end subroutine

Remember to have always enough PROPERTIES size to pass all values you need.

Code:
**
*PARAMETER
myPar1 = 1.0 # 1st parameter value
myPar2 = 2.0 # 2nd parameter value
myPar3 = 3.0 # 3rd parameter value
**
*MATERIAL, NAME=myMaterial
*USER DEFINED FIELD, PROPERTIES=2
** props(1),  props(2),  props(3)
   <myPar1>,  <myPar2>,  <myPar3>
**

Code:
subroutine VUSDFLD ( ... )

! get values from inputdeck
rMyInpVal1 = props(1) ! here I got value of 1.0
rMyInpVal2 = props(2) ! here I got value of 2.0
rMyInpVal3 = props(3) ! here I will get numerical garbage since PROPERTIES is set to 2 !!!

end subroutine

Since props array is declared as real all values from inputdeck will be real as well.

Regards,
Bartosz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor