FEAP User Forum
FEAP => General questions => Topic started by: bbb on July 28, 2022, 02:03:21 AM
-
Hello:
I am simulating a sine wave propagating in an elastic medium. I would like to save the values of the generated stress but only for one period of time, not all the time. How should I modify the following statement to include only one period T? I mean from time t1 to time t2, being t2= t1 + T
BATCH
DT,,dt
TRANs,newm
MASS
LOOP,,nt
TIME
LOOP,iter,1
UTAN,,1
NEXT,iter
stre,node,1,1268 ! Here, I am saving all the stress for all time. I want to modify this.
NEXT
END
Thank you so much,
Beatriz
-
You can use an if-else-endi command and parameters for t, dt, t1 and t2
param t=t+dt
if t1-t ! No spaces in expression
else t2-t
stre node ....
endif
Thus if t < t1 no prints and if t > t2 no prints
-
Your other option is to use more loops and only put the output lines in the loop where you want the values, so something like:
BATCH
DT,,dt
TRANs,newm
MASS
LOOP,,n1 ! Loop n1, where dt*n1 = t1
TIME
LOOP,iter,1
UTAN,,1
NEXT,iter
NEXT
LOOP,,n2 ! Loop n2, where dt*n2 = T
TIME
LOOP,iter,1
UTAN,,1
NEXT,iter
stre,node,1,1268
NEXT
LOOP,,n3 ! Loop n3 to finish
TIME
LOOP,iter,1
UTAN,,1
NEXT,iter
NEXT
END
The if-else-endif method is cleaner; this is just another option.
-
Dear Prof. S. Govindjee and Prof. R. Taylor,
Thank you so much for your replies. It works!
Beatriz