Perlun 2 - SAP2000. IntroductionWebinar

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Getting Started With OpenSees

and OpenSees on NEEShub

Frank McKenna
October, 2012

OpenSees is Sponsored by:


George E. Brown Network for Earthquake Engineering
(NEES) through NEEScomm
Pacific Earthquake Engineering Research Center (PEER)
Quick Exercise
1. Register for Account on NEEShub’
a. Open Browser and go to NEES website (http://nees.org)
b. click register and enter the details
c. login
d. Select Tools from Tools & Resources Menu
e. find OpenSeesLab tool under simulation tools and launch it.

Login/Register
Numerical Computation
Algorithms & Solvers Models
Material, Element

Information Technology
Database, Visualization, Frameworks,
Parallel & Grid/Network libraries
Open-Source - Leave it out there for community
Building Blocks for Modern Simulation Code
What is OpenSees?

• A software framework for simulation applications


in earthquake engineering using finite element
methods. OpenSees is not an application.
• A communication mechanism for exchanging and
building upon research accomplishments.
• As open-source software, it has the potential for a
community code for earthquake engineering.
Main Abstractions in OpenSees
Framework

Holds the state of the model


i
at time t and (t + dt)
(500 classes)

ModelBuilder Domain Analysis


Constructs the objects Moves the model
in the model and adds from state at time t to
them to the domain. state at time t + dt
(5 classes) Recorder (200 classes)

Monitors user defined


parameters in the
model during the
analysis
(20 classes)
Main Abstract Classes
ModelBuilder

There are other parts to the framework for Parallel Processing, Reliability
& Optimization that we won’t talk about today.
Each Abstract Class has a Number of Concrete
Classes
Material GeomTransformation

UniaxialMaterial nDMaterial Section Linear


Pdelta
Corotational

Elastic
ElasticPP
Elastic Element in Global System
Elastic Fiber
Hardening J2
Concrete DruckerPrager
Steel TemplateElasto-Plasto U P
Hysteretic FluidSolidPorous
PY-TZ-QZ PressureMultiYield(dependent, independent) Geometric Transformation
Parallel v
Series q
Gap
Fatigue

(over 250 material classes) Element in Basic System


How Do People Use the
OpenSees Framework?
• Provide their own main() function in C++ and link to
framework.

• Use OpenSees interpreterS. These are extensions of


the Tcl interpreters, tclsh and wish, for performing
finite element analysis.

1.
2.
OpenSees.exe
OpenSeesTk.exe
} sequential processing

3.
4.
OpseseesSP.exe
OpenSeesMP.exe } parallel processing
Tcl Interpreters
• wish and tclsh are tcl interpreters.
• Interpreters (Perl, Matlab, Ruby) are programs that execute
programs written in a programming language immediately.
• There is no separate compilation & linking.
• An interpreted program runs slower than a compiled one.
puts “sum of 2 and 3 is [expr 2 + 3]”

sum of 2 and 3 is 5
What is Tcl
• Tcl is a dynamic programming language.
• It is a string based command language.
• Variables and variable substitution
• Expression evaluation
• Basic control structures (if , while, for, foreach)
• Procedures
• File manipulation
• Sourcing other files.

• Command syntax:
command arg1 arg2 …

• Help
1. http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
Example Tcl •procedures & control structures
> for {set i 1} {$i < 10} {incr i 1} {
puts “i equals $i”
•variables & variable substitution }
•expression evaluation …
>set a 1
1 > set sum 0
>expr 2 + 3 foreach value {1 2 3 4} {
>set b a 5
a set sum [expr $sum + $value]
>set b [expr 2 + $b]
>set b $a 3 }
1 >puts $sum
•lists 10
>proc guess {value} {
•file manipulation >set a {1 2 three}
1 2 three global sum
>set fileId [open tmp w] >set la [llength $a] if {$value < $sum} {
?? 3 puts “too low”
>puts $fileId “hello” >set start [lindex $a 0] } else {
>close $fileID 1 if {$value > $sum} {
>type tmp >lappend a four puts “too high”
hello 1 2 three four } else { puts “you got it!”}
}
•sourcing other files }
> guess 9
>source Example1.tcl
too low
Tcl Math Gotcha
(most programming languages)
• If you add, subtract, multiply and divide two
integer numbers the result is an integer.
> set a [expr 1/2]
0

