WARNING BandGenLinLapackSolver::solve() -LAPACK routine retu

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

Moderators: silvia, selimgunay, Moderators

wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

WARNING BandGenLinLapackSolver::solve() -LAPACK routine retu

Post by wdylut »

dear all
when i run my script showed below ,i met such warnings:

WARNING BandGenLinLapackSolver::solve() -LAPACK routine returned 1
WARNING BandGenLinLapackSolver::solve() -LAPACK routine returned 1
WARNING BandGenLinLapackSolver::solve() -LAPACK routine returned 1
i hope somebody can help me solve it.


# SET UP ----------------------------------------------------------------------------
wipe; # clear opensees model
model basic -ndm 2 -ndf 3; # 2 dimensions, 3 dof per node
set dataDir Data; # set up name of data directory (can remove this)
file mkdir $dataDir; # create data directory
set GMdir "../GMfiles/"; # ground-motion file directory
source LibUnits.tcl; # define units
source DisplayPlane.tcl; # procedure for displaying a plane in model
source DisplayModel2D.tcl; # procedure for displaying 2D perspective of model # create data directory

# parameter-----------------------------------------------------------------------------
set Pi [expr 2.0*asin(1.0)];
set g 9.8;
set Lcol 3.0;
set Hcol 0.65;
set Bcol $Hcol;
set rhocol 2500;
set Ecol 3.0e+10;
set Pa 12e+6;

set hb 0.164;
set Disoex 0.5;
set Disoin 0.1;
set tr 0.0925;
set Ec 1.141244619e+9;
set tol 1.0e-10;
set k1 7812e+3;
set Fyo 65.4e+3;
set k2o 1202e+3;

set Acol [expr $Hcol*$Bcol];
set Icol [expr 1./12*$Bcol*pow($Hcol,3)];
set mcol [expr $Acol*$Lcol*$rhocol];

set Aiso [expr $Pi*1./4*(pow($Disoex,2)-pow($Disoin,2))];
set Iiso [expr $Pi/64*(pow($Disoex,4)-pow($Disoin,4))];
set kvo [expr $Ec*$Aiso/$tr];
set EIs [expr 1./3*$Ec*$Iiso*$hb/$tr];
set PE [expr pow($Pi,2)/pow($hb,2)*$EIs]; #

set P [expr $Pa*$Aiso];
set mt [expr $P/$g];

# define GEOMETRY -------------------------------------------------------------
# nodal coordinates:
node 1 0 0; # node#, X Y
node 2 0 $Lcol;
node 3 0 $Lcol;

# Single point constraints -- Boundary Conditions
fix 1 1 1 1; # node DX DY RZ
fix 2 0 0 1;
fix 3 0 0 1;
# nodal masses:
mass 2 $mcol [expr $Usmall*$N/$g] [expr $Usmall*$N/$g]; # # node#, Mx My Mz,
mass 3 $mt [expr $Usmall*$N/$g] [expr $Usmall*$N/$g];

# Define Section -------------------------------------------------------------
section Iso2spring 1 $tol $k1 $Fyo $k2o $kvo $hb $PE; # $Po # section Iso2spring $matTag $tol $k1 $Fyo $k2o $kvo $hb $PE $Po

# Define ELEMENTS -------------------------------------------------------------
# define geometric transformation: performs a linear geometric transformation of beam stiffness and resisting force from the basic system to the global-coordinate system
geomTransf Linear 1; # associate a tag to transformation

# connectivity:
element elasticBeamColumn 1 1 2 $Acol $Ecol $Icol 1; # element elasticBeamColumn $eleTag $iNode $jNode $A $E $Iz $transfTag
element zeroLengthSection 2 2 3 1; #element zeroLengthSection $eleTag $iNode $jNode $secTag
# Define RECORDERS -------------------------------------------------------------
recorder Node -file $dataDir/isolater_cantilever_Push_Dtop.out -time -node 3 -dof 1 2 3 disp; # displacements of free nodes
recorder Node -file $dataDir/isolater_cantilever_Push_Dtopcol.out -time -node 2 -dof 1 2 3 disp; # displacements of support nodes
recorder Node -file $dataDir/isolater_cantilever_Push_DBase.out -time -node 1 -dof 1 2 3 disp; # displacements of support nodes
recorder Node -file $dataDir/isolater_cantilever_Push_RBase.out -time -node 1 -dof 1 2 3 reaction; # support reaction
recorder Drift -file $dataDir/isolater_cantilever_Push_Drift.out -time -iNode 1 -jNode 2 -dof 1 -perpDirn 2 ; # lateral drift
recorder Element -file $dataDir/isolater_cantilever_Push_FCol.out -time -ele 1 globalForce; # element forces -- column
recorder Element -file $dataDir/isolater_cantilever_Push_DCol.out -time -ele 1 deformation; # element deformations -- column
recorder Element -file $dataDir/isolater_cantilever_Push_Fiso.out -time -ele 2 globalForce; # element forces -- column
recorder Element -file $dataDir/isolater_cantilever_Push_Diso.out -time -ele 2 deformation; # element deformations -- column

# define GRAVITY -------------------------------------------------------------
pattern Plain 1 Linear {
load 3 0. [expr -$P] 0.; # node#, FX FY MZ -- superstructure-weight
load 2 0. [expr -$mcol*$g] 0.; # node#, FX FY MZ -- superstructure-weight
}
DisplayModel2D ModeShape;#options: ModeShape , NodeNumbers , DeformedShape

