Author Topic: How and when will hr(nh2) values move to hr(nh1) values?  (Read 5390 times)

Shilmin

  • Jr. Member
  • **
  • Posts: 40
How and when will hr(nh2) values move to hr(nh1) values?
« on: August 13, 2014, 12:52:22 AM »
Dear All,

In Section 5.6 of Programmer Manual, it mentions "All history variables are associated with the allocation name H which has a pointer value 49. Users are not permitted direct access to the data stored as H (of course, it is possible to access from hr(np(49)) but this should not normally be attempted!). Before calling the element routine for each element, FEAP transfers the required history variable to a local storage for each type. Users may then access the history data for each element and if necessary update values and return them FEAP. Only for specific actions will the local history data be transferred back to the appropriate H locations. ~~~"

So, in each user element, there are arrays located at hr(nh1), hr(nh2) for tn, tn+1, respectively; and the arrays at hr(nh2) are updated if necessary. I assume that, when the 'TIME' command works, the values of arrays at hr(nh2) will move to arrays at hr(nh1). However, will the values of arrays at hr(nh2) directly move to arrays at hr(nh1); or maybe the values of arrays at hr(nh2) will transferred back to the appropriate H locations, and it looks like: hr(nh2) -> H(nh2) -> H(nh1) -> hr(nh1).

Moreover, if I want to access the history variables stored as H in a Macro command, I noticed for element n, I may also get them with the following codes:

                ht1 = np(49) + ix(nen+1,n) + ie(nie-3,ma)
                ht2 = np(49) + ix(nen+2,n) + ie(nie-3,ma)
                do i = 0,ie(nie,ma)-1
                     hr(nh1+i) = hr(ht1+i)
                     hr(nh2+i) = hr(ht2+i)
                end do ! i

Then, I will update the arrays at hr(nh2), but how do I move these values to the H locations, and at next time step, the updated history variables can be transfered to the arrays at hr(nh1)?

In other words, there are two parts of history variables which are associated with the last converged solution time tn and the current solution time tn+1, respectively. if I update the second parts in a Macro command, how do I make sure the first part have the updated data for the next time step?

Thank you!

Best regards!
Shilmin
« Last Edit: August 13, 2014, 05:31:00 PM by Shilmin »

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: How and when will hr(nh2) values move to hr(nh1) values?
« Reply #1 on: August 15, 2014, 03:52:41 PM »
The variables are transferred to the H(*) array after solution steps.  This is controlled by flags.  So, for example, when you only output stress nothing changes, although the constitutive model may update the nh1 array into the nh2 array -- it is not restored to the H(*) array. 

Shilmin

  • Jr. Member
  • **
  • Posts: 40
Re: How and when will hr(nh2) values move to hr(nh1) values?
« Reply #2 on: August 15, 2014, 06:29:02 PM »
Dear Prof. R.L. Taylor,

Thank you very much!

I still want to ask about "The variables are transferred to the H(*) array after solution steps."

There are nh1 array and nh2 array, and nh2 array is usually updated and nh1 array is no changed. However, the nh1 array will get the updated value of nh2 array at the next time step. I assume this transference is not directly  from nh2 array to nh1 array, nh2 array should be transferred to the H(*) corresponding to the nh2 location; then, the variables of this H(nh2) are transferred to the H(*) corresponding to the nh1 location. Next, the nh1 array will get the updated value at the new time step.

In this case, if I build a Macro command, H(*) corresponding to the nh2 location is my responsibility to update, and H(*) corresponding to nh1 location is updated by program.

Thank you again!

Shilmin
« Last Edit: August 15, 2014, 06:31:20 PM by Shilmin »

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: How and when will hr(nh2) values move to hr(nh1) values?
« Reply #3 on: August 27, 2014, 06:59:45 AM »
We suggest you not try to change the H(*) array.  The pointers to where data is stored is contained in the IX(*,*) array and it is delicate to try to move things on your own.  I would suggest you allocate a separate array and you decide when and how to do the updates.