• If you add, subtract, multiply and divide an integer


number and a floating-point number, then the
result is a floating-point number.
>set b [expr 1./2]
0.5

• Computers work store numbers in binary format and


have a finite number of bytes for each number.
Therefore computers cannot store numbers or do math
exactly >set c [expr 1.2/0.1]
11.999999999999998
OpenSees Interpreters

• The OpenSees interpreters are tcl interpreters which have been


extended to include commands for finite element analysis:
1. Modeling – create nodes, elements, loads and constraints
2. Analysis – specify the analysis procedure.
3. Output specification – specify what it is you want to monitor
during the analysis.

• Being interpreters, this means that the files you create and
submit to the OpenSees interpreters are not input files. You are
creating and submitting PROGRAMS.
OpenSees.exe
•An interpreter that extends tclsh for FE analysis.

WARNING: There is no GUI!


model Command
*Adds the modeling commands to the interpreter.
Domain

Element Node MP_Constraint SP_Constraint LoadPattern TimeSeries

ElementalLoad NodalLoad SP_Constraint


• Basic Model Builder
model Basic –ndm ndm? <-ndf ndf?>

This command now adds the following commands to the interpreter:


node mass element equalDOF fix fixX fixY fixZ
pattern timeSeries load eleLoad sp
uniaxialMaterial nDMaterial section geomTransf
fiber layer patch block2D block3D
Why understanding the class
structure is useful
command arg1 arg2 …
command typically resembles abstract class name
arg1 typically resembles concrete class name
arg2 … typically follows constructor args
Material

UniaxialMaterial uniaxialMaterial Elastic 1 3000.

uniaxialMaterial ElasticPP 1 $E $epsY


Elastic
ElasticPP uniaxialMaterial Steel011 $Fy $E0 $b
Steel01
Concrete01
…. Using tcl variables makes reading code easier
Truss example:
model Basic -ndm 2 -ndf 2
node 1 0.0 0.0 50
node 2 144.0 0.0 100
node 3 168.0 0.0 4
node 4 72.0 96.0
8’
fix 1 1 1 (3)
(1) (2)
fix 2 1 1
fix 3 1 1
uniaxialMaterial Elastic 1 3000.0 1 2 3
element truss 1 1 4 10.0 1 6’ 6’ 2’
element truss 2 2 4 5.0 1 E A
element truss 3 3 4 5.0 1
1 3000 10
timeSeries Linear 1 3000
pattern Plain 1 1 { 2 5
3 3000 5
load 4 100.0 -50.0
}
Analysis Analysis

StaticAnalysis
TransientAnalysis

CHandler Numberer Ctest SolnAlgorithm Integrator SystemOfEqn

handler type? args…


numberer type? args…
test type? args…
algorithm type? args…
integrator type? args…
system type? args…
analysis type? args..
analyze args …
Example Analysis:
•Static Nonlinear Analysis with LoadControl
constraints Transformation
numberer RCM
system BandGeneral
test NormDispIncr 1.0e-6 6 2
algorithm Newton
integrator LoadControl 0.1
analysis Static
analyze 10

•Transient Nonlinear Analysis with Newmark


constraints Transformation
numberer RCM
system BandGeneral
test NormDispIncr 1.0e-6 6 2
algorithm Newton
integrator Newmark 0.5 0.25
analysis Transient
analyze 2000 0.01
Recorders & Output
(no output unless you request it)
Recorder DataOutputHandler