constraints Plain; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral; # how to store and solve the system of equations in the analysis
test NormDispIncr 1.0e-8 6 ; # determine if convergence has been achieved at the end of an iteration step
algorithm Newton; # use Newton's solution algorithm: updates tangent stiffness at every iteration
integrator LoadControl 0.1; # determine the next time step for an analysis, # apply gravity in 10 steps
analysis Static # define type of analysis static or transient
analyze 10; # perform gravity analysis
loadConst -time 0.0; # hold gravity constant and restart time
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by vesna »

Did your analysis go through?
wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by wdylut »

thank you ,i have solved the problem,but i met another problem,when i run my script ,the period is very long ,about 1.0e+7sec,i could not find the solution,hope you can help me ,
# --------------------------------------------------------------------------------------------------
# 2D RC Frame-left
# wdy, 07/02/2012
# nonlinearBeamColumn element, inelastic fiber section
#

# SET UP ----------------------------------------------------------------------------
wipe; # clear memory of all past model definitions
model BasicBuilder -ndm 2 -ndf 3; # Define the model builder, ndm=#dimension, ndf=#dofs
#set EarNo 1;
#set Xframe 1;
set dataDir Data$EarNo$Xframe; # set up name of data directory (can remove this)
file mkdir $dataDir; # create data directory
set GMdir "../GMfiles/"; # ground-motion file directory
source LibUnits.tcl; # define units
source DisplayPlane.tcl; # procedure for displaying a plane in model
source DisplayModel2D.tcl; # procedure for displaying 2D perspective of model
source BuildRCrectSection.tcl; # procedure for definining RC fiber section


# define GEOMETRY -------------------------------------------------------------
# define structure-geometry paramters
set LCol [expr 3300*$mm]; # column height
set LBeam [expr 6600*$mm]; # beam length
set NStory 6; # number of stories above ground level -------------- you can change this.
set NBay 7; # number of bays (max 9) ------------------------------you can change this.

# define NODAL COORDINATES
for {set level 1} {$level <=[expr $NStory+1]} {incr level 1} {
set Y [expr ($level-1)*$LCol];
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set X [expr ($pier-1)*$LBeam];
set nodeID [expr $level*10+$pier]
node $nodeID $X $Y; # actually define node
}
}
for {set level 1} {$level <=1} {incr level 1} {
set Y [expr ($level-1)*$LCol];
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set X [expr ($pier-1)*$LBeam];
set nodeID [expr 20000+$level*10+$pier]
node $nodeID $X $Y; # actually define node
}
}
# determine support nodes where ground motions are input, for multiple-support excitation
set iSupportNode ""
set level 1
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set nodeID [expr $level*10+$pier]
lappend iSupportNode $nodeID
}


# BOUNDARY CONDITIONS
#fix 1 1 1; # fix all Y=0.0 nodes
for {set level 1} {$level <=1} {incr level 1} {
#set Y [expr ($level-1)*$LCol];
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
#set X [expr ($pier-1)*$LBeam];
set nodeID [expr 20000+$level*10+$pier]
fix $nodeID 1 1 1;# -mass [expr 1180*$kN/$g] 0 0;
}
}
for {set level 1} {$level <=1} {incr level 1} {
#set Y [expr ($level-1)*$LCol];
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
#set X [expr ($pier-1)*$LBeam];
set nodeID [expr $level*10+$pier]
fix $nodeID 0 0 1;# -mass [expr 1180*$kN/$g] 0 0;
}
}
# calculated MODEL PARAMETERS, particular to this model
puts "Number of Stories: $NStory Number of bays: $NBay"
# Set up parameters that are particular to the model for displacement control
set IDctrlNode [expr ($NStory+1)*10+1]; # node where displacement is read for displacement control
set IDctrlDOF 1; # degree of freedom of displacement read for displacement control
set LBuilding [expr $NStory*$LCol]; # total building height

# Define SECTIONS -------------------------------------------------------------
set SectionType FiberSection; # options: Elastic FiberSection,有两种截面类型可供选择,分别为弹性和纤维截面模型
set IDColTransf 1; # all columns
set IDBeamTransf 2; # all beams
set ColTransfType PDelta ; # options, Linear PDelta Corotational
geomTransf $ColTransfType $IDColTransf ; # only columns can have PDelta effects (gravity effects)
geomTransf Linear $IDBeamTransf

#define section tags:
set ColSecTag 1
set BeamSecTag 2
# define MATERIAL properties of rubber----------------------------------------
set tol 1.0e-10
# Parameters computed from the assumed ones
#set Tb [expr 2e+0*$sec]
#set PPcr 0.0001
#set PPo 0.25
#set M [expr 1180*$kN/$g]
#set S 20.0
#set uy [expr 10.*$mm]
#set mu 0.1
#set wb [expr 2*$PI/$Tb]
#set k2o [expr pow($wb,2)*$M]
#set Fyo [expr $mu*$M*$g+$k2o*$uy]
#
##set Fyo [expr 90.4*$kN]
#
#set k1 [expr $Fyo/$uy]
#
#set kvo [expr 6.*$S*$S*$k2o]
#set Pcr [expr $M*$g/$PPcr]
#set Pe [expr 50.*$Pcr]
#set Ps [expr 1./50.*$Pcr]
#set Po [expr $M*$g/$PPo]
#set hb [expr $Ps/$k2o]

# Create Iso2spring section
set k1 [expr 9262*$kN/$m]
set Fyo [expr 90.4*$kN]
set k2o [expr 926*$kN/$m]
set kvo [expr 2132*$kN/$mm]
set hb [expr 208*$mm]
set Pe [expr 1.6e+8*$N]
section Iso2spring 881 $tol $k1 $Fyo $k2o $kvo $hb $Pe;# $Po;

