Author Topic: Restart problem with user array hr(up(..))  (Read 7197 times)

tuyet

  • Jr. Member
  • **
  • Posts: 21
Restart problem with user array hr(up(..))
« on: June 03, 2014, 03:35:37 AM »
Dear professor Taylor and Feap Admin,

I have used the user pointer, for example, hr(up(1)).  This array has some specific values at t1. 

Then, I have used RESTART command at t1.  However, hr(up(1)) is automatically assigned zero values at the restart time step.

Could you please show me how to fix this problem?

Thank you very much.

« Last Edit: June 03, 2014, 02:46:37 PM by tuyet »

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1165
Re: Restart problem with user array hr(up(..))
« Reply #1 on: June 03, 2014, 08:25:30 AM »
Have a look at the file program/restrt.f. 
You will need to add a small section to write out the data and read in the data.  If you follow the
examples given it should be an easy change.   Note that you must read data in in the same order
that you write it out.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Restart problem with user array hr(up(..))
« Reply #2 on: June 03, 2014, 12:14:55 PM »
The way the restart works now cannot be used for a user array.  You will probably have to prepare new routines for ralloc and walloc that deal with user functions.  Alternatively, it may be easier for you to write a umacr* that can be used to save your user arrays to a file.  One suggestions is a command: USAVe

Use could be:

    USAVE WRITE nn  (where nn is the pointer number of your user array, i.e., up(nn) )

you need to write the precision, length, and values

    USAVE READ nn

would retrieve the array.

Hacking the restrt.f file may not be a good idea!  It will cause problems at some point where you do not want to have user arrays.

If you get a good implementation please share with the FORUM.

tuyet

  • Jr. Member
  • **
  • Posts: 21
Re: Restart problem with user array hr(up(..))
« Reply #3 on: June 03, 2014, 04:48:27 PM »
Thank you very much for your quick reply.

Herewith is the fortrans file umacr1.f

To save file:

   batch
   ....    ! Solution command
   SAVE
   USAVE WRITE 2
   end

   exit

To restart the problem:
   
   batch
   RESTART
   USAVE READ 2
   end

 

   


FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: Restart problem with user array hr(up(..))
« Reply #4 on: June 03, 2014, 04:56:49 PM »
Before writing into hr(up(2)) you should make sure that it has been allocated to the correct length.

tuyet

  • Jr. Member
  • **
  • Posts: 21
Re: Restart problem with user array hr(up(..))
« Reply #5 on: June 03, 2014, 05:07:13 PM »
Thank you very much for your nice comment.  However, I don't know how can we make sure this.

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: Restart problem with user array hr(up(..))
« Reply #6 on: June 04, 2014, 12:45:39 AM »
Before you start writing to the memory location pointed to by up(1), you need to make sure that it has been allocated using a call to ualloc.
If you have already done this before the USAVE READ, then you are fine; otherwise you need to include the call inside your user macro.

tuyet

  • Jr. Member
  • **
  • Posts: 21
Re: Restart problem with user array hr(up(..))
« Reply #7 on: June 04, 2014, 08:32:41 AM »
Thank you very much.  I had done already in my code.