Skip to content

Commit

Permalink
rebuild site
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioperez committed Aug 16, 2024
1 parent 41b38c4 commit 4b8f6a2
Show file tree
Hide file tree
Showing 22 changed files with 904 additions and 273 deletions.
56 changes: 28 additions & 28 deletions examples/chopra-10.4/index.html

Large diffs are not rendered by default.

104 changes: 52 additions & 52 deletions examples/example1/index.html

Large diffs are not rendered by default.

165 changes: 165 additions & 0 deletions examples/example2/Example2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# ===----------------------------------------------------------------------===//
#
# OpenSees - Open System for Earthquake Engineering Simulation
# Structural Artificial Intelligence Laboratory
#
# ===----------------------------------------------------------------------===//

# Moment-Curvature Example 2.1
# ----------------------------
# Zero length element with fiber section
# Single Nodal Load, Static Analysis
#
# Example Objectives
# ------------------
# Moment-Curvature Analysis in OpenSees
#
# Written: Andreas Schellenberg ([email protected])
# Date: June 2017
#
# import the OpenSees Python module
import opensees.openseespy as ops

def moment_curvature(model, secTag, axialLoad, maxK, numIncr):
"""
A procedure for performing section analysis (only does
moment-curvature, but can be easily modified to do any mode
of section response.
Arguments
secTag -- tag identifying section to be analyzed
axialLoad -- axial load applied to section (negative is compression)
maxK -- maximum curvature reached during analysis
numIncr -- number of increments used to reach maxK (default 100)
Sets up a recorder which writes moment-curvature results to file
section$secTag.out ... the moment is in column 1, and curvature in column 2
Written: Andreas Schellenberg ([email protected])
Date: June 2017
"""

# Define two nodes at (0,0)
model.node(1, 0.0, 0.0)
model.node(2, 0.0, 0.0)

# Fix all degrees of freedom except axial and bending
model.fix(1, 1, 1, 1)
model.fix(2, 0, 1, 0)

# Define element
# tag ndI ndJ secTag
model.element("zeroLengthSection", 1, 1, 2, secTag)

# Create recorder
model.recorder("Node", "disp", "-file", "section"+str(secTag)+".out", "-time", "-node", 2, "-dof", 3)

# Define constant axial load
model.pattern("Plain", 1, "Constant", loads={2: [axialLoad, 0.0, 0.0]})

# Define analysis parameters
model.system("BandGeneral")
model.numberer("Plain")
model.constraints("Plain")
model.test("NormUnbalance", 1.0E-9, 10)
model.algorithm("Newton")
model.integrator("LoadControl", 0.0)
model.analysis("Static")

# Do one analysis for constant axial load
model.analyze(1)

# Define reference moment
model.pattern("Plain", 2, "Linear")
model.load(2, 0.0, 0.0, 1.0)

# Compute curvature increment
dK = maxK/numIncr

# Use displacement control at node 2 for section analysis
model.integrator("DisplacementControl", 2, 3, dK, 1, dK, dK)

# Do the section analysis
model.analyze(numIncr)

def create_section():
# ------------------------------
# Start of model generation
# ------------------------------

# Create a model (with two-dimensions and 3 DOF/node)
model = ops.Model(ndm=2, ndf=3)

# Define materials for nonlinear columns
# ------------------------------------------
# CONCRETE tag f'c ec0 f'cu ecu
# Core concrete (confined)
model.uniaxialMaterial("Concrete01", 1, -6.0, -0.004, -5.0, -0.014)
# Cover concrete (unconfined)
model.uniaxialMaterial("Concrete01", 2, -5.0, -0.002, -0.0, -0.006)

# STEEL
# Reinforcing steel
fy = 60.0; # Yield stress
E = 30000.0; # Young's modulus
# tag fy E0 b
model.uniaxialMaterial("Steel01", 3, fy, E, 0.01)

# Define cross-section for nonlinear columns
# ------------------------------------------
# set some parameters
width = 15.0
depth = 24.0
cover = 1.5
As = 0.60; # area of no. 7 bars

# some variables derived from the parameters
y1 = depth/2.0
z1 = width/2.0

