Child pages
  • Mox_OpenSees_Tutorial
Skip to end of metadata
Go to start of metadata


This page is in a tutorial format for new Hyak users. It describes how to build and use OpenSees on mox.hyak. It is more detailed than the page Mox_OpenSees.

Building OpenSees

Below are the steps to build OpenSees. Here xyz is your group name and abc is your hyak userid.

(0) ssh abc@mox.hyak.uw.edu

(1) Run below command to get a build node for 4 hours with 10GB memory. A build node can access the internet. (Regular mox compute nodes cannot access the internet.) For this tutorial, we need a build node because we will use git.

srun -p build --time=4:00:00 --mem=10G --pty /bin/bash

(2) Make your directory on /gscratch/scrubbed. Note that data older than 30 days is deleted on /gscratch/scrubbed.  Using /gscratch/scrubbed is fine for this tutorial but for more permanent storgae, you should use make a directory /gscratch/xyz/abc and then use it for storing your data.)

     mkdir /gscratch/scrubbed/abc

     mkdir /gscratch/scrubbed/abc/opensees

(3) cd /gscratch/scrubbed/abc/opensees

(4) mkdir lib

(5) mkdir bin

(6) git clone https://github.com/OpenSees/OpenSees

(7) cd OpenSees

(8) cd MAKES

(9) cp Makefile.def.EC2-REDHAT-ENTERPRISE ../Makefile.def

(10) cd ..

(11) export HOME=/gscratch/scrubbed/abc/opensees

(12) pwd (verify that you are in the directory /gscratch/scrubbed/abc/opensees/OpenSees)

(13) Now make below changes to the file Makefile.def . (You can use the vi or nano or emacs text editors.)

(a) Delete -Wl option in below line in Makefile.def
LINKFLAGS = -rdynamic -Wl
After the the change, the line should look like below:
LINKFLAGS = -rdynamic

(b) Fix a typo. Change the libCBlas.a on the right hand side of this line to libCSparse.a .
CSPARSE_LIBRARY = $(HOME)/lib/libCBlas.a

After the the change, the line should look like below:
CSPARSE_LIBRARY = $(HOME)/lib/libCSparse.a

(14) Run below command to build the OpenSees executable. This command will take some time. (About ten minutes on a mox build node.)

make

(15) After the make ends, the OpenSees executable will be in /gscratch/scrubbed/abc/opensees/bin

(16) cd /gscratch/scrubbed/abc/opensees/bin

(17) Run below command to get the OpenSees command prompt:
./OpenSees


OpenSees -- Open System For Earthquake Engineering Simulation
Pacific Earthquake Engineering Research Center
Version 3.0.3 32-Bit

(c) Copyright 1999-2016 The Regents of the University of California
All Rights Reserved
(Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)


OpenSees >

(18) Enter quit to leave the OpenSees command prompt.
OpenSees > quit

(19) Change HOME back to your home directory. Below abc is your userid.
export HOME=/usr/lusers/abc

(20) Optional: Use below command to put the OpenSees executable in your PATH
export PATH=/gscratch/scrubbed/abc/opensees/bin:$PATH


Using OpenSees

Below is an example of running OpenSees on mox. You should change the path for the ExampleScripts directory appropriately.

(a) cd /gscratch/scrubbed/abc/opensees/OpenSees/EXAMPLES/ExampleScripts

(b) If you have done step 20 then you can issue the below command:

         OpenSees

     If you have not done step 20 then you can issue the below command:

        /gscratch/scrubbed/abc/opensees/bin/OpenSees

     You can also use the pre-compiled OpenSees with the below command:

        /sw/contrib/opensees/OpenSees

(c) After running the above OpenSees command, you will see the OpenSees prompt

(d) Issue the command below at the OpenSees prompt

source Example1.1.tcl

(e) Below is the output of steps (a) to (d)


OpenSees -- Open System For Earthquake Engineering Simulation
Pacific Earthquake Engineering Research Center
Version 3.0.3 32-Bit

(c) Copyright 1999-2016 The Regents of the University of California
All Rights Reserved
(Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)


OpenSees > source Example1.1.tcl

Node: 4
Coordinates : 72 96
Disps: 0.530093 -0.177894
Velocities : 0 0
unbalanced Load: 100 -50
ID : 0 1

Element: 1 type: Truss iNode: 1 jNode: 4 Area: 10 Mass/Length: 0 cMass: 0
strain: 0.00146451 axial load: 43.9352
unbalanced load: -26.3611 -35.1482 26.3611 35.1482
Material:
Element: 2 type: Truss iNode: 2 jNode: 4 Area: 5 Mass/Length: 0 cMass: 0
strain: -0.00383642 axial load: -57.5463
unbalanced load: -34.5278 46.0371 34.5278 -46.0371
Material:
Element: 3 type: TrussSection iNode: 3 jNode: 4 Mass density/length: 0 cMass: 0
strain: -0.00368743 axial load: -55.3114
unbalanced load: 55.3114 55.3114 -55.3114 -55.3114
Section:

Node: 4
Coordinates : 72 96
Disps: 0.530093 -0.177894
Velocities : 0 0
unbalanced Load: 100 -50
ID : 0 1


CorotTruss, tag: 1
Connected Nodes: 1 4
Section Area: 10
Undeformed Length: 120
Current Length: 120.177
Mass Density/Length: 0
Consistent Mass: 0
Rotation matrix:
Axial Force: 44.2283
UniaxialMaterial, tag: 1

CorotTruss, tag: 2
Connected Nodes: 2 4
Section Area: 5
Undeformed Length: 120
Current Length: 119.54
Mass Density/Length: 0
Consistent Mass: 0
Rotation matrix:
Axial Force: -57.4937
UniaxialMaterial, tag: 1

CorotTrussSection, tag: 3
Connected Nodes: 3 4
Undeformed Length: 135.765
Current Length: 135.264
Mass Density/Length: 0
Consistent Mass: 0
Rotation matrix:
Section, tag: 1
OpenSees >

  • No labels