# id ndI ndJ mattag

#element zeroLengthSection 1 1 2 1

# define geometric transformation: performs a linear geometric transformation of beam stiffness and resisting force from the basic system to the global-coordinate system
#geomTransf Linear 1; # associate a tag to transformation
#
##element elasticBeamColumn 1 1 2 $Aiso $Ecol $Icol 1; # element elasticBeamColumn $eleTag $iNode $jNode $A $E $Iz $transfTag
#element nonlinearBeamColumn 1 1 2 5 $isoSecTag 1;
#element nonlinearBeamColumn 2 2 3 5 $isoSecTag 1;


# id ndI ndJ mattag

#element zeroLengthSection 1 1 2 1
#=======================================================================
#建立隔震层
for {set level 1} {$level <=1} {incr level 1} {
#set Y [expr ($level-1)*$LCol];
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set jNode [expr $level*10+$pier]
set iNode [expr 20000+$level*10+$pier]
set eleTag [expr 50000+$level*10+$pier]
element zeroLengthSection $eleTag $iNode $jNode 881;
#element nonlinearBeamColumn $eleTag $iNode $jNode 5 $isoSecTag $IDColTransf;
}
}
#定义隔震垫单元
#element zeroLength $eleTag $iNode $jNode -mat $matTag1 $matTag2 ... -dir $dir1 $dir2 ...
# Section Properties:
#柱截面
set HCol [expr 550*$mm]; # square-Column width
set BCol $HCol;
#梁截面
set HBeam [expr 550*$mm]; # Beam depth -- perpendicular to bending axis
set BBeam [expr 300*$mm]; # Beam width -- parallel to bending axis

if {$SectionType == "Elastic"} {;#弹性截面
# material properties:
set fc [expr 14.3*$MPa]; # concrete nominal compressive strength
set Ec [expr 30000.0*$MPa]; # concrete Young's Modulus
# column section properties:
set AgCol [expr $HCol*$BCol]; # rectuangular-Column cross-sectional area
set IzCol [expr 0.5*1./12*$BCol*pow($HCol,3)]; # about-local-z Rect-Column gross moment of inertial
# beam sections:
set AgBeam [expr $HBeam*$BBeam]; # rectuangular-Beam cross-sectional area
set IzBeam [expr 0.5*1./12*$BBeam*pow($HBeam,3)]; # about-local-z Rect-Beam cracked moment of inertial

section Elastic $ColSecTag $Ec $AgCol $IzCol
section Elastic $BeamSecTag $Ec $AgBeam $IzBeam

} elseif {$SectionType == "FiberSection"} {;#纤维截面
# MATERIAL parameters
source LibMaterialsRC.tcl; # define library of Reinforced-concrete Materials

# FIBER SECTION properties
# Column section geometry:
set cover [expr 35*$mm]; # rectangular-RC-Column cover
set nfCoreY 20; # number of fibers in the core patch in the y direction
set nfCoreZ 20; # number of fibers in the core patch in the z direction
set nfCoverY 20; # number of fibers in the cover patches with long sides in the y direction
set nfCoverZ 20; # number of fibers in the cover patches with long sides in the z direction
# rectangular section with one layer of steel evenly distributed around the perimeter and a confined core.
#定义柱子截面,分为三种类型,边柱(KZ1)、内柱(KZ2)和中柱(KZ3)
set ColSecTagB1 1;#1层的边柱配筋
set numBarsTopCol 5; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 5; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaBotCol [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaIntCol [expr 380.*$mm*$mm]; # longitudinal-reinforcement bar area,22mm
BuildRCrectSection $ColSecTagB1 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagB23 2;#2,3层的边柱配筋
set numBarsTopCol 5; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 5; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
BuildRCrectSection $ColSecTagB23 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagB45 3;#4,5层的边柱配筋
set numBarsTopCol 5; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 5; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaBotCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
BuildRCrectSection $ColSecTagB45 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagB6 4;#6层的边柱配筋
set numBarsTopCol 5; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 5; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
BuildRCrectSection $ColSecTagB6 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagN1 5;#1层的内柱配筋
set numBarsTopCol 5; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 5; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 8; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
BuildRCrectSection $ColSecTagN1 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagN23 6;#2,3层的内柱配筋
set numBarsTopCol 4; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 4; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,16mm
BuildRCrectSection $ColSecTagN23 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagN45 7;#4,5层的内柱配筋
set numBarsTopCol 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
BuildRCrectSection $ColSecTagN45 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagN6 8;#6层的内柱配筋
set numBarsTopCol 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 201.*$mm*$mm]; # longitudinal-reinforcement bar area,22mm
BuildRCrectSection $ColSecTagN6 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagZ1 9;#1层的中柱配筋
set numBarsTopCol 5; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 5; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
BuildRCrectSection $ColSecTagZ1 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagZ23 10;#2,3层的中柱配筋
set numBarsTopCol 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,14mm
BuildRCrectSection $ColSecTagZ23 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagZ45 11;#4,5层的中柱配筋
set numBarsTopCol 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 6; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,16mm
BuildRCrectSection $ColSecTagZ45 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set ColSecTagZ6 12;#6层的中柱配筋
set numBarsTopCol 4; # number of longitudinal-reinforcement bars on top layer
set numBarsBotCol 4; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntCol 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotCol [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntCol [expr 201.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
BuildRCrectSection $ColSecTagZ6 $HCol $BCol $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopCol $barAreaTopCol $numBarsBotCol $barAreaBotCol $numBarsIntCol $barAreaIntCol $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ

#定义梁截面,分为两种类型,边梁和中梁
set BeamSecTagB12 13;#1,2层边梁配筋
set numBarsTopBeam 2; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 2; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaBotBeam [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaIntBeam [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
BuildRCrectSection $BeamSecTagB12 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagB3 14;#3层边梁配筋
set numBarsTopBeam 2; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 2; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 380.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaBotBeam [expr 380.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaIntBeam [expr 380.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
BuildRCrectSection $BeamSecTagB3 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagB4 15;#4层边梁配筋
set numBarsTopBeam 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaBotBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaIntBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagB4 $HBeam $BBeam $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagB5 16;#5层边梁配筋
set numBarsTopBeam 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 3; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaBotBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagB5 $HBeam $BBeam $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagB6 17;#6层边梁配筋
set numBarsTopBeam 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 3; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 201.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotBeam [expr 201.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaIntBeam [expr 201.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagB6 $HBeam $BBeam $cover $cover $IDconcCore $IDconcCover $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagZ12 18;#1,2层中梁配筋
set numBarsTopBeam 2; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 2; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaBotBeam [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaIntBeam [expr 491.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagZ12 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagZ3 19;#3层中梁配筋
set numBarsTopBeam 2; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 2; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,25mm
set barAreaBotBeam [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaIntBeam [expr 254.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagZ3 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagZ4 20;#4层中梁配筋
set numBarsTopBeam 2; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 2; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 4; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,22mm
set barAreaBotBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaIntBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagZ4 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagZ5 21;#5层中梁配筋
set numBarsTopBeam 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 3; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,16mm
set barAreaBotBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,16mm
set barAreaIntBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagZ5 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ
set BeamSecTagZ6 22;#6层中梁配筋
set numBarsTopBeam 3; # number of longitudinal-reinforcement bars on top layer
set numBarsBotBeam 3; # number of longitudinal-reinforcement bars on bottom layer
set numBarsIntBeam 3; # TOTAL number of reinforcing bars on the intermediate layers
set barAreaTopBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,20mm
set barAreaBotBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,18mm
set barAreaIntBeam [expr 314.*$mm*$mm]; # longitudinal-reinforcement bar area,12mm
BuildRCrectSection $BeamSecTagZ6 $HBeam $BBeam $cover $cover $IDconcCore35 $IDconcCover35 $IDSteel $numBarsTopBeam $barAreaTopBeam $numBarsBotBeam $barAreaBotBeam $numBarsIntBeam $barAreaIntBeam $nfCoreY $nfCoreZ $nfCoverY $nfCoverZ

} else {
puts "No section has been defined"
return -1
}


# define ELEMENTS
# set up geometric transformations of element
# separate columns and beams, in case of P-Delta analysis for columns

# Define Beam-Column Elements
set np 5; # number of Gauss integration points for nonlinear curvature distribution-- np=2 for linear distribution ok
# columns
set N0col 100; # column element numbers
set level 0
for {set level 1} {$level <=$NStory} {incr level 1} {
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
if {($pier==1)||($pier==[expr $NBay+1])&&($level==1)} {
set elemID [expr $N0col + $level*10 +$pier]
set nodeI [expr $level*10 + $pier]
set nodeJ [expr ($level+1)*10 + $pier]
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagB1 $IDColTransf;#1层边柱配筋
} elseif {(($pier==1)||($pier==[expr $NBay+1]))&&($level==2)||($level==3)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagB23 $IDColTransf;#2,3层边柱配筋
} elseif {(($pier==1)||($pier==[expr $NBay+1]))&&($level==4)||($level==5)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagB45 $IDColTransf;#4,5层边柱配筋
} elseif {(($pier==1)||($pier==[expr $NBay+1]))&&($level==6)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagB6 $IDColTransf;#6层边柱配筋
} elseif {(($pier==[expr ($NBay+1)/2+1])||($pier==[expr ($NBay+1)/2]))&&($level==1)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagN1 $IDColTransf;#1层内柱配筋
} elseif {(($pier==[expr ($NBay+1)/2+1])||($pier==[expr ($NBay+1)/2]))&&($level==2)||($level==3)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagN23 $IDColTransf;#2,3层内柱配筋
} elseif {(($pier==[expr ($NBay+1)/2+1])||($pier==[expr ($NBay+1)/2]))&&($level==4)||($level==5)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagN45 $IDColTransf;#4,5层内柱配筋
} elseif {(($pier==[expr ($NBay+1)/2+1])||($pier==[expr ($NBay+1)/2]))&&($level==6)} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagN6 $IDColTransf;#6层内柱配筋
} elseif {$level==1} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagZ1 $IDColTransf;#1层中柱配筋
} elseif {$level==2||$level==3} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagZ23 $IDColTransf;#2,3层中柱配筋
} elseif {$level==4||$level==5} {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagZ45 $IDColTransf;#4,5层中柱配筋
} else {;
set elemID [expr $N0col + $level*10 +$pier];
set nodeI [expr $level*10 + $pier];
set nodeJ [expr ($level+1)*10 + $pier];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $ColSecTagZ6 $IDColTransf;#6层中柱配筋
}
}
}
#for {set level 1} {$level <=$NStory} {incr level 1} {
# for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
# set elemID [expr $N0col + $level*10 +$pier];
# set nodeI [expr $level*10 + $pier];
# set nodeJ [expr ($level+1)*10 + $pier];
# element elasticBeamColumn $elemID $nodeI $nodeJ [expr 0.55*0.55*pow($m,2)] [expr 3.15e+4*$N/pow($mm,2)] [expr 1/12*pow($m*0.55,4)] $IDColTransf;
# }
#}
set N0beam 200;#beam numbers
set M0 0
for {set level 1} {$level <=[expr $NStory+1]} {incr level 1} {;
for {set bay 1} {$bay <= $NBay} {incr bay 1} {;
if {($bay==1||$bay==$NBay) && $level==2||$level==3||$level==1} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagB12 $IDBeamTransf;#3.3m-6.6m边梁配筋
} elseif {($bay==1||$bay==$NBay) && $level==3} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagB3 $IDBeamTransf;#9.9m边梁配筋
} elseif {($bay==1||$bay==$NBay) && $level==4} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagB4 $IDBeamTransf;#13.2m边梁配筋
} elseif {($bay==1||$bay==$NBay) && $level==5} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagB5 $IDBeamTransf;#16.5m边梁配筋
} elseif {($bay==1||$bay==$NBay) && $level==[expr $NStory+1]} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagB6 $IDBeamTransf;#19.8m边梁配筋
} elseif {$level==2||$level==3||$level==1} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagZ12 $IDBeamTransf;#3.3m-6.6m中梁配筋
} elseif {$level==4} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagZ3 $IDBeamTransf;#6.6m~9.9m中梁配筋
} elseif {$level==5} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagZ4 $IDBeamTransf;#13.2m中梁配筋
} elseif {$level==6} {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagZ5 $IDBeamTransf;#16.5m~19.8m中梁配筋
} else {;
set elemID [expr $N0beam + $level*10 +$bay];
set nodeI [expr $M0 + $level*10 + $bay];
set nodeJ [expr $M0 + $level*10 + $bay+1];
element nonlinearBeamColumn $elemID $nodeI $nodeJ $np $BeamSecTagZ6 $IDBeamTransf;#23.1m~26.4m中梁配筋
}
}
}
#for {set level 1} {$level <=[expr $NStory+1]} {incr level 1} {;
# for {set bay 1} {$bay <= $NBay} {incr bay 1} {;
# set elemID [expr $N0beam + $level*10 +$bay];
# set nodeI [expr $M0 + $level*10 + $bay];
# set nodeJ [expr $M0 + $level*10 + $bay+1];
# element elasticBeamColumn $elemID $nodeI $nodeJ [expr 0.3*0.5*pow($m,2)] [expr 3.15e+4*$N/pow($mm,2)] [expr 1/12*0.3*pow(0.5,3)*pow($m,4)] $IDBeamTransf;
#
# }
#}

