Get OpenSeesPy data for the current domain#

class opstool.vis.GetFEMdata(results_dir='opstool_output')[source]#

Get the data in the openseespy current domain.

Parameters#

results_dir: str, default=”opstool_output”

The directory that results to save.

get_eigen_data(mode_tag=1, solver='-genBandArpack', save_file='EigenData.hdf5')[source]#

Get eigenvalue Analysis Data. The data will saved to file results_dir + save_file.

Parameters#

mode_tag: int

mode tag.

solver: str, default ‘-genBandArpack’

type of solver, optional ‘-genBandArpack’, ‘-fullGenLapack’, see https://openseespydoc.readthedocs.io/en/latest/src/eigen.html.

save_file: str, default=’EigenData.hdf5’

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir.

Returns#

None

get_fiber_data(ele_sec, save_file='FiberData.hdf5')[source]#

Get data from the section assigned by parameter ele_sec.

Parameters#

ele_sec: list[tuple[int, int]]

A list or tuple composed of element tag and sectag. e.g., [(ele1, sec1), (ele2, sec2), … , (elen, secn)], The section is attached to an element in the order from end i to end j of that element.

save_file: str, default=’FiberData.hdf5’

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir.

Returns#

None

get_fiber_resp_step(num_steps=10000000000000, total_time=10000000000000, stop_cond=False, save_file='FiberRespStepData-1.hdf5')[source]#

Get analysis results data for fiber section one step.

Parameters#

num_steps: int, default=10000000000000

Total number of steps, set to determine when to save data.

total_time: float, default=10000000000000

Total analysis time, set to determine when to save data. You can specify one of the parameters num_steps and total_time. If both are used, it depends on which one arrives first.

stop_cond: bool, default = False

Condition used to determine when data is saved if num_steps and total_time unavailable. For example, stop_cond = ops.nodeDisp(nodeTag, 1) >= 0.1, i.e., once the displacement of node with tag nodeTag and dof 1 is greater than 0.1, the loop is terminated to save the data.

save_file: str, default=’FiberRespStepData-1.hdf5’

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir. You need to specify different suffixes to distinguish between the different analysis cases. Such as “FiberRespStepData-1.hdf5”, “FiberRespStepData-2.hdf5”, etc.

Returns#

None

get_frame_resp_step(num_steps=10000000000000, total_time=10000000000000, stop_cond=False, save_file='BeamRespStepData-1.hdf5')[source]#

Get the response data one step.

Note

You need to call this function at each analysis step in OpenSees. The advantage is that you can modify the iterative algorithm at each analysis step to facilitate convergence.

Parameters#

num_steps: int, default=10000000000000

Total number of steps, set to determine when to save data.

total_time: float, default=10000000000000

Total analysis time, set to determine when to save data. You can specify one of the parameters num_steps and total_time. If both are used, it depends on which one arrives first.

stop_cond: bool, default = False

Condition used to determine when data is saved if num_steps and total_time unavailable. For example, stop_cond = ops.nodeDisp(nodeTag, 1) >= 0.1, i.e., once the displacement of node with tag nodeTag and dof 1 is greater than 0.1, the loop is terminated to save the data.

save_file: str, default=’BeamRespStepData-1.hdf5’

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir. You need to specify different suffixes to distinguish between the different analysis cases. Such as “BeamRespStepData-1.hdf5”, “BeamRespStepData-2.hdf5”, etc.

Returns#

None

get_model_data(beam_sec=None, save_file='ModelData.hdf5', print_model_info=True)[source]#

Get data from the current model domain. The data will saved to file results_dir + save_file in hdf5 style.

Parameters#

beam_sec: dict, default=None

Specifies the section geometry for some beam or truss elements for 3D rendering. Such as beam_sec={1: sec_mesh, 2: sec_mesh}, 1 and 2 are beam or truss tags, sec_mesh must be an instance of opstool.preprocessing.SecMesh.

save_file: str, default=”ModelData.hdf5”

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir.

print_model_info: bool, default=True

If True, print the model information.

