Author Topic: User element cannot find correct history variable for each element  (Read 6745 times)

ws18

  • Jr. Member
  • **
  • Posts: 46
Dear all,

I used the history variables to save the internal variable (i.e. alpha) in the current iteration and update it in the next iteration. According to the pmanual, FEAP should be able to find the correct history for each element. However, my user element fails to do this. I mesh the structure with 8 elements and I write the value of alpha to the screen (before update---alpha1 and after update---alpha2). I found that instead of having independent variable updating for each element, the element (i+1) just takes the value of the element (i). The figure of alpha value is attached. The figure shows that alpha1 of a certain element just takes the value of alpha2 of the last element rather than start from its own initial value(0). 

I put nh1, nh2 at isw =1 and I didn't make any change on the program files.

Regards,
Wenya

Yaakov

  • Sr. Member
  • ****
  • Posts: 323
Re: User element cannot find correct history variable for each element
« Reply #1 on: May 13, 2017, 06:20:43 PM »
Hi,

we should save historty value in the convergence iteration, not every iteration. there are some similar questions in FEAP Forum.

e.g.http://feap.berkeley.edu/forum/index.php?topic=1432.msg5156#msg5156

Kind Regards,
Yaakov
Let's boost FEAP's performance!

ws18

  • Jr. Member
  • **
  • Posts: 46
Re: User element cannot find correct history variable for each element
« Reply #2 on: May 14, 2017, 09:31:15 AM »
Thanks for your reply. I will try to understand. 

Wenya

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: User element cannot find correct history variable for each element
« Reply #3 on: May 14, 2017, 04:04:07 PM »
The "nh1" values of history variables belong to a previously converged solution at, say, t_n

The "nh2" values are associated with the current solution time, say, t_n+1

If you are solving a problem you should have an algorithm that includes

         LOOP,,nt (where nt is a number of time steps you want to do -- when debugging a new element this is 1 or 2 probably)
             TIME   (this command say to start a new time step

             LOOP,newton,nits (where nits is the number of Newton iterations maximum you expect)
                 TANG,,1 (or UTAN,,1 if unsymmetric tangent)

             NEXT newton

         NEXT time

Generally this sequence is given interactively so one can monitor what is happening.

In your element you seemingly never input material properties  (these would be in ISW.eq.1).  This seems strange and means no values are set in the "d(*)" array.   Also, if you want to initialize any of the history variable to non-zero values you need to do it in ISW.eq.14 (you can set both the nh1 and nh2 values and feap will get the correct starting values -- if zero you do not need to do this)

To debug, I would always start with 2 elements and to a simple tension test (membrane state on your solid shell) to first make sure nothing is singular and the element converges.  This is adequate to make sure each element gets values.  There is one danger that both stresses get the same values, you could give different thicknesses maybe.  But get it to work.  Then do bending for the same.
Finally do something that adds variable stresses.

ws18

  • Jr. Member
  • **
  • Posts: 46
Re: User element cannot find correct history variable for each element
« Reply #4 on: May 14, 2017, 05:45:17 PM »
Dear Prof. Taylor,

Thanks a lot for your kind reply and suggestions.

The material subrountine inmate.f was called in the main routine (elmt49.f). I finished the solid-shell element included the natural assumed strain(NAS) method and the element works well. The problem happens only when I try to introduce the enhanced assumed strain(EAS) method. The number of EAS parameters (alpha) is seven. To my understanding, I should update those parameters at the element level, get the enhanced strain and condense stiffness matrix  in every iteration (not every time step).

If I want to do the iteration update, I cannot use 'nh1' and 'nh2'. Is this understanding correct? I also tried nh3, it still get the same mistake. Can you please tell me other methods I can use to finish this?

Thanks for your time.
 
Best wishes,
Wenya

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: User element cannot find correct history variable for each element
« Reply #5 on: May 15, 2017, 08:08:32 AM »
One can use 'nh1' and 'nh2' to do iteration updates.  The information in hr(nh1+...) stores values from the previous iteration; the
values in hr(nh2_...) stores the information from the last iteration in the current solution time value.  When the command 'TIME' is used the values inf hr(nh2+...) = hr(nh1+...) which are then the values for the first iteration.  If any values are non-zero when you start the solution (for example some plastic algorithms require a matrix G(3,3) to be the identity) they can be set when isw.eq.14 in your element.   From what I observe you are keeping track of where each of your history variable types are by  using offsets to nh1 and nh2.   Be careful because these values are integer*8 values on many machines and we usually only store integers as integer*4 for other uses.  This is the reason for the integer4 and integer8 include options.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: User element cannot find correct history variable for each element
« Reply #6 on: May 15, 2017, 08:12:32 AM »
One other thing about initialization of the hr(nh1   and hr(nh2 variables:  Generally, I initialize both to the same value so that any solution used always has initial values -- for example if you started without a TIME command the values would be right for both the nh1 and nh2 parts.  Whereas if you started with at TIME command and only initialized hr(nh1  it would get destroyed by the time update.