#for {set level 2} {$level <=[expr $NStory+1]} {incr level 1} {;
# for {set bay 1} {$bay <= $NBay} {incr bay 1} {;
# set elemID [expr $N0beam + $level*10 +$bay];
# set nodeI [expr $M0 + $level*10 + $bay];
# set nodeJ [expr $M0 + $level*10 + $bay+1];
# element elasticBeamColumn $elemID $nodeI $nodeJ [expr 0.3*$m*0.55*$m] [expr 3.15e+4*$N/$mm/$mm] [expr $Ubig*1/12*0.3*0.55*0.55*0.55*pow($m,4)] $IDBeamTransf;
# #rigidLink beam $nodeI $nodeJ
# }
#}
# Define GRAVITY LOADS, weight and masses
# calculate dead load of frame, assume this to be an internal frame (do LL in a similar manner)
# calculate distributed weight along the beam length
set GammaConcrete [expr 25*$kNpcm]; # Reinforced-Concrete floor slabs
#set Tslab [expr 0.100*$m]; # 100mm slab
#set Lslab [expr 2*$LBeam/2]; # assume slab extends a distance of $LBeam1/2 in/out of plane
#set Qslab [expr $GammaConcrete*$Tslab*$Lslab];
set QLoad [expr 2.0*$kN/$m/$m];#live load
set DLoad [expr 5.0*$kN/$m/$m];#dead load
set GraLoad [expr (1.0*$DLoad+0.5*$QLoad)*7.5*$m/2];#由恒载和活载产生的重力荷载
set QdlCol [expr $GammaConcrete*$HCol*$BCol]; # self weight of Column, weight per length
set QBeam [expr $GammaConcrete*$HBeam*$BBeam]; # self weight of Beam, weight per length
set DBeam [expr 6.*$kN/$m]; #由砌体产生的恒载均匀分布在梁上
set QdlBeam [expr $GraLoad + $QBeam+$DBeam]; # dead load distributed along beam.
set WeightCol [expr $QdlCol*$LCol]; # total Column weight
set WeightBeam [expr $QdlBeam*$LBeam]; # total Beam weight

# assign masses to the nodes that the columns are connected to
# each connection takes the mass of 1/2 of each element framing into it (mass=weight/$g)
set iFloorWeight ""
set WeightTotal 0.0
set sumWiHi 0.0; # sum of storey weight times height, for lateral-load distribution
for {set level 2} {$level <=[expr $NStory+1]} {incr level 1} { ;
set FloorWeight 0.0
if {$level == [expr $NStory+1]} {
set ColWeightFact 1; # one column in top story
} else {
set ColWeightFact 2; # two columns elsewhere
}
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {;
if {$pier == 1 || $pier == [expr $NBay+1]} {
set BeamWeightFact 1; # one beam at exterior nodes
} else {;
set BeamWeightFact 2; # other beams elsewhere
}
set WeightNode [expr $ColWeightFact*$WeightCol/2 + $BeamWeightFact*$WeightBeam/2]
set MassNode [expr $WeightNode/$g];
set nodeID [expr $level*10+$pier]
mass $nodeID $MassNode [expr $Usmall*$N/$g] [expr $Usmall*$N/$g] [expr $Usmall*$N/$g] [expr $Usmall*$N/$g] [expr $Usmall*$N/$g]; # define mass
set FloorWeight [expr $FloorWeight+$WeightNode];

}
puts $FloorWeight
lappend iFloorWeight $FloorWeight
set WeightTotal [expr $WeightTotal+ $FloorWeight]
set sumWiHi [expr $sumWiHi+$FloorWeight*($level-1)*$LCol]; # sum of storey weight times height, for lateral-load distribution
}
set MassTotal [expr $WeightTotal/$g]; # total mass
puts $MassTotal
# LATERAL-LOAD distribution for static pushover analysis
# calculate distribution of lateral load based on mass/weight distributions along building height
# Fj = WjHj/sum(WiHi) * Weight at each floor j
set iFj ""
for {set level 2} {$level <=[expr $NStory+1]} {incr level 1} { ;
set FloorWeight [lindex $iFloorWeight [expr $level-1-1]];
set FloorHeight [expr ($level-1)*$LCol];
set NodeFactor [expr $NBay+1];
lappend iFj [expr $FloorWeight*$FloorHeight/$sumWiHi/$NodeFactor*$WeightTotal]; # per node per floor
}
# create node and load vectors for lateral-load distribution in static analysis
set iFPush ""
set iNodePush ""
for {set level 2} {$level <=[expr $NStory+1]} {incr level 1} {
set FPush [lindex $iFj [expr $level-1-1]]; # lateral load coefficient
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set nodeID [expr $level*10+$pier]
lappend iNodePush $nodeID
lappend iFPush $FPush
}
}
##########################################################################################################################

#source rockgen6.tcl; #generate rock structure
#将框架结构与摇摆结构用刚性链杆连接起来
#set LinkN0 20000;#链杆识别码
#for {set level 2} {$level <=[expr $NStory+1]} {incr level 1} {;
# set elemID [expr $LinkN0 + $level*10 +$NBay];
# set nodeI [expr $M0 + $level*10 + $NBay+1];
# set nodeJ [expr $LNode + $level*10 + 1];
# #element truss $elemID $nodeI $nodeJ $BraceSecTag10;#链杆
# #rigidLink bar $nodeI $nodeJ;
#}
##加入钢阻尼器
#source fuse.tcl;
#set alphaS 0.1;
set alpha $alphaS;#调幅系数
#
# Define RECORDERS -------------------------------------------------------------
set FreeNodeID [expr ($NStory+1)*10+($NBay+1)]; # ID: free node
set SupportNodeFirst [lindex $iSupportNode 0]; # ID: first support node
set SupportNodeLast [lindex $iSupportNode [expr [llength $iSupportNode]-1]]; # ID: last support node
set FirstColumn [expr $N0col+1*10+1]; # ID: first column
set Recordbeam 221
#记录顶点位移时程
recorder Node -file $dataDir/DFree.out -time -node $FreeNodeID -dof 1 disp; # displacements of free node
#记录竖向各节点位移
recorder Node -file $dataDir/Node_disp.out -time -node 18 28 38 48 58 68 78 -dof 1 disp;#displacements of each floor
#recorder Node -file $dataDir/Node_vel.out -time -node 18 28 38 48 58 68 78 -dof 1 vel;#displacements of each floor
#recorder Node -file $dataDir/Node_accel.out -time -node 18 28 38 48 58 68 78 -dof 1 accel;#displacements of each floor
#recorder Node -file $dataDir/Node_fusedisp.out -time -node 30046 30066 30086 30106 30126 30146 30166 -dof 1 2 3 disp;#displacements of each floor
#recorder Node -file $dataDir/Node_fusereac.out -time -node 30046 30066 30086 30106 30126 30146 30166 -dof 1 2 3 reaction;#displacements of each floor
#记录一阶模态
#recorder Node -file $dataDir/Node_eigen.out -time -node 18 28 38 48 58 68 78 -dof 1 "eigen 1";
#记录每层的位移角(Di-Di-1)/H
#recorder Drift -file $dataDir/DrNode.out -time -iNode 18 28 38 48 -jNode 28 38 48 58 -dof 1 -perpDirn 2; # lateral drift

#recorder Node -file $dataDir/DBase.out -time -nodeRange $SupportNodeFirst $SupportNodeLast -dof 1 2 3 disp; # displacements of support nodes
recorder Node -file $dataDir/RBase.out -time -nodeRange 11 18 -dof 1 reaction; # support reaction
#recorder Drift -file $dataDir/DrNode.out -time -iNode $SupportNodeFirst -jNode $FreeNodeID -dof 1 -perpDirn 2; # lateral drift
recorder Element -file $dataDir/force50011.out -time -ele 50011 force; # element forces in local coordinates
recorder Element -file $dataDir/deformation50011.out -time -ele 50011 section fiber 0.1 0.1 deformation;
recorder Element -file $dataDir/stressStrain50011.out -time -ele 50011 section fiber 0.1 0.1 stressStrain;
#recorder Element -file $dataDir/force4007.out -time -ele 4007 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4007.out -time -ele 4007 section 3 deformation;
#recorder Element -file $dataDir/force4008.out -time -ele 4008 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4008.out -time -ele 4008 section 3 deformation;
#recorder Element -file $dataDir/force4009.out -time -ele 4009 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4009.out -time -ele 4009 section 3 deformation;
#recorder Element -file $dataDir/force4010.out -time -ele 4010 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4010.out -time -ele 4010 section 3 deformation;
#recorder Element -file $dataDir/force4011.out -time -ele 4011 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4011.out -time -ele 4011 section 3 deformation;
#recorder Element -file $dataDir/force4012.out -time -ele 4012 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4012.out -time -ele 4012 section 3 deformation;
#recorder Element -file $dataDir/force4013.out -time -ele 4013 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4013.out -time -ele 4013 section 3 deformation;
#recorder Element -file $dataDir/force4014.out -time -ele 4014 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4014.out -time -ele 4014 section 3 deformation;
#recorder Element -file $dataDir/force4015.out -time -ele 4015 basicForces; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4015.out -time -ele 4015 deformation;
#recorder Element -file $dataDir/force4016.out -time -ele 4016 basicForces; # element forces in local coordinates
#recorder Element -file $dataDir/deformation4016.out -time -ele 4016 deformation;
################################################################################################
#recorder Element -file $dataDir/force10206.out -time -ele 10206 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10206.out -time -ele 10206 section 3 deformation;
#recorder Element -file $dataDir/force10306.out -time -ele 10306 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10306.out -time -ele 10306 section 3 deformation;
#recorder Element -file $dataDir/force10406.out -time -ele 10406 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10406.out -time -ele 10406 section 3 deformation;
#recorder Element -file $dataDir/force10506.out -time -ele 10506 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10506.out -time -ele 10506 section 3 deformation;
#recorder Element -file $dataDir/force10606.out -time -ele 10606 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10606.out -time -ele 10606 section 3 deformation;
#recorder Element -file $dataDir/force10206.out -time -ele 10206 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10206.out -time -ele 10206 section 3 deformation;
#recorder Element -file $dataDir/force10306.out -time -ele 10306 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10306.out -time -ele 10306 section 3 deformation;
#recorder Element -file $dataDir/force10406.out -time -ele 10406 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10406.out -time -ele 10406 section 3 deformation;
#recorder Element -file $dataDir/force10506.out -time -ele 10506 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10506.out -time -ele 10506 section 3 deformation;
#recorder Element -file $dataDir/force10606.out -time -ele 10606 localForce; # element forces in local coordinates
#recorder Element -file $dataDir/deformation10606.out -time -ele 10606 section 3 deformation;
#recorder Element -file $dataDir/SSEle1sec310206.out -time -ele 10206 section 1 fiber 0 0 stressStrain; # steel fiber stress-strain, node i
#recorder Element -file $dataDir/SSEle1sec310306.out -time -ele 10306 section 1 fiber 0 0 stressStrain; # steel fiber stress-strain, node i
#recorder Element -file $dataDir/SSEle1sec310406.out -time -ele 10406 section 1 fiber 0 0 stressStrain; # steel fiber stress-strain, node i
#recorder Element -file $dataDir/SSEle1sec310506.out -time -ele 10506 section 1 fiber 0 0 stressStrain; # steel fiber stress-strain, node i
#recorder Element -file $dataDir/SSEle1sec310606.out -time -ele 10606 section 1 fiber 0 0 stressStrain; # steel fiber stress-strain, node i

#for {set level 2} {$level <=[expr $NStory+1]} {incr level 1} {;
# set elemID [expr $LinkN0 + $level*10 +$NBay];
# recorder Element -file $dataDir/force$elemID.out -time -ele $elemID basicForces; # element forces in local coordinates
# recorder Element -file $dataDir/deformation$elemID.out -time -ele $elemID deformation;#链杆
#}
##记录原结构支座反力
#recorder Node -file $dataDir/RBase.out -time -nodeRange 11 18 -dof 1 2 3 reaction; # support reaction
###记录摇摆结构支座反力
#recorder Node -file $dataDir/RBase_rock.out -time -node 1011 1012 301 -dof 1 2 3 reaction; # support reaction



#recorder Element -file $dataDir/ForceEle1sec1.out -time -ele $FirstColumn section 1 force; # section forces, axial and moment, node i
#recorder Element -file $dataDir/DefoEle1sec1.out -time -ele $FirstColumn section 1 deformation; # section deformations, axial and curvature, node i
#recorder Element -file $dataDir/ForceEle1sec$np.out -time -ele $FirstColumn section $np force; # section forces, axial and moment, node j
#recorder Element -file $dataDir/DefoEle1sec$np.out -time -ele $FirstColumn section $np deformation; # section deformations, axial and curvature, node j
#recorder Element -file $dataDir/SSEle1sec3col.out -time -ele $FirstColumn section 3 fiber [expr -($HCol/2-$cover)] [expr -($HCol/2-$cover)] $IDSteel stressStrain; # steel fiber stress-strain, node i
#recorder Element -file $dataDir/SSEle1sec3beam.out -time -ele $Recordbeam section 3 fiber [expr -($HBeam/2-$cover)] [expr -($BBeam/2-$cover)] $IDSteel stressStrain; # steel fiber stress-strain, node i
#
## Define DISPLAY -------------------------------------------------------------
DisplayModel2D ModeShape;#options: ModeShape , NodeNumbers , DeformedShape
#DisplayModel2D DeformedShape;#options: ModeShape , NodeNumbers , DeformedShape

