Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Use provided OpenSees, add OpenSees for Ubuntu 16.04
Browse files Browse the repository at this point in the history
  • Loading branch information
daniviga committed Apr 28, 2017
1 parent 947ae04 commit ec2ca72
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
File renamed without changes.
Binary file added bin/OpenSees.u1604
Binary file not shown.
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import numpy
import math
import csv
import matplotlib.pyplot as plt
from sys import platform
from rmtk.vulnerability.common import utils
import subprocess

def calculate_fragility(capacity_curves, hysteresis, msa, gmrs,damage_model,damping,degradation):

Expand Down Expand Up @@ -64,16 +63,18 @@ def run_time_history_analysis(capacity_curves, hysteresis, icc,gmrs,target_name,
create_SDOF_paramfile(capacity_curves, hysteresis, icc,damping,degradation)

tcl = "simplestSDOFgen.tcl"

try:
subprocess.call(["OpenSees", tcl])
except OSError:
try:
subprocess.call(["./OpenSees", tcl])
if 'darwin' in platform:
subprocess.call(["../../../../bin/OpenSees.mac", tcl])
elif 'linux' in platform:
subprocess.call(["../../../../bin/OpenSees.u1604", tcl])
except:
raise OSError('OpenSees not found')


disps = []
time = []
disp_file = open('NodeD.out')
Expand Down
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import numpy
import math
import matplotlib.pyplot as plt
from sys import platform
from rmtk.vulnerability.common import utils
import subprocess

def calculate_fragility(capacity_curves, hysteresis, gmrs,damage_model,damping,degradation):

Expand Down Expand Up @@ -34,7 +32,10 @@ def run_time_history_analysis(capacity_curves, hysteresis, icc,gmrs,igmr,damping
subprocess.call(["OpenSees", tcl])
except OSError:
try:
subprocess.call(["./OpenSees", tcl])
if 'darwin' in platform:
subprocess.call(["../../../../bin/OpenSees.mac", tcl])
elif 'linux' in platform:
subprocess.call(["../../../../bin/OpenSees.u1604", tcl])
except:
raise OSError('OpenSees not found')

Expand Down
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import csv
import numpy
import scipy
from sys import platform
from rmtk.vulnerability.common import utils
import csv

def calculate_fragility(capacity_curves, hysteresis, msa, gmrs,gmr_characteristics,damage_model,damping,degradation,number_models_in_DS):

Expand Down Expand Up @@ -189,9 +191,19 @@ def run_time_history_analysis(capacity_curves, hysteresis, icc,gmrs,target_name,
igmr = gmrs['name'].index(target_name)
write_gmr(gmrs,igmr, scaling_factor)
create_SDOF_paramfile(capacity_curves, hysteresis, icc,damping,degradation)
# os.system('chmod +x OpenSees')
os.system('./OpenSees simplestSDOFgen.tcl')

tcl = 'simplestSDOFgen.tcl'

try:
subprocess.call(["OpenSees", tcl])
except OSError:
try:
if 'darwin' in platform:
subprocess.call(["../../../../bin/OpenSees.mac", tcl])
elif 'linux' in platform:
subprocess.call(["../../../../bin/OpenSees.u1604", tcl])
except:
raise OSError('OpenSees not found')

disps = []
time = []
disp_file = open('NodeD.out')
Expand Down

0 comments on commit ec2ca72

Please sign in to comment.