Author Topic: Updating values  (Read 4977 times)

user2705

  • Jr. Member
  • **
  • Posts: 36
Updating values
« on: December 19, 2016, 10:37:48 AM »
Dear Feap users,

I am programming an user element in which values of material parameters are randomly distributed for each element. So for each element, using random generator, I get different values (isw=3,6). Problem is the one of the parameters has to change its value, and I can't figure out how to memorize this change in order to use the new value. I have tried in isw=14, using nh3 variable. But the problem is then my values of parameters will not be assigned randomly for each element. In other words, every element will get the same values of parameters beacuse I have linked my seed with element number.

Thanks in advance!



Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1165
Re: Updating values
« Reply #1 on: December 19, 2016, 10:45:21 AM »
Using element history variables should be fine (nh3).   Set your seed under isw.eq.1 (this will give you one seed for all elements).  Then under isw.eq.14 generate random numbers (per element) and store in hr(nh3).

user2705

  • Jr. Member
  • **
  • Posts: 36
Re: Updating values
« Reply #2 on: December 19, 2016, 10:58:02 AM »
Dear Professor,

Does this mean that I will have (number of elements x number of parameters) nh3 history variables? Beacuse I want to have only (number of parameters) nh3 history variables.

Thanks in advance!

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1165
Re: Updating values
« Reply #3 on: December 19, 2016, 11:15:42 AM »
It all depends on what you want to have.   You get to decide.  What probably makes the most sense is to first pick a random seed using for example the date-time-stamp.  Then generate a set of random material parameters per element (once and for all) that you store in hr(nh3).  This would mean (parameters per element) x (number of elements).  If you are worried about the storage, then you could devise a scheme that resets the seed to a fixed value at the start of each iteration and then re-generate everything each iteration.  It is entirely up to you.  In this second case there is no need to use nh3.

user2705

  • Jr. Member
  • **
  • Posts: 36
Re: Updating values
« Reply #4 on: December 19, 2016, 11:33:22 AM »
Dear Professor,

Since I will have a lot of elements, I don't want to store all values. And also, I don't want my values to change during every iteration, but to stay the same. I want to link random generator with element number, so that for every element number I get parameter values for that element which will  remain the same throughout the calculation (this is why I did it in isw=3,6), except that one change in value of one parameter which I can't figure out how to make feap memorize it.

Thanks in advance!
« Last Edit: December 19, 2016, 11:50:07 AM by user2705 »

user2705

  • Jr. Member
  • **
  • Posts: 36
Re: Updating values
« Reply #5 on: December 20, 2016, 05:31:08 AM »
Dear Professor,

I have listened to your advice. Problem is now solved.

Thank You very much for kind help.