Skip to content

Commit

Permalink
Squashed 'openseespy-docs/' changes from 60eb74ee..5d108af2
Browse files Browse the repository at this point in the history
5d108af2 update
083da805 update parameter command
759a8a3d add collapse recorder
135878fd add collapse recorder
d430ec80 fix an import in example
15ee542e add ops_vis
3f763736 upgrade to 3.2.2.6
500084d2 Update setNodeAccel.rst
bb6c3937 Update setNodeVel.rst
63be277e Update setNodeDisp.rst
02f195c2 Merge branch 'master' of github.com:zhuminjie/OpenSeesPyDoc
73418f3e 3.2.2.5
50b4d168 Merge pull request #205 from sewkokot/fixReadTheDocsBuilding
cc42cc10 another trial to fix Read the Docs building process
277d938c Merge pull request #204 from sewkokot/fixSphinxAutodoc
cd7c2436 ops_vis: minor change to fix Sphinx auto-generate function docs
631ebc68 Update to 3.2.2.4
e4a54cfd Merge pull request #203 from u-anurag/master
c427ba8e Merge pull request #201 from sewkokot/addOpsVis
5468569b Update the rendering example
dff8aca3 Merge branch 'master' of github.com:zhuminjie/OpenSeesPyDoc
433af67f partmesh update
ebb07a4a update ops_vis and examples: more descriptive line style formats
cf097c29 add quads_4x4 png files
a3c9746f add ops_vis.py used for autodoc and autofunction; update, cleanup
1e40729f initial import of the ops_vis module
79c83506 modify existing files to adapt for ops_vis documentation
318fc65d delete redundant src/ from including sub.txt in two files
44df21df Merge pull request #200 from u-anurag/master
b48ec1bb fix typo
d057495d cleaning up
d3bd7716 Remove openseespyvis
4d86bb22 Merge pull request #6 from zhuminjie/master
1542b287 Update description for developers
d3612a00 update index
a54f14bb Merge branch 'master' of github.com:zhuminjie/OpenSeesPyDoc
29225043 update to 3.2.2.3
47ef9da4 Fix space
d1d3016d Merge branch 'master' of https://github.com/u-anurag/OpenSeesPyDoc
b91c1993 Add openseesvispy information
69e8cb87 Merge pull request #5 from zhuminjie/master
010ccabb Update changelog.rst

git-subtree-dir: openseespy-docs
git-subtree-split: 5d108af25036ec707230d2dbd8889681fa7d8c4a
  • Loading branch information
zhuminjie committed Nov 30, 2020
1 parent 5e826b8 commit 0a8b027
Show file tree
Hide file tree
Showing 73 changed files with 4,513 additions and 97 deletions.
Binary file added _static/collapserecorder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_My.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_Mz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_N.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_T.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_Vy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_Vz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_defo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/demo_cantilever_3el_3d_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/elementremoval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/fibsec_rc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/fibsec_wshape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/portal_frame_M.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/portal_frame_N.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/portal_frame_V.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/portal_frame_defo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/portal_frame_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_alfa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_defo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_s1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_s2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_sxx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/quads_4x4_sxy.png
Binary file added _static/quads_4x4_syy.png
Binary file added _static/quads_4x4_vmis.png
Binary file added _static/quads_4x4_vmis_ips_nds_vals.png
Binary file added _static/truss_ex1_defo.png
25 changes: 16 additions & 9 deletions conf.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
sys.path.insert(0, os.path.abspath('./src/ops_vis'))

import sphinx_rtd_theme

# -- General configuration ------------------------------------------------
Expand All @@ -32,13 +36,16 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode']
'sphinx.ext.napoleon',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode']

napoleon_google_docstring = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -62,9 +69,9 @@
# built documents.
#
# The short X.Y version.
version = '3.2.2'
version = '3.2.2.6'
# The full version, including alpha/beta/rc tags.
release = '3.2.2'
release = '3.2.2.6'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
10 changes: 6 additions & 4 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@

OpenSeesPy is on :doc:`src/pypi`.

OpenSeesPy is official in :doc:`src/designsafe`.
OpenSeesPy runs on :doc:`src/designsafe`.

OpenSeesPy can now run on :doc:`src/wsl`.
OpenSeesPy runs on :doc:`src/wsl`.

OpenSeesPy runs on Mac now!

The latest version of this document can be found at
`<https://openseespydoc.readthedocs.io/en/latest/>`_.

.. note::

Questions including modeling issues and the use of `OpenSeesPy`_,
Questions including modeling issues and the use of OpenSeesPy,
please post on `OpenSeesPy Forum <https://opensees.berkeley.edu/community/viewforum.php?f=12>`_.

You are very welcome to contribute to OpenSeesPy with new command
Expand Down Expand Up @@ -90,7 +92,7 @@ To run a test of the pip installation:
src/reliabilitycmds
src/parallelcmds
src/preprocessing
src/plotcmds
src/postprocessing
src/examples


Expand Down
85 changes: 49 additions & 36 deletions pyExamples/3DFrame_Rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
## plot mode shapes
##
## By - Anurag Upadhyay, PhD Candidate, University of Utah.
## Date - 12/01/2019
## Updated - 09/10/2020
##################################################################

from openseespy.postprocessing.Get_Rendering import *
from openseespy.opensees import *
import openseespy.postprocessing.Get_Rendering as opsplt
import openseespy.opensees as ops

import numpy as np

from math import asin, sqrt

# set some properties
wipe()
ops.wipe()

model('Basic', '-ndm', 3, '-ndf', 6)
ops.model('Basic', '-ndm', 3, '-ndf', 6)

# properties
# units kip, ft
Expand Down Expand Up @@ -46,10 +46,10 @@
for i in range(0, numBayX + 1):
yLoc = 0.
for j in range(0, numBayY + 1):
node(nodeTag, xLoc, yLoc, zLoc)
mass(nodeTag, massX, massX, 0.01, 1.0e-10, 1.0e-10, 1.0e-10)
ops.node(nodeTag, xLoc, yLoc, zLoc)
ops.mass(nodeTag, massX, massX, 0.01, 1.0e-10, 1.0e-10, 1.0e-10)
if k == 0:
fix(nodeTag, 1, 1, 1, 1, 1, 1)
ops.fix(nodeTag, 1, 1, 1, 1, 1, 1)

yLoc += bayWidthY
nodeTag += 1
Expand All @@ -62,8 +62,8 @@
zLoc += storyHeight

# add column element
geomTransf(coordTransf, 1, 1, 0, 0)
geomTransf(coordTransf, 2, 0, 0, 1)
ops.geomTransf(coordTransf, 1, 1, 0, 0)
ops.geomTransf(coordTransf, 2, 0, 0, 1)

eleTag = 1
nodeTag1 = 1
Expand All @@ -72,9 +72,9 @@
for i in range(0, numBayX+1):
for j in range(0, numBayY+1):
nodeTag2 = nodeTag1 + (numBayX+1)*(numBayY+1)
iNode = nodeCoord(nodeTag1)
jNode = nodeCoord(nodeTag2)
element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 1, '-mass', M, massType)
iNode = ops.nodeCoord(nodeTag1)
jNode = ops.nodeCoord(nodeTag2)
ops.element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 1, '-mass', M, massType)
eleTag += 1
nodeTag1 += 1

Expand All @@ -85,9 +85,9 @@
for i in range(0, numBayX):
for k in range(0, numBayY+1):
nodeTag2 = nodeTag1 + (numBayY+1)
iNode = nodeCoord(nodeTag1)
jNode = nodeCoord(nodeTag2)
element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 2, '-mass', M, massType)
iNode = ops.nodeCoord(nodeTag1)
jNode = ops.nodeCoord(nodeTag2)
ops.element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 2, '-mass', M, massType)
eleTag += 1
nodeTag1 += 1

Expand All @@ -99,36 +99,49 @@
for i in range(0, numBayY+1):
for k in range(0, numBayX):
nodeTag2 = nodeTag1 + 1
iNode = nodeCoord(nodeTag1)
jNode = nodeCoord(nodeTag2)
element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 2, '-mass', M, massType)
iNode = ops.nodeCoord(nodeTag1)
jNode = ops.nodeCoord(nodeTag2)
ops.element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 2, '-mass', M, massType)
eleTag += 1
nodeTag1 += 1
nodeTag1 += 1

# calculate eigenvalues & print results
numEigen = 7
eigenValues = eigen(numEigen)
eigenValues = ops.eigen(numEigen)
PI = 2 * asin(1.0)

#
# Display Model
plot_model()
# Display specific mode shape
plot_modeshape(5)
###################################
#### Display the active model with node tags only
opsplt.plot_model("nodes")

#### Display specific mode shape with scale factor of 300 using the active model
opsplt.plot_modeshape(5, 300)

###################################
# To save the analysis output for deformed shape, use createODB command before running the analysis
# The following command saves the model data, and output for gravity analysis and the first 3 modes
# in a folder "3DFrame_ODB"

opsplt.createODB("3DFrame", "Gravity", Nmodes=3)

# Define Static Analysis
timeSeries('Linear', 1)
pattern('Plain', 1, 1)
load(72, 1, 0, 0, 0, 0, 0)
analysis('Static')

# Save a recorder for node displacements before running the analysis
fname = 'nodeDisp.txt'
recordNodeDisp(fname)
# Define Static Analysis
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(72, 1, 0, 0, 0, 0, 0)
ops.analysis('Static')

# Run Analysis
analyze(10)
ops.analyze(10)

# IMPORTANT: Make sure to issue a wipe() command to close all the recorders. Not issuing a wipe() command
# ... can cause errors in the plot_deformedshape() command.

ops.wipe()

####################################
### Now plot mode shape 2 with scale factor of 300 and the deformed shape using the recorded output data