model.section("Fiber", 1)
# Create the concrete core fibers
model.patch("rect", 1, 10, 1, cover-y1, cover-z1, y1-cover, z1-cover, section=1)
# Create the concrete cover fibers (top, bottom, left, right, section=1)
model.patch("rect", 2, 10, 1, -y1, z1-cover, y1, z1, section=1)
model.patch("rect", 2, 10, 1, -y1, -z1, y1, cover-z1, section=1)
model.patch("rect", 2, 2, 1, -y1, cover-z1, cover-y1, z1-cover, section=1)
model.patch("rect", 2, 2, 1, y1-cover, cover-z1, y1, z1-cover, section=1)
# Create the reinforcing fibers (left, middle, right, section=1)
model.layer("straight", 3, 3, As, y1-cover, z1-cover, y1-cover, cover-z1, section=1)
model.layer("straight", 3, 2, As, 0.0, z1-cover, 0.0, cover-z1, section=1)
model.layer("straight", 3, 3, As, cover-y1, z1-cover, cover-y1, cover-z1, section=1)

# Estimate yield curvature
# (Assuming no axial load and only top and bottom steel)
d = depth - cover # d -- from cover to rebar
epsy = fy/E # steel yield strain
Ky = epsy/(0.7*d)
return model, Ky


if __name__ == "__main__":

model, Ky = create_section()

P = -180.0 # Axial load
mu = 15.0 # Target ductility for analysis
numIncr = 100 # Number of analysis increments


print("Estimated yield curvature: ", Ky)

# Call the section analysis procedure
moment_curvature(model, 1, P, Ky*mu, numIncr)


u = model.nodeDisp(2,3)
if abs(u-0.00190476190476190541) < 1e-12:
print('PASSED : MomentCurvature.py\n')
print("Passed!")
else:
print('FAILED : MomentCurvature.py\n')
print("Failed!")


77 changes: 77 additions & 0 deletions examples/example2/Example2.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# ===----------------------------------------------------------------------===//
#
# OpenSees - Open System for Earthquake Engineering Simulation
# Structural Artificial Intelligence Laboratory
#
# ===----------------------------------------------------------------------===//
#
# Define model builder
# --------------------
model basic -ndm 2 -ndf 3

# Define materials for nonlinear columns
# ------------------------------------------
# CONCRETE tag f'c ec0 f'cu ecu
# Core concrete (confined)
uniaxialMaterial Concrete01 1 -6.0 -0.004 -5.0 -0.014

# Cover concrete (unconfined)
uniaxialMaterial Concrete01 2 -5.0 -0.002 0.0 -0.006

# STEEL
# Reinforcing steel
set fy 60.0; # Yield stress
set E 30000.0; # Young's modulus
# tag fy E0 b
uniaxialMaterial Steel01 3 $fy $E 0.01

# Define cross-section for nonlinear columns
# ------------------------------------------

# set some parameters
set colWidth 15
set colDepth 24

set cover 1.5
set As 0.60; # area of no. 7 bars

# some variables derived from the parameters
set y1 [expr $colDepth/2.0]
set z1 [expr $colWidth/2.0]

section Fiber 1 {

# Create the concrete core fibers
patch rect 1 10 1 [expr $cover-$y1] [expr $cover-$z1] [expr $y1-$cover] [expr $z1-$cover]

# Create the concrete cover fibers (top, bottom, left, right)
patch rect 2 10 1 [expr -$y1] [expr $z1-$cover] $y1 $z1
patch rect 2 10 1 [expr -$y1] [expr -$z1] $y1 [expr $cover-$z1]
patch rect 2 2 1 [expr -$y1] [expr $cover-$z1] [expr $cover-$y1] [expr $z1-$cover]
patch rect 2 2 1 [expr $y1-$cover] [expr $cover-$z1] $y1 [expr $z1-$cover]

# Create the reinforcing fibers (left, middle, right)
layer straight 3 3 $As [expr $y1-$cover] [expr $z1-$cover] [expr $y1-$cover] [expr $cover-$z1]
layer straight 3 2 $As 0.0 [expr $z1-$cover] 0.0 [expr $cover-$z1]
layer straight 3 3 $As [expr $cover-$y1] [expr $z1-$cover] [expr $cover-$y1] [expr $cover-$z1]
}

