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!

Obtaining specific results at increments in subroutine 1

Status
Not open for further replies.

yaston4

Mechanical
Jan 9, 2012
130
Dear all,

I am using the UMESHMOTION subroutine, and I would like to use values at specific increments during the analysis. i.e.

U.17, where U.17 is the displacement in the 1-direction at increment 7.

I would really appreciate any input and help on this. Thanks.
 
Replies continue below

Recommended for you

Hi,

To obtain node outputs (like displacement U) in UMESHMOTION subroutine you can use routine GETVRN.
Detail information how to use the routine are in Abaqus documentation:
Abaqus User Subroutines Reference Manual, 2.1.9 Obtaining node point information

UMESHMOTION subrotuine has KSTEP and KINC dummy arguments.
You can test them if You need to get displacement at specific increment.

Regards,
Bartosz
 
This post is very helpful, thanks Bartosz
 
I am trying to find the Displacement value at a specific node, how can I do this using the GETVRN utility in my subroutine (section 2.1.9 Obtaining node point information abaqus manual)?

I have tried using the following code, but does not work

DOUBLE PRECISION U140

If(Kstep.EQ.1) then
CALL GETVRN(NODE,'U',ARRAY,JRCD,JGVBLOCK,LTRN)
NODE=40
open(UNIT=70,FILE='File.dat')
write(70,*) U140
endIf

Where am I going wrong with this?

Thanks.
 
Hi,

1. You defined node id after GETVRN call. In this case Abaqus does not use id 40 but undefined numerical garbage.
2. You did not define “LTRN” variable. It has to be set to 0 or 1 depend in which coordinate system a output should be returned.
3. You never assigned output value to U140 variable.
It is also a good idea to test status after call (JRCD=0 – success, JRCD=1 - error).

Please take a look for followed code:
Code:
      subroutine umeshmotion(uref,ulocal,node,nndof,
     *    lnodetype,alocal,ndim,time,dtime,pnewdt,
     *    kstep,kinc,kmeshsweep,jmatyp,jgvblock,lsmooth)
!
      include 'aba_param.inc'
!
      dimension ulocal(ndim),jelemlist(*)
      dimension alocal(ndim,*),time(2)
      dimension jmatyp(*),jgvblock(*)

      dimension array(15)

!     --------------------------------------------------------------------------
!     user declaration block

      parameter( iU1  = 1,  ! x displacement
     *           iU2  = 2,  ! y displacement
     *           iU3  = 3,  ! z displacement
     *           iUR1 = 4,  ! x rotation
     *           iUR2 = 5,  ! y rotation
     *           iUR3 = 6)  ! z rotation

      parameter(iGlbCoordSys = 0,  ! global coord. system
     *          iLocCoordSys = 1)  ! local coord. system

!     --------------------------------------------------------------------------
!     user statement block

!     set node id
      iNodeId = 40

!     call GETVRN routine
      call getvrn(iNodeId, 'U', array, jrcd, jgvblock, iGlbCoordSys)

!     if success save x-disp for node 40 into rU140 variable
      if (jrcd = 0) then
        rU140 = array(iU1)
      end if

      return
      end

Regards,
Bartosz
 
Thank Bartosz, I am trying to call the U1 value at each increment, and define this to a new variable, this works fine, however, the value in the variable seems to get lost when the analysis moves onto the next increment. Is there any reason for this? Any ideas on how to go about this? Thanks again.
 
Hi,

the value in the variable seems to get lost when the analysis moves onto the next increment
It is normal behavior of FORTRAN language. All local variables inside any subroutine are destroyed after subroutine call. Variable’s value is not save between subroutines calls.
Or in different word, variable “myVar” in one subroutine call is not the same variable as “myVar” in another call.

To save variable you need to define it with save attribute or initialize with data statement.
Code:
        data iMyVar /0/   ! integer variable initialize to 0
        data rMyVar /0.0/ ! real variable initialize to 0.0

!       set save attribute for variables
        save iSaveVar_1,
       *     iSaveVar_2,
       *     rSaveVar

There is quite significant limitation save and data statement must not be use with any subroutine used with multiple CPUS analysis since the same subroutine will be call on different memory in parallel.
But if analysis is run with one domain it works correct.

In many abaqus subroutines you can find state variable array (svars) which can be use to save any user data between subroutine calls.
In this situation Abaqus will take care to pass information from one increment into another. But this is not true for UMESHMOTION subroutine.

You can also use WRITE statement to save data you need and READ statement to get them in next increment.
You can use MODULE to save variables.

But again it is ok for 1 CPU analysis, the same subroutine will fail with more than 1 CPU.

Please take a look for following chapters:
3.5.1 Parallel execution: overview

If you decide to use WRITE, READ statement:
3.7 FORTRAN unit numbers

Regards,
Bartosz
 
Thank-you so very much Bartosz, this really did help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor