why does opensees close automatically when i run my codes

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
pimkkk
Posts: 61
Joined: Wed Mar 03, 2010 11:55 pm
Location: bjut

why does opensees close automatically when i run my codes

Post by pimkkk »

when i tried to run my program, opensees just closed without any result nor error warning, could you please let me know what happened or what should i do?

thanks~
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

tell me some more .. do you start it and it fails .. do you start it, source a file and it just exits .. is this your own .exe that you are running and it stops .. i need more info.
pimkkk
Posts: 61
Joined: Wed Mar 03, 2010 11:55 pm
Location: bjut

Post by pimkkk »

i source a file, it just exits. whay do you mean by "my own .exe"?

thanks
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

you are in the framework forum, typically people here ask questions on building their own application or extending the opensees interpreter applications.

so what is in your script. if small post it.
pimkkk
Posts: 61
Joined: Wed Mar 03, 2010 11:55 pm
Location: bjut

Post by pimkkk »

# SET UP ----------------------------------------------------------------------------
# units: kip, inch, sec
wipe; # clear memory of all past model definitions
model basic -ndm 2 -ndf 3; # Define the model builder, ndm=#dimension, ndf=#dofs
file mkdir data7;

# define GEOMETRY -------------------------------------------------------------
set LCol 100; # column length
set Weight 38640; # superstructure weight



# calculated parameters
set PCol $Weight; # nodal dead-load weight per column
set g 386.4; # g.
set Ec 29000;
set u 0.3;
set G [expr $Ec/2/(1+$u)];
set Mass [expr $PCol/$g]; # nodal mass
set T 1;
set pi 3.1415926;
set IzCol [expr 1014.4*pow($LCol,3)/12/$Ec];
set alpha 0.01;
set ACol [expr pow($alpha,2)*$Ec*$IzCol/$G/$LCol/$LCol];


#set h [expr pow(12*$G*$LCol*$LCol/$Ec/$alpha/$alpha,0.5)];
#set b [expr 16*pow($LCol,3)*$Mass*pow($pi,2)/$Ec/pow($h,3)/pow($T,2)];
#set ACol [expr $b*$h];
#set IzCol [expr $ACol*pow($h,2)/12];
#set IzCol 1522150146;

#concrete parameters

set fc -6.21; set eo -0.0021; set r 2.91;

set k 1.0144; set alphaC 0.32; set fcr 0.294;

set ecr 0.00008; set b 0.4; set alphaT 0.08;

set fcc -6.91; set ecc -0.0038; set rcc 1.88;


#concrete (confined and unconfined)

uniaxialMaterial Concrete06 1 $fcc $ecc $rcc 1 $alphaC $fcr $ecr $b $alphaT;

# Define cross-section

set t1 6.0; set NStrip1 2; # thickness 1

set t2 4.0; set NStrip2 4; # thickness 2

set t3 6.0; set NStrip3 2; # thickness 3

# define geometric transformation: performs a linear geometric transformation of beam stiffness and resisting force from the basic system to the global-coordinate system
set ColTransfTag 1; # associate a tag to column transformation
geomTransf LinearInt $ColTransfTag ;

set np 1; # int. points

set C 0.4; # center of rotation



section FiberInt 2 -NStrip $NStrip1 $t1 $NStrip2 $t2 $NStrip3 $t3 {

#vertical fibers

fiber 100 0 10 1

}


# nodal coordinates:
node 1 0 0; # node#, X, Y
node 2 0 [expr $LCol/9];
node 3 0 [expr $LCol/9*2];
node 4 0 [expr $LCol/9*3];
node 5 0 [expr $LCol/9*4];
node 6 0 [expr $LCol/9*5];
node 7 0 [expr $LCol/9*6];
node 8 0 [expr $LCol/9*7];
node 9 0 [expr $LCol/9*8];
node 10 0 [expr $LCol];






# element connectivity:
element dispBeamColumnInt 1 1 2 $np 2 1 $C

element dispBeamColumnInt 2 2 3 $np 2 1 $C

element dispBeamColumnInt 3 3 4 $np 2 1 $C

element dispBeamColumnInt 4 4 5 $np 2 1 $C

element dispBeamColumnInt 5 5 6 $np 2 1 $C

element dispBeamColumnInt 6 6 7 $np 2 1 $C

element dispBeamColumnInt 7 7 8 $np 2 1 $C

element dispBeamColumnInt 8 8 9 $np 2 1 $C

element dispBeamColumnInt 9 9 10 $np 2 1 $C


# Single point constraints -- Boundary Conditions
fix 1 1 1 1; # node DX DY RZ



recorder Node -file data7/DFree2.out -node 2 -dof 1 disp; # displacements of free nodes
recorder Node -file Data7/DFree3.out -node 3 -dof 1 disp;
recorder Node -file Data7/DFree4.out -node 4 -dof 1 disp;
recorder Node -file Data7/DFree5.out -node 5 -dof 1 disp;
recorder Node -file Data7/DFree6.out -node 6 -dof 1 disp;

recorder Node -file Data7/DFree7.out -node 7 -dof 1 disp;
recorder Node -file Data7/DFree8.out -node 8 -dof 1 disp;
recorder Node -file Data7/DFree9.out -node 9 -dof 1 disp;
recorder Node -file Data7/DFree10.out -node 10 -dof 1 disp;

recorder Node -file Datatry/DBase.out -node 1 -dof 1 disp; # displacements of support nodes



# define gravity------------------------------------------------------------
pattern Plain 1 Linear {
load 10 0 -$PCol 0
load 9 0 -$PCol 0
load 8 0 -$PCol 0
load 7 0 -$PCol 0
load 6 0 -$PCol 0
load 5 0 -$PCol 0
load 4 0 -$PCol 0
load 3 0 -$PCol 0
load 2 0 -$PCol 0
load 1 0 -$PCol 0
}
#define Lateral load-------------------------------------------------------------
set a 0.01;
pattern Plain 2 Linear {
for {set z 0} {$z < [expr $LCol/9]} {incr z 1} {

eleLoad -ele 1 -type -beamUniform [expr 100*(1-exp(-$a*$z/$LCol)/(1-exp(-$a)))];
eleLoad -ele 2 -type -beamUniform [expr 100*(1-exp(-$a*($z+$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 3 -type -beamUniform [expr 100*(1-exp(-$a*($z+2*$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 4 -type -beamUniform [expr 100*(1-exp(-$a*($z+3*$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 5 -type -beamUniform [expr 100*(1-exp(-$a*($z+4*$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 6 -type -beamUniform [expr 100*(1-exp(-$a*($z+5*$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 7 -type -beamUniform [expr 100*(1-exp(-$a*($z+6*$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 8 -type -beamUniform [expr 100*(1-exp(-$a*($z+7*$LCol/9)/$LCol)/(1-exp(-$a)))];
eleLoad -ele 9 -type -beamUniform [expr 100*(1-exp(-$a*($z+8*$LCol/9)/$LCol)/(1-exp(-$a)))];



}
}

set Tol 1.0e-8; # convergence tolerance for test
constraints Plain; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandSPD;
#system BandGeneral; # how to store and solve the system of equations in the analysis
test NormDispIncr $Tol 2000 ; # determine if convergence has been achieved at the end of an iteration step
algoritm ModifiedNewton -initial ; # use Newton's solution algorithm: updates tangent stiffness at every iteration
set NstepGravity 1; # apply gravity in 1 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 "$h"
#puts "$b"
puts "$IzCol"
puts "$ACol"
puts "done"
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

does not like your section command .. have a look at the example for this element .. if you ran the app from a dos shell, you would see an error message saying

Failed - Not consistent number of fibers
pimkkk
Posts: 61
Joined: Wed Mar 03, 2010 11:55 pm
Location: bjut

Post by pimkkk »

really sorry for bothering you again, but i have looked like all the examples, but it seems they are all nonlinear beamcolunm, and i want use element dispBeamColumnInt, so i google it, and got the follow as an example,
wipe; model basic -ndm 2 -ndf 3

set tolAx 1.0e-3; set iterAx 100;

set tolLatNew 1.0e-6; set iterLatNew 100;

set tolLatIni 1.0e-5; set iterLatIni 1000;

set dUi 0.02; # Displacement increment

set maxU 1.6; # Max. Displacement


#concrete parameters

set fc -6.21; set eo -0.0021; set r 2.91;

set k 1.36; set alphaC 0.32; set fcr 0.294;

set ecr 0.00008; set b 0.4; set alphaT 0.08;

set fcc -6.91; set ecc -0.0038; set rcc 1.88;


#steel parameters

set fyRed 59.15; set by 0.02; set Ry 1.564;

set roy 0.00327; set fyBRed 57.33; set byB 0.02;

set RyB 25.0; set royB 0.0293; set fxRed 59.15;

set bx 0.02; set Rx 1.564; set rox 0.00327;


#concrete (confined and unconfined)

uniaxialMaterial Concrete06 1 $fcc $ecc $rcc 1 $alphaC $fcr $ecr $b $alphaT;

uniaxialMaterial Concrete06 2 $fc $eo $r $k $alphaC $fcr $ecr $b $alphaT;


# steel (bound., web and horiz. reinforcement)

set E 29000.0;

uniaxialMaterial Steel02 1003 $fyBRed $E $byB $RyB 0.9 0.1 0 0.1 0 0.1 ;

uniaxialMaterial Steel02 1004 $fyRed $E $by $Ry 0.9 0.1 0 0.1 0 0.1 ;

uniaxialMaterial Steel02 1005 $fxRed $E $bx $Rx 0.9 0.1 0 0.1 0 0.1 ;


# Define cross-section

set t1 6.0; set NStrip1 2; # thickness 1

set t2 4.0; set NStrip2 4; # thickness 2

set t3 6.0; set NStrip3 2; # thickness 3

geomTransf LinearInt 1

set np 1; # int. points

set C 0.4; # center of rotation


#section definition

section FiberInt 2 -NStrip $NStrip1 $t1 $NStrip2 $t2 $NStrip3 $t3 {

#vertical fibers

fiber -23 1 10 1; fiber -23 1 5 2; fiber -23 1 0.3 1003;

fiber -19 1 10 1; fiber -19 1 5 2; fiber -19 1 0.3 1003;

fiber -14 1 33 2; fiber -14 1 0.1 1004;

fiber -6 1 33 2; fiber -6 1 0.1 1004;

fiber 6 1 33 2; fiber 6 1 0.1 1004;

fiber 14 1 33 2; fiber 14 1 0.1 1004;

fiber 19 1 10 1; fiber 19 1 5 2; fiber 19 1 0.3 1003;

fiber 23 1 10 1; fiber 23 1 5 2; fiber 23 1 0.3 1003;

#horiz. reinf.

Hfiber 0 0 0.2 1005;

}


#nodes

set n 8

node 1 0 0.0; node 2 0 160; node 3 0 20; node 4 0 40;

node 5 0 60; node 6 0 80; node 7 0 100; node 8 0 120; node 9 0 140;


#element definition

element dispBeamColumnInt 1 1 3 $np 2 1 $C

element dispBeamColumnInt 2 3 4 $np 2 1 $C

element dispBeamColumnInt 3 4 5 $np 2 1 $C

element dispBeamColumnInt 4 5 6 $np 2 1 $C

element dispBeamColumnInt 5 6 7 $np 2 1 $C

element dispBeamColumnInt 6 7 8 $np 2 1 $C

element dispBeamColumnInt 7 8 9 $np 2 1 $C

element dispBeamColumnInt 8 9 2 $np 2 1 $C


fix 1 1 1 1

# Set axial load

pattern Plain 1 Constant {

load 2 0.0 -85 0.0

}


initialize; integrator LoadControl 0 1 0 0;

system SparseGeneral -piv; test NormUnbalance $tolAx $iterAx 0;

numberer Plain; constraints Plain;

algorithm ModifiedNewton -initial; analysis Static;


# perform the gravity load analysis,

analyze [expr 1]


# Set the gravity loads to be constant & reset the time in the domain

loadConst -time 0.0

remove recorders


# set lateral load

pattern Plain 2 Linear {

load 2 1.0 0.0 0;

}

system BandGeneral; constraints Transformation; numberer Plain;


# Create a recorder to monitor nodal displacement and element forces

recorder Node -file nodeTop.out -node 2 -dof 1 disp

recorder Element -file elesX.out -time -ele 1 globalForce


# recorder for element1 section1 steel stress/strain and section force-def.

recorder Element -file Sect_FandD.out -ele 1 section 1 forceAndDeformation

recorder Element -file Sect_eX.out -ele 1 section 1 eX

recorder Element -file Sect_eY.out -ele 1 section 1 eY

recorder Element -file Sect_sX.out -ele 1 section 1 sX

recorder Element -file Sect_sY.out -ele 1 section 1 sY


test NormDispIncr $tolLatNew $iterLatNew;

algorithm ModifiedNewton -initial

analysis Static

set dU $dUi;

set numSteps [expr int($maxU/$dU)];

integrator DisplacementControl 2 1 $dU 1 $dU $dU


#source cycle2.tcl

#### end


set ok [analyze $numSteps]; set jump 1;

if {$ok != 0} {

set currentDisp [nodeDisp 2 1]

set ok 0

while {abs($currentDisp) < abs($maxU)} {

set ok [analyze 1]

puts "\n Trying.. $currentDisp\n"

# if the analysis fails try initial tangent iteration

if {$ok != 0} {

puts "\n regular newton failed .. try an initial stiffness"

test NormDispIncr $tolLatIni $iterLatIni 0;

algorithm ModifiedNewton -initial ;

set ok [analyze 1]

puts "\n Trying.. $currentDisp\n"

if {$ok == 0} {

puts " that worked .. back to regular newton \n"

set jump 1

integrator DisplacementControl 2 1 $dU 1

} else {

puts "\n that didn't worked .. Try next point\n"

set jump [expr $jump+1];

integrator DisplacementControl 2 1 [expr $dU*$jump] 1

}

test NormDispIncr $tolLatNew $iterLatNew

algorithm Newton


} else {set jump 1

integrator DisplacementControl 2 1 $dU 1

}

set currentDisp [expr $currentDisp+$dU]

}

}

#### end

but we i run it, even it has errors...

so could you please let me know what examples i should look at? i know i should find it by myself, but i just have no progress scince yesterday. sorry and thanks
Post Reply