# Plot the deformed shape using the recorded displacements at time step # 10.
plot_deformedshape(fname, tstep = 10, scale = 200)
opsplt.plot_modeshape(2, 300, Model="3DFrame")
opsplt.plot_deformedshape(Model="3DFrame", LoadCase="Gravity")
131 changes: 131 additions & 0 deletions pyExamples/demo_cantilever_3el_3d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# import openseespy.opensees as ops
# import openseespy.postprocessing.ops_vis as opsv
import opensees as ops # local compilation
import ops_vis as opsv # local

import matplotlib.pyplot as plt

ops.wipe()

ops.model('basic', '-ndm', 3, '-ndf', 6)

b = 0.2
h = 0.2

A, Iz, Iy, J = 0.04, 0.0001333, 0.0001333, 0.0036

E = 25.0e6
G = 9615384.6

Lx = 4.
Ly = 3.
Lz = 5.

ops.node(1, 0., 0., 0.)
ops.node(2, 0., 0., Lz)
ops.node(3, Lx, 0., Lz)
ops.node(4, Lx, Ly, Lz)

ops.fix(1, 1, 1, 1, 1, 1, 1)

lmass = 200.

ops.mass(2, lmass, lmass, lmass, 0.001, 0.001, 0.001)
ops.mass(3, lmass, lmass, lmass, 0.001, 0.001, 0.001)
ops.mass(4, lmass, lmass, lmass, 0.001, 0.001, 0.001)

gTTagz = 1
gTTagx = 2
gTTagy = 3

coordTransf = 'Linear'
ops.geomTransf(coordTransf, gTTagz, 0., -1., 0.)
ops.geomTransf(coordTransf, gTTagx, 0., -1., 0.)
ops.geomTransf(coordTransf, gTTagy, 1., 0., 0.)

ops.element('elasticBeamColumn', 1, 1, 2, A, E, G, J, Iy, Iz, gTTagz)
ops.element('elasticBeamColumn', 2, 2, 3, A, E, G, J, Iy, Iz, gTTagx)
ops.element('elasticBeamColumn', 3, 3, 4, A, E, G, J, Iy, Iz, gTTagy)

Ew = {}

Px = -4.e1
Py = -2.5e1
Pz = -3.e1

ops.timeSeries('Constant', 1)
ops.pattern('Plain', 1, 1)
ops.load(4, Px, Py, Pz, 0., 0., 0.)

ops.constraints('Transformation')
ops.numberer('RCM')
ops.system('BandGeneral')
ops.test('NormDispIncr', 1.0e-6, 6, 2)
ops.algorithm('Linear')
ops.integrator('LoadControl', 1)
ops.analysis('Static')
ops.analyze(1)


opsv.plot_model()

sfac = 2.0e0

# fig_wi_he = 22., 14.
fig_wi_he = 30., 20.

# - 1
nep = 9
opsv.plot_defo(sfac, nep, fmt_interp='b-', az_el=(-68., 39.),
fig_wi_he=fig_wi_he, endDispFlag=0)

plt.title('3d 3-element cantilever beam')

# - 2
opsv.plot_defo(sfac, 19, fmt_interp='b-', az_el=(6., 30.),
fig_wi_he=fig_wi_he)

plt.title('3d 3-element cantilever beam')

# - 3
nfreq = 6
eigValues = ops.eigen(nfreq)

modeNo = 6

sfac = 2.0e1
opsv.plot_mode_shape(modeNo, sfac, 19, fmt_interp='b-', az_el=(106., 46.),
fig_wi_he=fig_wi_he)
plt.title(f'Mode {modeNo}')

sfacN = 1.e-2
sfacVy = 5.e-2
sfacVz = 1.e-2
sfacMy = 1.e-2
sfacMz = 1.e-2
sfacT = 1.e-2

# plt.figure()
minY, maxY = opsv.section_force_diagram_3d('N', Ew, sfacN)
plt.title(f'Axial force N, max = {maxY:.2f}, min = {minY:.2f}')

minY, maxY = opsv.section_force_diagram_3d('Vy', Ew, sfacVy)
plt.title(f'Transverse force Vy, max = {maxY:.2f}, min = {minY:.2f}')

minY, maxY = opsv.section_force_diagram_3d('Vz', Ew, sfacVz)
plt.title(f'Transverse force Vz, max = {maxY:.2f}, min = {minY:.2f}')

minY, maxY = opsv.section_force_diagram_3d('My', Ew, sfacMy)
plt.title(f'Bending moments My, max = {maxY:.2f}, min = {minY:.2f}')

minY, maxY = opsv.section_force_diagram_3d('Mz', Ew, sfacMz)
plt.title(f'Bending moments Mz, max = {maxY:.2f}, min = {minY:.2f}')

minY, maxY = opsv.section_force_diagram_3d('T', Ew, sfacT)
plt.title(f'Torsional moment T, max = {maxY:.2f}, min = {minY:.2f}')

opsv.plot_extruded_model_rect_section_3d(b, h, fig_wi_he=fig_wi_he)

plt.show()

exit()
Loading

0 comments on commit 0a8b027

Please sign in to comment.