FEAP User Forum
FEAP => Programming => Topic started by: blackbird on July 30, 2015, 07:30:16 AM
-
Dear FEAP community.
I implemented a userelement for 8 node bricks and now I want to output the nodal stresses and strains. Therefore, at isw=4, I run the following modification of the slcn2d-routine specified in the programmers manual of FEAP8.4 (page 74):
include 'strnum.h' ! istv,iste,istp,istc
integer nen
real*8 sig(3,3),forfkt(nen),detjac
real*8 eps(3,3)
real*8 p(*),s(nen,*)
integer i
do i=1,nen
p(i) = p(i) + forfkt(i)*detjac
s(i,1) = s(i,1) + sig(1,1)*forfkt(i)*detjac
s(i,2) = s(i,2) + sig(2,2)*forfkt(i)*detjac
s(i,3) = s(i,3) + sig(3,3)*forfkt(i)*detjac
s(i,4) = s(i,4) + (sig(1,2)+sig(2,1))*forfkt(i)*detjac
s(i,5) = s(i,5) + (sig(2,3)+sig(3,2))*forfkt(i)*detjac
s(i,6) = s(i,6) + (sig(1,3)+sig(3,1))*forfkt(i)*detjac
s(i,7) = s(i,7) + eps(1,1)*forfkt(i)*detjac
s(i,8) = s(i,8) + eps(2,2)*forfkt(i)*detjac
s(i,9) = s(i,9) + eps(3,3)*forfkt(i)*detjac
s(i,10) = s(i,10) + (eps(1,2)+eps(2,1))*forfkt(i)*detjac
s(i,11) = s(i,11) + (eps(2,3)+eps(3,2))*forfkt(i)*detjac
s(i,12) = s(i,12) + (eps(1,3)+eps(3,1))*forfkt(i)*detjac
enddo
iste=12
In the element, this is done in a loop for each Gauß-point to sum up the information at the nodes. To make sure FEAP enters the isw=4, I insert "stress,node" into the solution commands. Directly after this, I call my usermacro which will get the values out of the array "hr(np(58)+j*numnp+i)" with j=1,12 and i=0,numnp-1. This works fine for my 2D elements, but there are only 6 values to store. Now comes the problem:
After finishing the calculation without any error, there is "Header Field was corrupted" written in the terminal where I executed FEAP. The error wont show up, if I do not access the fields s(i,11) and s(i,12) in the code above. I also tried to set iste=12 in the isw=1 of the userelement but it did not help.
Do you know the reason of and/or a way to solve this problem?
Sincerely, Christian
-
Did you set istv = # projected quantities in isw = 1 in your elmt routine? set as istv = max(istv,nn) where nn = number you want. Look in things like 'shell3d.f' to see how we do it for shells. Hopefully this will fix your problem.
-
Yes, this is the thing I was looking for :) and now it is working fine
Thanks you very much, Prof. Taylor.
-
Dear FEAP community.
I implemented a userelement for 8 node bricks and now I want to output the nodal stresses and strains. Therefore, at isw=4, I run the following modification of the slcn2d-routine specified in the programmers manual of FEAP8.4 (page 74):
include 'strnum.h' ! istv,iste,istp,istc
integer nen
real*8 sig(3,3),forfkt(nen),detjac
real*8 eps(3,3)
real*8 p(*),s(nen,*)
integer i
do i=1,nen
p(i) = p(i) + forfkt(i)*detjac
s(i,1) = s(i,1) + sig(1,1)*forfkt(i)*detjac
s(i,2) = s(i,2) + sig(2,2)*forfkt(i)*detjac
s(i,3) = s(i,3) + sig(3,3)*forfkt(i)*detjac
s(i,4) = s(i,4) + (sig(1,2)+sig(2,1))*forfkt(i)*detjac
s(i,5) = s(i,5) + (sig(2,3)+sig(3,2))*forfkt(i)*detjac
s(i,6) = s(i,6) + (sig(1,3)+sig(3,1))*forfkt(i)*detjac
s(i,7) = s(i,7) + eps(1,1)*forfkt(i)*detjac
s(i,8) = s(i,8) + eps(2,2)*forfkt(i)*detjac
s(i,9) = s(i,9) + eps(3,3)*forfkt(i)*detjac
s(i,10) = s(i,10) + (eps(1,2)+eps(2,1))*forfkt(i)*detjac
s(i,11) = s(i,11) + (eps(2,3)+eps(3,2))*forfkt(i)*detjac
s(i,12) = s(i,12) + (eps(1,3)+eps(3,1))*forfkt(i)*detjac
enddo
iste=12
In the element, this is done in a loop for each Gauß-point to sum up the information at the nodes. To make sure FEAP enters the isw=4, I insert "stress,node" into the solution commands. Directly after this, I call my usermacro which will get the values out of the array "hr(np(58)+j*numnp+i)" with j=1,12 and i=0,numnp-1. This works fine for my 2D elements, but there are only 6 values to store. Now comes the problem:
After finishing the calculation without any error, there is "Header Field was corrupted" written in the terminal where I executed FEAP. The error wont show up, if I do not access the fields s(i,11) and s(i,12) in the code above. I also tried to set iste=12 in the isw=1 of the userelement but it did not help.
Do you know the reason of and/or a way to solve this problem?
Sincerely, Christian
Thanks, for sharing this information....
-
Under isw=1 you should set istv not iste -- that goes with the projected values as you had in the coding -- note projections are done under isw=8