Postprocessing

Data Saving

opstool.post.save_model_data(odb_tag=1)[source]

Save the model data from the current domain.

Note

Since this package chooses xarray as the data structure, it is saved in netCDF format.

Parameters

odb_tag: Union[str, int], default = 1

Output database tag, the data will be saved in ModelData-{odb_tag}.nc.

opstool.post.save_eigen_data(odb_tag=1, mode_tag=1, solver='-genBandArpack')[source]

Save modal analysis data.

Parameters

odb_tag: Union[str, int], default = 1

Output database tag, the data will be saved in EigenData-{odb_tag}.nc.

mode_tagint, optional,

Modal tag, all modal data smaller than this modal tag will be saved, by default 1

solverstr, optional,

OpenSees’ eigenvalue analysis solver, by default “-genBandArpack”. See eigen Command

class opstool.post.CreateODB(odb_tag=1, model_update=False, save_nodal_resp=True, save_frame_resp=True, save_truss_resp=True, save_link_resp=True, save_shell_resp=True, save_fiber_sec_resp=True, save_plane_resp=True, save_brick_resp=True)[source]

Create an output database (ODB) to save response data.

Parameters

odb_tag: Union[int, str], default: 1

Tag of output databases (ODB) to be saved.

model_update: bool, default: False

Whether to update the model data.

Note

If True, the model data will be updated at each step. If no nodes and elements are added or removed during the analysis of your model, keep this parameter set to `False`. Enabling model updates unnecessarily can increase memory usage and slow down performance.

save_nodal_resp: bool, default: True

Whether to save nodal responses.

save_frame_resp: bool, default: True

Whether to save frame element responses.

save_truss_resp: bool, default: True

Whether to save truss element responses.

save_link_resp: bool, default: True

Whether to save link element responses.

save_shell_resp: bool, default: True

Whether to save shell element responses.

save_fiber_sec_resp: bool, default: True

Whether to save fiber section responses.

save_plane_resp: bool, default: True

Whether to save plane element responses.

save_brick_resp: bool, default: True

Whether to save brick element responses.

fetch_response_step(print_info=False)[source]

Extract response data for the current moment.

Parameters

print_info: bool, optional

print information, by default, False

save_response()[source]

Save all response data to a file name RespStepData-{odb_tag}.nc.

save_eigen_data(mode_tag=1, solver='-genBandArpack')[source]

Save modal analysis data.

Parameters

mode_tagint, optional,

Modal tag, all modal data smaller than this modal tag will be saved, by default 1

solverstr, optional,

OpenSees’ eigenvalue analysis solver, by default “-genBandArpack”.

save_model_data()[source]

Save the model data from the current domain.

Result Reading

opstool.post.get_eigen_data(odb_tag=None)[source]

Get the eigenvalue data from the saved file.

Parameters

odb_tag: Union[int, str], default: None

Tag of output databases (ODB) have been saved.

Returns

modal_props: xr.DataArray

Modal properties’ data.

eigenvectors: xr.DataArray

Eigen vectors data.

opstool.post.get_nodal_responses(odb_tag, resp_type=None, node_tags=None)[source]

Read nodal responses data from a file.

Return type:

Dataset

Parameters

odb_tag: Union[int, str], default: one

Tag of output databases (ODB) to be read.

resp_type: str, default: disp

Type of response to be read. Optional:

  • “disp” - Displacement at the node.

  • “vel” - Velocity at the node.

  • “accel” - Acceleration at the node.

  • “reaction” - Reaction forces at the node.

  • “reactionIncInertia” - Reaction forces including inertial effects.

  • “rayleighForces” - Forces resulting from Rayleigh damping.

  • “pressure” - Pressure applied to the node.

  • If None, return all responses.

node_tags: Union[list, tuple, int], default: None

Node tags to be read. Such as [1, 2, 3] or numpy.array([1, 2, 3]) or 1. If None, return all nodal responses.

Note

If some nodes are deleted during the analysis, their response data will be filled with numpy.nan.

Returns

NodalResp: xarray.Dataset

Nodal responses’ data.

Note

The returned data can be viewed using .dims and .coords to view the dimension names and coordinates. You can further index or process the data.

opstool.post.get_element_responses(odb_tag, ele_type, resp_type=None, ele_tags=None)[source]

Read nodal responses data from a file.

Return type:

Dataset

Parameters

odb_tag: Union[int, str], default: one

Tag of output databases (ODB) to be read.

ele_type: str, default: Frame

Type of element to be read. Optional: “Frame”, “Truss”, “Link”, “Shell”, “Plane”, “Brick”.

resp_type: str, default: disp

The response type, which depends on the parameter ele_type. If None, return all responses to that ele_type.

  1. For Frame:
    • “localForces”: Local forces in the element local coordinate system.

    • “basicForces”: Basic forces in the element basic coordinate system.

    • “basicDeformations”: Basic deformations in the element basic coordinate system.

    • “plasticDeformation”: Plastic deformations in the element basic coordinate system.

    • “sectionForces”: Section forces in the element coordinate system.

    • “sectionDeformations”: Section deformations in the element coordinate system.

    • “sectionLocs”: Section locations, 0.0 to 1.0.

  2. For Truss:
    • “axialForce”: Axial force.

    • “axialDefo”: Axial deformation.

    • “Stress”: Stress of material.

    • “Strain”: Strain of material.

  3. For Link:
    • “basicDeformation”: Basic deformation, i.e., pure deformation.

    • “basicForce”: Basic force.

  4. For Shell:
    • “sectionForces”: Sectional forces at Gauss points (per unit length).

    • “sectionDeformations”: Sectional deformation at Gauss points (per unit length).

  5. For Plane:
    • “stresses”: Stresses at Gauss points.

    • “strains”: Strains at Gauss points.

  6. For Brick:
    • “stresses”: Stresses at Gauss points.

    • “strains”: Strains at Gauss points.

ele_tags: Union[list, tuple, int], default: None

Element tags to be read. Such as [1, 2, 3] or numpy.array([1, 2, 3]) or 1. If None, return all nodal responses.

Note

If some nodes are deleted during the analysis, their response data will be filled with numpy.nan.

Returns

EleResp: xarray.Dataset

Element responses’ data.

Note

The returned data can be viewed using .dims.coords and .attrs to view the dimension names and coordinates. You can further index or process the data.