Author Topic: element number  (Read 3967 times)

Shuai Wang

  • Jr. Member
  • **
  • Posts: 23
element number
« on: March 09, 2015, 08:08:53 AM »
I want to add a random number to the stiffness matrix and residual according to the element number in my user element subroutine.

For example, a mesh have 1000 elements. For each element, I want the stiffness matrix and residual different.  R(element 1)=R(0)+random(element 1)
                               R(element 2)=R(0)+random(element 2)
                                          ...............
I have a function to generalize random number.
There is an array ix(nen) storing global node number for the element.
But I can't find the variable which represent the current element number.
Is there a variable for user element to call the current element number.
Thanks

luc

  • Full Member
  • ***
  • Posts: 53
Re: element number
« Reply #1 on: March 09, 2015, 08:44:12 AM »
The variable that stores the current element is n and it is stored in eldata.h so you have to make sure that you type: include eldata.h in your subroutine.

Shuai Wang

  • Jr. Member
  • **
  • Posts: 23
Re: element number
« Reply #2 on: March 10, 2015, 03:43:00 AM »
Thanks very much, It works!