Fiber section visualization in the OpenSeesPy domain#
Geometric Visualization#
- opstool.vis.plot_fiber_sec(ele_sec, results_dir='opstool_output', input_file='FiberData.hdf5', line_width=0.75, line_color='k', colormap='viridis', opacity=0.75, mat_color=None, plot_style='ggplot')[source]#
plot the fiber section geometry.
Parameters#
- results_dir: str, default=”opstool_output”
The dir that results saved.
- input_file: str, default=’FiberData.hdf5’
The file name that fiber section data saved. .. warning:
Be careful not to include any path, only filename, the file will be loaded from the directory ``results_dir``.
- ele_sec: list[tuple[int, int]]
A list or tuple composed of element tag and sectag to plot. 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.
- line_width: float, default = 0.75
The line width of mesh edges.
- line_color: str, default = “k”
The color of mesh edges.
- colormap: str, default = “jet”
Color map used to display the response.
- opacity: float, default=0.75
Transparency of mesh.
- mat_color: dict
Dict for assign color by matTag, {matTag1:color1,matTag2:color2, and so on} matTag is the material tag defined in openseespy, bu it must in the section.
- plot_style: str, matplotlib plot style, default=’ggplot’
See https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html
Returns#
None
Response Visualization#
- class opstool.vis.FiberSecVis(results_dir='opstool_output', input_file='FiberRespStepData-1.hdf5', line_width=0.75, line_color='k', colormap='viridis', opacity=0.75)[source]#
A class to vis the fiber section responses in OpenSeesPy.
Warning
This class is currently only available for 3D models, as fiber coordinates cannot be extracted for 2D models.
Parameters#
- results_dir: str, default=”opstool_output”
The dir that results saved.
- input_file: str, default=’FiberRespStepData-1.hdf5’
The file name that fiber section responses saved.
- line_width: float, default = 0.75
The line width of mesh edges.
- line_color: str, default = “k”
The color of mesh edges.
- colormap: str, default = “jet”
Color map used to display the response.
- opacity: float, default=0.75
Transparency of mesh.
Returns#
FiberSecVis instance.
- animation(output_file, ele_tag, sec_tag, show_variable='strain', show_mats=None, framerate=24, plot_style='ggplot')[source]#
fiber section response animation.
Parameters#
- output_file: str
The output file name, must end with .gif.
- ele_tag: int
The element tag to which the section is to be displayed.
- sec_tag: int
Which integration point section is displayed, tag from 1 from segment i to j.
- show_variable: str, default=’strain
Response type to display, optional “stress” or “strain”.
- show_mats: Union[int, list[int], tuple[int]], default=None
Mat tag to dispaly. If None, all tags will display.
- framerate: int, default=24
The number of frames per second.
- plot_style: str, matplotlib plot style, default=’ggplot’
See https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html
Returns#
None
- force_defo_vis(ele_tag, sec_tag, force_type='Mz', defo_type='Phiz')[source]#
fiber section response vis.
Parameters#
- ele_tag: int
The element tag to which the section is to be displayed.
- sec_tag: int
Which integration point section is displayed, tag from 1 from segment i to j.
- force_type: str, default = “Mz”
Force type to plot, optional [“P”, “Mz”, “My”].
- defo_type: str, default = “Phiz”
Deformation type to plot, optional [“eps”, “Phiz”, “Phiy”].
Returns#
- (numpy.1D Array, numpy.1D Array)
Deformation Array, Force Array.
- resp_vis(ele_tag, sec_tag, step=None, show_variable='strain', show_mats=None, plot_style='ggplot')[source]#
fiber section response vis.
Parameters#
- ele_tag: int
The element tag to which the section is to be displayed.
- sec_tag: int
Which integration point section is displayed, tag from 1 from segment i to j.
- step: int, default = None
Analysis step to display. If None, the step that max response; If -1, the final step; Else, the other step.
- show_variable: str, default = ‘srain’
Response type to display, optional “stress” or “strain”.
- show_mats: Union[int, list[int], tuple[int]]
matTags to dispaly. matTag is the material tag defined in openseespy, bu it must in the section. If None, all tags will display.
- plot_style: str, matplotlib plot style, default=’ggplot’
See https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html
Returns#
None
- sec_vis(ele_tag, sec_tag, mat_color=None, plot_style='ggplot')[source]#
plot the fiber section.
Parameters#
- ele_tag: int
The element tag to which the section is to be displayed.
- sec_tag: int
Which integration point section is displayed, tag from 1 from segment i to j.
- mat_color: dict
Dict for assign color by matTag, {matTag1:color1,matTag2:color2, and so on} matTag is the material tag defined in openseespy, bu it must in the section.
- plot_style: str, matplotlib plot style, default=’ggplot’
See https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html
Returns#
None