StandardStream
ElementRecorder FileStream
NodeRecorder XML_FileStream
EnvelopeNodeRecorder TCP_Stream
EnvelopElementRecorder DatabaseHandler Database

recorder Node -file nodeD.out -node 2 -dof 1 2 3 disp File


MySQL
recorder Element -xml ele.out -ele 1 2 forces Oracle

recorder Element -file ele1sect1fiber1.out -ele 1 2 section 1 fiber 1stress

Recorder commands issued before analyze command


Commands that Return Values
•analyze command
The analyze command returns 0 if successful.
It returns a negative number if not
set ok [analyze numIter <Δt>]
•getTime command
The getTime command returns pseudo time in Domain.

set currentTime [ getTime]


•nodeDisp command
The nodeDisp command returns a nodal displacement.
set disp [ nodeDisp node dof]
set tFinal 15.0;
constraints Transformation
Power of Scripting Language
numberer RCM – Nonlinear Transient Analysis Example
system BandGeneral
test NormDispIncr 1.0e-6 6 2
algorithm Newton
integrator Newmark 0.5 0.25
analysis Transient
set ok 0; set currentTime 0.0
set checkFile [open checkFile.txt w]
while {$ok == 0 && $currentTime < $tFinal} {
set ok [analyze 1 0.01]
if {$ok != 0} {
puts $checkFile “Problem $ok at [getTime]”
test NormDispIncr 1.0e-6 1000 1
algorithm ModifiedNewton –initial
set ok [analyze 1 0.01]
test NormDispIncr 1.0e-6 6 2
algorithm Newton
}
set currentTime [getTime]
}
close $checkFile
OpenSees & Matlab
• Calling matlab from an OpenSees script (mScript.m)
# invoke matlab
if {[catch{exec matlab -nosplash -nodesktop -r ”mScript; quit"}]}{
puts "Ignore this $msg"
}

• Calling OpenSees from a matlab script


# invoke matlab
!OpenSees opsScript.tcl
OpenSees Resources

• Getting Started Manual:


http://opensees.berkeley.edu/wiki/index.php/Getting_Started
• Command Manual:
http://opensees.berkeley.edu/wiki/index.php/Command_Manual
• Examples Manuals:
http://opensees.berkeley.edu/wiki/index.php/Examples
• Message Board:
http://opensees.berkeley.edu/community/viewforum.php?f=2
• Descovering OpenSees web-based learning series:
http://opensees.berkeley.edu/wiki/index.php/Discovering_Open
Sees
Downloading OpenSees.exe and
Installing Tcl/Tk
• Download OpenSees.exe and tcl/tk from here:

http://opensees.berkeley.edu/OpenSees/user/down
load.php
• Tutorial on installing tcl/tk:

http://opensees.berkeley.edu/wiki/index.php/Getti
ng_Started_with_OpenSees_--
_Download_OpenSees
NEES
The George E. Brown Network for Earthquake Engineering Simulation (NEES)
is a shared national network of 14 experimental facilities, collaborative tools, a
centralized data repository, and earthquake simulation software.
NEEShub
• The power behind NEES at http://nees.org
• Maintained and developed at Purdue by NEEScomm
• A science gateway for education and research in earthquake engineering

Through a browser engineers can:


• Upload and view experimental data
• Browse online seminars and courses
• Launch sophisticated tools using remote computational
resources (OpenSeesLab)
NEEShub Tools and Resources

Simulation

Data Management
Menu To Select Tool
OpenSees Interpreter Tool

Example We Will Do
Advantages of Running on NEEShub
• Can check status from any network device
• Can have multiple simulations running

• Can Share Session with someone


FOR THOSE OF YOU WHO ARE NEW

OpenSees does require time &


effort to learn
B UT
Eventually
Students Learn to Love
OpenSees
And Why OpenSees?

Access to modern FE theory


Access to modern numerical & IT advances
Reflects modern programming methods
Access to the source code
Faster
Scripting is a more powerful interface!
demo USING NEEShub

QUESTIONS?

You might also like