Using for inside section creation

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
Ofsi
Posts: 13
Joined: Sun Jun 19, 2011 3:17 am
Location: Reykjavik University

Using for inside section creation

Post by Ofsi »

Hi, I'm trying to have a for/while loop to specify fiber location when creating fiber section. The loop works but once I try to put it inside the section expression OpenSees crashes (but I see it manages to spit out the for loop in the text area before it shuts down). So it goes something like this

section FiberInt 2 -NStrip 1 $thickness $NS2 $thickness 1 $thickness {

#vertical fibers
for {set i 0} {$i < $nrStrips} {incr i} {
puts "fiber [expr -$length/2.0+$lStrip*(0.5+$i)] 0 $A_c 1; fiber [expr -$length/2.0+$lStrip*(0.5+$i)] 0 $A_s 1001;"
}

#horiz. reinf.

Hfiber 0 0 $totReinforcement 1001;

}

Perchance this is not possible so is there a method I can source in the fibers?
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: Using for inside section creation

Post by vesna »

You do not need puts command in front of fiber command.
Post Reply