# define GRAVITY -------------------------------------------------------------
# GRAVITY LOADS # define gravity load applied to beams and columns -- eleLoad applies loads in local coordinate axis
pattern Plain 1001 Linear {
for {set level 1} {$level <=$NStory} {incr level 1} {
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set elemID [expr $N0col + $level*10 +$pier]
set nodeID [expr $level*10+$pier]
eleLoad -ele $elemID -type -beamUniform 0 -$QdlCol; # COLUMNS
#load $nodeID 0.0 -[expr 200*$N] 0.0;
}
}
for {set level 1} {$level <=[expr $NStory+1]} {incr level 1} {
for {set bay 1} {$bay <= $NBay} {incr bay 1} {
set elemID [expr $N0beam + $level*10 +$bay]
eleLoad -ele $elemID -type -beamUniform -$QdlBeam; # BEAMS
}
}
}
# Gravity-analysis parameters -- load-controlled static analysis
set Tol 1.0e-6; # convergence tolerance for test
variable constraintsTypeGravity Plain; # default;
if { [info exists RigidDiaphragm] == 1} {
if {$RigidDiaphragm=="ON"} {
variable constraintsTypeGravity Lagrange; # large model: try Transformation
}; # if rigid diaphragm is on
}; # if rigid diaphragm exists
constraints $constraintsTypeGravity ; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral ; # how to store and solve the system of equations in the analysis (large model: try UmfPack)
test NormDispIncr $Tol 6 ; # determine if convergence has been achieved at the end of an iteration step
algorithm Newton; # use Newton's solution algorithm: updates tangent stiffness at every iteration
set NstepGravity 10; # apply gravity in 10 steps
set DGravity [expr 1./$NstepGravity]; # first load increment;
integrator LoadControl $DGravity; # determine the next time step for an analysis
analysis Static; # define type of analysis static or transient
analyze $NstepGravity; # apply gravity

# ------------------------------------------------- maintain constant gravity loads and reset time to zero
loadConst -time 0.0

puts "Model Built"
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by vesna »

If your period is too big the problem can be with one or some of the following: the mass definition, the elements definition, or boundary conditions.

Your code is too big for someone to look at it, especially if you post it without any description.
wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by wdylut »

sorry,I forgot to tell you that the original script is smoothly right,but when i add iso2spring section with zerolength element ,the period is extremely big,
# Create Iso2spring section
set k1 [expr 9262*$kN/$m]
set Fyo [expr 90.4*$kN]
set k2o [expr 926*$kN/$m]
set kvo [expr 2132*$kN/$mm]
set hb [expr 208*$mm]
set Pe [expr 1.6e+8*$N]
section Iso2spring 881 $tol $k1 $Fyo $k2o $kvo $hb $Pe;# $Po;
#建立隔震层
for {set level 1} {$level <=1} {incr level 1} {
#set Y [expr ($level-1)*$LCol];
for {set pier 1} {$pier <= [expr $NBay+1]} {incr pier 1} {
set jNode [expr $level*10+$pier]
set iNode [expr 20000+$level*10+$pier]
set eleTag [expr 50000+$level*10+$pier]
element zeroLengthSection $eleTag $iNode $jNode 881;
#element nonlinearBeamColumn $eleTag $iNode $jNode 5 $isoSecTag $IDColTransf;
}
}
Panos
Posts: 23
Joined: Fri Jul 20, 2012 10:28 am
Location: National Technical University of Athens

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by Panos »

Hi wdylut. I am facing similar problems like the one mentioned in your first post. The error messages that I get are the following:
WARNING bandgenlinlapacksolver::solve() -LAPACK routine returned 1
WARNING NewtonRaphson::solveCurrentStep() -the LinearSysOfEqn failed in solve()
StaticAnalysis::analyze() - the Algorithm failed at iteration: 0 with domain at load factor 0.1
analyze failed, returned: -3 error flag
Could you tell what was wrong with your model, in case that your solution is suitable for me as well?
wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by wdylut »

you can change the eigen computation method from "genBandArpack" to "fullGenLapack" ,you can have a try.
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by vesna »

wdylut, try doing eigne anlaysis after gravity. It can be that iso2pring needs some load on it to initiate its stiffness properly.

panos, your warning message indicates the problem with your model. It says that linear system of equations could not be solved. This usually comes from instabilities within your model. Check connectivity of your elements and boundary conditions. Also make sure that you do not have "hanging" nodes.
wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by wdylut »

dear vesna:
i did it as you told me ,but the result is still not changed.i try to change the constraint of iso2spring ,the period return to a right value,but the constraint which i changed is not the one i need,could you tell me how to set the constraint of iso2spring?
wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by wdylut »

hi vesna,i have solved the problem,thank you.
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by vesna »

Can you post a solution in case someone encounters the same problem.
wdylut
Posts: 13
Joined: Tue May 08, 2012 5:02 pm
Location: lut

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by wdylut »

ok,firstly,i do as you told me to compute the peroid,it does work ,but i still can't get right value,so i set mass to the top node of the iso2spring,the value of the mass is coresponding to the superstrture's mass,then,the period is right which is in a reasonable domain.so i have a suggestion that the iso2spring section should be explained more detailed so that we can handle it.
ningxz
Posts: 15
Joined: Tue Nov 12, 2013 6:46 pm

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by ningxz »

I have a question, do Opensees have any command to simulate the 3D isolate building with Rubber isolation bearing?

I found that in Opensees, there exist a command that can simulate 2D isolate building with Rubber isolation bearing?

Hope for your reply
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by fmk »

qbsqbs
Posts: 1
Joined: Wed Jul 26, 2017 8:20 pm
Location: nefu

Re: WARNING BandGenLinLapackSolver::solve() -LAPACK routine

Post by qbsqbs »

Hi wdylut. I am facing similar problems like the one mentioned in your first post. The error messages that I get are the following:
WARNING bandgenlinlapacksolver::solve() -LAPACK routine returned 38
WARNING NewtonRaphson::solveCurrentStep() -the LinearSysOfEqn failed in solve()
StaticAnalysis::analyze() - the Algorithm failed at iteration: 0 with domain at load factor 0.1
analyze failed, returned: -3 error flag
Could you tell what was wrong with your model, in case that your solution is suitable for me as well?
Thank you so much!!!
Post Reply