get_node_react_step(dynamic=False, rayleigh=False, num_steps=10000000000000, total_time=10000000000000, stop_cond=False, save_file='NodeReactionStepData-1.hdf5')[source]#

Get one step the node reactions data.

Parameters#

dynamicbool, optional, by default False

If True, include dynamic effects.

rayleighbool, optional, by default False

If True, iInclude rayleigh damping.

num_steps: int, default=10000000000000

Total number of steps, set to determine when to save data.

total_time: float, default=10000000000000

Total analysis time, set to determine when to save data. You can specify one of the parameters num_steps and total_time. If both are used, it depends on which one arrives first.

stop_cond: bool, default = False

Condition used to determine when data is saved if num_steps and total_time unavailable. For example, stop_cond = ops.nodeDisp(nodeTag, 1) >= 0.1, i.e., once the displacement of node with tag nodeTag and dof 1 is greater than 0.1, the loop is terminated to save the data.

save_file: str, default=’NodeReactionStepData-1.hdf5’

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir. You need to specify different suffixes to distinguish between the different analysis cases. Such as “NodeReactionStepData-1.hdf5”, “NodeReactionStepData-2.hdf5”, etc.

get_node_resp_step(num_steps=10000000000000, total_time=10000000000000, stop_cond=False, save_file='NodeRespStepData-1.hdf5', model_update=False)[source]#

Get the node response data one step.

Note

You need to call this function at each analysis step in OpenSees. The advantage is that you can modify the iterative algorithm at each analysis step to facilitate convergence.

Parameters#

num_steps: int, default=10000000000000

Total number of steps, set to determine when to save data.

total_time: float, default=10000000000000

Total analysis time, set to determine when to save data. You can specify one of the parameters num_steps and total_time. If both are used, it depends on which one arrives first.

stop_cond: bool, default = False

Condition used to determine when data is saved if num_steps and total_time unavailable. For example, stop_cond = ops.nodeDisp(nodeTag, 1) >= 0.1, i.e., once the displacement of node with tag nodeTag and dof 1 is greater than 0.1, the loop is terminated to save the data.

save_file: str, default=’NodeRespStepData-1.hdf5’

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir. You need to specify different suffixes to distinguish between the different analysis cases. Such as “NodeRespStepData-1.hdf5”, “NodeRespStepData-2.hdf5”, etc.

model_update: bool, default False

whether to update the model domain data at each analysis step, this will be useful if model data has changed. For example, some elements and nodes were removed.

Returns#

None

get_resp_step(dynamic=False, rayleigh=False, model_update=False)[source]#

Get all currently supported responses in one step.

Note

This method needs to be used in conjunction with opstool.vis.GetFEMdata.save_resp_all().

Parameters#

dynamicbool, optional, by default False

If True, node reactions will include dynamic effects.

rayleighbool, optional, by default False

If True, node reactions will include rayleigh damping.

model_update: bool, optional, by default False

whether to update the model domain data at each analysis step, this will be useful if model data has changed. For example, some elements and nodes were removed. This parameter is currently only valid for getting node response data, i.e., opstool.vis.GetFEMdata.get_node_resp_step().

reset_eigen_state()[source]#

Reset the state of results extract of eigen data.

reset_model_state()[source]#

Reset the state of results extract of model data.

reset_steps_state()[source]#

Reset the state of results extract in analysis step.

Important

As the data is saved in the loop analysis using the list append method, it is important to clear the data from previous analysis case before each analysis loop.

save_resp_all(save_file='RespStepData-1.hdf5', reset_state=True)[source]#

Save all responses data for all analysis steps at once. This means you need to call it after the loop is over.

Parameters#

save_filestr, optional, by default “RespStepData-1.hdf5”

The file name that data saved. If None of False, the data will not be saved.

Warning

Be careful not to include any path, only filename, the file will be saved to the directory results_dir. You need to specify different suffixes to distinguish between the different analysis cases. Such as “RespStepData-1.hdf5”, “RespStepData-2.hdf5”, etc.

reset_statebool, optional, by default True

If True, the response data from previous analysis cases will be cleared, otherwise it will be included.