Author Topic: Extracting history variable in user macro  (Read 3707 times)

anshulfy

  • Full Member
  • ***
  • Posts: 63
Extracting history variable in user macro
« on: December 22, 2016, 12:32:16 PM »
Dear all,

In user element I have defined NH3=1. I store some value x as hr(NH3)=x in element subroutine.
Now I want to extract these values in a user macro. I was trying to understand it from the user macro by Prof. Govindjee for paraview output file. According to that I am doing it in the following manner, but not getting correct values. Am I doing it wrong?
Code: [Select]
do ii=0,numel-1
    y(ii+1) = hr(nh3)
end do


regards,
Anshul Faye

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Extracting history variable in user macro
« Reply #1 on: December 22, 2016, 02:35:25 PM »
You should look at the subroutine ./program/pform.f to see that when you put something into hr(nh3) it does not always get saved.  It will when isw=3 or 6 but not otherwise probably.  However, if you do it in an element then it gets moved into another array (follow in pform.f).  We manage to extract these values into hr(nh3) and you will also have to do something similar to get the value in a umacr routine.  They are probably in the hr(np(49)) array so you can use SHOW DICT  to make sure the pointer np(49) has allocated values; and then SHOW H which is the array you want to see if any values are there (do this in interactive mode is easiest)

anshulfy

  • Full Member
  • ***
  • Posts: 63
Re: Extracting history variable in user macro
« Reply #2 on: December 23, 2016, 01:12:58 AM »
Thanks Prof. Taylor. That helped a lot.