the file generated by the recorder command is empty

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
shanwenchen
Posts: 2
Joined: Fri Jul 20, 2018 2:43 am
Location: Chongqing University

the file generated by the recorder command is empty

Post by shanwenchen »

Hi all
I will ask a question of the recorder command. When I built a model using Openseespy and extracted the results, the file, generated by the recorder command, is empty in all of cases.

Below is the code I am using:

Please share your ideas and experiences if any.

Regards,

Code: Select all

from openseespy.opensees import *
import os
wipe()
# set modelbuilder
model('basic', '-ndm', 2, '-ndf', 2)
# create nodes
node(1, 0.0, 0.0)
node(2, 144.0,  0.0)
node(3, 168.0,  0.0)
node(4,  72.0, 96.0)
# set boundary condition
fix(1, 1, 1)
fix(2, 1, 1)
fix(3, 1, 1)
# define materials
uniaxialMaterial("Elastic", 1, 3000.0)
# define elements
element("Truss",1,1,4,10.0,1)
element("Truss",2,2,4,5.0,1)
element("Truss",3,3,4,5.0,1)
# create TimeSeries
timeSeries("Linear", 1)
# create a plain load pattern
pattern("Plain", 1, 1)
# Create the nodal load - command: load nodeID xForce yForce
load(4, 100.0, -50.0)
# ------------------------------
# Start of analysis generation
# ------------------------------
# create SOE
system("BandSPD")
# create DOF number
numberer("RCM")
# create constraint handler
constraints("Plain")
# create integrator
integrator("LoadControl", 1.0)
# create algorithm
algorithm("Linear")
# create analysis object
analysis("Static")
# perform the analysis
analyze(1)
Datadir = r'DataOut'
if not os.path.exists(Datadir):
    os.makedirs(Datadir)
recorder('Node', '-file','DataOut/Out.txt','-closeOnWrite', '-node', 4, '-dof',1,2,3,  'disp')
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: the file generated by the recorder command is empty

Post by mhscott »

You have to create the recorder before the analysis.
shanwenchen
Posts: 2
Joined: Fri Jul 20, 2018 2:43 am
Location: Chongqing University

Re: the file generated by the recorder command is empty

Post by shanwenchen »

mhscott wrote: Tue Apr 26, 2022 5:09 am You have to create the recorder before the analysis.
Thank you! I have solved the problem through your kind help!
Post Reply