# Estimate yield curvature
# (Assuming no axial load and only top and bottom steel)
set d [expr $colDepth-$cover] ;# d -- from cover to rebar
set epsy [expr $fy/$E] ;# steel yield strain
set Ky [expr $epsy/(0.7*$d)]

# Print estimate to standard output
puts "Estimated yield curvature: $Ky"

# Set axial load
set P -180

set mu 15; # Target ductility for analysis
set numIncr 100; # Number of analysis increments

# Call the section analysis procedure
source MomentCurvature.tcl
MomentCurvature 1 $P [expr $Ky*$mu] $numIncr

20 changes: 10 additions & 10 deletions examples/example2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ <h2 id="modeling">Modeling</h2>


<a class="nav-link active "
id="efcdba-tab" data-bs-toggle="tab" data-bs-target="#efcdba"
id="bdecaf-tab" data-bs-toggle="tab" data-bs-target="#bdecaf"
type="button" role="tab" aria-controls="nav-home" aria-selected="true">Python</a>



<a class="nav-link "
id="cfabde-tab" data-bs-toggle="tab" data-bs-target="#cfabde"
id="cdfeba-tab" data-bs-toggle="tab" data-bs-target="#cdfeba"
type="button" role="tab" aria-controls="nav-home" aria-selected="true">Tcl</a>


Expand All @@ -392,10 +392,10 @@ <h2 id="modeling">Modeling</h2>



<div class="tab-pane fade show active " id="efcdba" role="tabpanel" aria-labelledby="nav-1">
<div class="tab-pane fade show active " id="bdecaf" role="tabpanel" aria-labelledby="nav-1">

<ol>
<li><a href="Example2.1.py"><code>Example2.1.py</code></a></li>
<li><a href="Example2.py"><code>Example2.py</code></a></li>
</ol>


Expand All @@ -406,10 +406,10 @@ <h2 id="modeling">Modeling</h2>



<div class="tab-pane fade show " id="cfabde" role="tabpanel" aria-labelledby="nav-1">
<div class="tab-pane fade show " id="cdfeba" role="tabpanel" aria-labelledby="nav-1">

<ol>
<li><a href="Example2.1.tcl"><code>Example2.1.tcl</code></a></li>
<li><a href="Example2.tcl"><code>Example2.tcl</code></a></li>
<li><a href="MomentCurvature.tcl"><code>MomentCurvature.tcl</code></a></li>
</ol>

Expand Down Expand Up @@ -445,13 +445,13 @@ <h2 id="modeling">Modeling</h2>


<a class="nav-link active "
id="bfedac-tab" data-bs-toggle="tab" data-bs-target="#bfedac"
id="dbaecf-tab" data-bs-toggle="tab" data-bs-target="#dbaecf"
type="button" role="tab" aria-controls="nav-home" aria-selected="true">Python</a>



<a class="nav-link "
id="fecbda-tab" data-bs-toggle="tab" data-bs-target="#fecbda"
id="dcafbe-tab" data-bs-toggle="tab" data-bs-target="#dcafbe"
type="button" role="tab" aria-controls="nav-home" aria-selected="true">Tcl</a>


Expand All @@ -467,7 +467,7 @@ <h2 id="modeling">Modeling</h2>



<div class="tab-pane fade show active " id="bfedac" role="tabpanel" aria-labelledby="nav-1">
<div class="tab-pane fade show active " id="dbaecf" role="tabpanel" aria-labelledby="nav-1">

<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span>model<span style="font-weight:bold">.</span>section(<span style="color:#b84">&#34;Fiber&#34;</span>, <span style="color:#099">1</span>)
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># Create the concrete core fibers</span>
Expand All @@ -490,7 +490,7 @@ <h2 id="modeling">Modeling</h2>



<div class="tab-pane fade show " id="fecbda" role="tabpanel" aria-labelledby="nav-1">
<div class="tab-pane fade show " id="dcafbe" role="tabpanel" aria-labelledby="nav-1">

<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-Tcl" data-lang="Tcl"><span style="display:flex;"><span><span style="color:#008080">section</span> Fiber <span style="color:#099">1</span> <span style="font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>
Expand Down
Loading

0 comments on commit 4b8f6a2

Please sign in to comment.