Plotly-based Visualization¶
- opstool.vis.plotly.set_plot_props(*, point_size=3.0, line_width=5.0, cmap=None, cmap_model=None, theme='plotly', scale_factor=0.05, show_mesh_edges=True, mesh_edge_color='black', mesh_edge_width=1.0, mesh_opacity=1.0, font_size=15, title_font_size=18, font_family='Arial, sans-serif', window_size=(None, None))[source]¶
Set ploting properties.
Parameters¶
- point_sizefloat, optional
Point size of any nodes. Default
5.0- line_widthfloat, optional
Thickness of line elements. Only valid for wireframe and surface representations. Default
3.0.- cmapstr, list, optional, default: “plasma”
One of the following named colorscales: [‘aggrnyl’, ‘agsunset’, ‘algae’, ‘amp’, ‘armyrose’, ‘balance’, ‘blackbody’, ‘bluered’, ‘blues’, ‘blugrn’, ‘bluyl’, ‘brbg’, ‘brwnyl’, ‘bugn’, ‘bupu’, ‘burg’, ‘burgyl’, ‘cividis’, ‘curl’, ‘darkmint’, ‘deep’, ‘delta’, ‘dense’, ‘earth’, ‘edge’, ‘electric’, ‘emrld’, ‘fall’, ‘geyser’, ‘gnbu’, ‘gray’, ‘greens’, ‘greys’, ‘haline’, ‘hot’, ‘hsv’, ‘ice’, ‘icefire’, ‘inferno’, ‘jet’, ‘magenta’, ‘magma’, ‘matter’, ‘mint’, ‘mrybm’, ‘mygbm’, ‘oranges’, ‘orrd’, ‘oryel’, ‘oxy’, ‘peach’, ‘phase’, ‘picnic’, ‘pinkyl’, ‘piyg’, ‘plasma’, ‘plotly3’, ‘portland’, ‘prgn’, ‘pubu’, ‘pubugn’, ‘puor’, ‘purd’, ‘purp’, ‘purples’, ‘purpor’, ‘rainbow’, ‘rdbu’, ‘rdgy’, ‘rdpu’, ‘rdylbu’, ‘rdylgn’, ‘redor’, ‘reds’, ‘solar’, ‘spectral’, ‘speed’, ‘sunset’, ‘sunsetdark’, ‘teal’, ‘tealgrn’, ‘tealrose’, ‘tempo’, ‘temps’, ‘thermal’, ‘tropic’, ‘turbid’, ‘turbo’, ‘twilight’, ‘viridis’, ‘ylgn’, ‘ylgnbu’, ‘ylorbr’, ‘ylorrd’].
Appending ‘_r’ to a named colorscale reverses it.
- cmap_modelstr, list, optional, default=None
Matplotlib colormap used for geometry model visualization. Same as
cmap, except that this parameter will be used for geometry model visualization and will be automatically mapped according to different element types. If None, If None, the color specified in the function``set_plot_colors`` will be used.Available color maps are shown in Colormaps in Matplotlib
- themestr, optional, default: “plotly”
Available theme templates for plotly: [‘ggplot2’, ‘seaborn’, ‘simple_white’, ‘plotly’, ‘plotly_white’, ‘plotly_dark’, ‘presentation’, ‘xgridoff’, ‘ygridoff’, ‘gridon’, ‘none’]
- window_sizelist, optional
Window size in pixels. Default to
(None, None)- show_mesh_edges: bool, default: True
Whether to display the mesh edges of
planes,plates,shells, andsolidelements.- mesh_edge_color: str, default: black
Color of the mesh edges for
planes,plates,shells, andsolidelements.- mesh_edge_width: float, default: 1.0
Width of the mesh edges for
planes,plates,shells, andsolidelements.- mesh_opacity: float, default: 1.0
Display opacity for
planes,plates,shells, andsolidelements.- font_familystr, optional, default: “Arial, sans-serif”
HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren’t available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include “Arial”, “Balto”, “Courier New”, “Droid Sans”, “Droid Serif”, “Droid Sans Mono”, “Gravitas One”, “Old Standard TT”, “Open Sans”, “Overpass”, “PT Sans Narrow”, “Raleway”, “Times New Roman”.
- scale_factorfloat, optional
Scale factor between the maximum deformation of the model and the maximum boundary size. Default
1 / 20.- font_size: int, default: 15
Font size of labels.
- title_font_size: int, default: 18
Font size of title.
Returns¶
None
- opstool.vis.plotly.set_plot_colors(point='#580f41', frame='#0652ff', truss='#FF8C00', link='#39FF14', shell='#76b852', plane='#00FFFF', brick='#FF4500', tet='#FFFF33', joint='#7FFF00', contact='#ff9408', pfem='#8080FF', constraint='#FF1493', bc='#15b01a', cmap=None, cmap_model=None)[source]¶
Set the display color of various element types.
Parameters¶
- pointstr, list[int, int, int], optional
Color for nodal points. Either a string, RGB list, or hex color string. For example,
point='white',point='w',point=[1, 1, 1], orpoint='#FFFFFF'. frame : str, list[int, int, int], optional Color for frame elements.- framestr, list[int, int, int], optional
Color for frame elements.
- trussstr, list[int, int, int], optional
Color for truss elements.
- linkstr, list[int, int, int], optional
Color for link elements.
- shellstr, list[int, int, int], optional
Color for shell elements.
- planestr, list[int, int, int], optional
Color for plane elements.
- brickstr, list[int, int, int], optional
Color for brick (solid) elements.
- tetstr, list[int, int, int], optional
Color for tetrahedral (solid) elements.
- jointstr, list[int, int, int], optional
Color for beam-column joint elements.
- contactstr, list[int, int, int], optional
Color for contact elements.
- pfemstr, list[int, int, int], optional
Color for PFEM elements.
- constraintstr, list[int, int, int], optional
Color for constraint.
- bcstr, list[int, int, int], optional
Color for boundary conditions.
- cmapstr, list, optional, default: “plasma”
One of the following named colorscales: [‘aggrnyl’, ‘agsunset’, ‘algae’, ‘amp’, ‘armyrose’, ‘balance’, ‘blackbody’, ‘bluered’, ‘blues’, ‘blugrn’, ‘bluyl’, ‘brbg’, ‘brwnyl’, ‘bugn’, ‘bupu’, ‘burg’, ‘burgyl’, ‘cividis’, ‘curl’, ‘darkmint’, ‘deep’, ‘delta’, ‘dense’, ‘earth’, ‘edge’, ‘electric’, ‘emrld’, ‘fall’, ‘geyser’, ‘gnbu’, ‘gray’, ‘greens’, ‘greys’, ‘haline’, ‘hot’, ‘hsv’, ‘ice’, ‘icefire’, ‘inferno’, ‘jet’, ‘magenta’, ‘magma’, ‘matter’, ‘mint’, ‘mrybm’, ‘mygbm’, ‘oranges’, ‘orrd’, ‘oryel’, ‘oxy’, ‘peach’, ‘phase’, ‘picnic’, ‘pinkyl’, ‘piyg’, ‘plasma’, ‘plotly3’, ‘portland’, ‘prgn’, ‘pubu’, ‘pubugn’, ‘puor’, ‘purd’, ‘purp’, ‘purples’, ‘purpor’, ‘rainbow’, ‘rdbu’, ‘rdgy’, ‘rdpu’, ‘rdylbu’, ‘rdylgn’, ‘redor’, ‘reds’, ‘solar’, ‘spectral’, ‘speed’, ‘sunset’, ‘sunsetdark’, ‘teal’, ‘tealgrn’, ‘tealrose’, ‘tempo’, ‘temps’, ‘thermal’, ‘tropic’, ‘turbid’, ‘turbo’, ‘twilight’, ‘viridis’, ‘ylgn’, ‘ylgnbu’, ‘ylorbr’, ‘ylorrd’].
Appending ‘_r’ to a named colorscale reverses it.
- cmap_modelstr, list, optional, default=None
Matplotlib colormap used for geometry model visualization. Same as
cmap, except that this parameter will be used for geometry model visualization and will be automatically mapped according to different element types. If None, If None, the color specified in the function``set_plot_colors`` will be used.Available color maps are shown in Colormaps in Matplotlib
Returns¶
None
- opstool.vis.plotly.plot_model(odb_tag=None, show_node_numbering=False, show_ele_numbering=False, show_ele_hover=True, style='surface', color=None, show_bc=True, bc_scale=1.0, show_link=True, show_mp_constraint=True, show_constraint_dofs=False, show_nodal_loads=False, show_ele_loads=False, load_scale=1.0, show_local_axes=False, local_axes_scale=1.0, show_outline=True)[source]¶
Geometric model visualization based on
plotly.Parameters¶
- odb_tag: Union[int, str], default: None
Tag of output databases (ODB) to be visualized. If None, data will be saved automatically.
- show_node_numbering: bool, default: False
Whether to display node tag labels.
- show_ele_numbering: bool, default: False
Whether to display element tag labels.
- show_ele_hover: bool, default: True
Whether to display element tag labels when hovering over the element.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
- color: str, default: black
Model display color.
- show_bc: bool, default: True
Whether to display boundary supports.
- bc_scale: float, default: 1.0
Scale the size of boundary support display.
- show_link: bool, default: True
Whether to show link elements.
- show_mp_constraint: bool, default: True
Whether to show multipoint (MP) constraint.
- show_constraint_dofs: bool, default: False
Whether to show dofs of mp-constraints.
- show_nodal_loads: bool, default: False
Whether to show nodal loads.
- show_ele_loads: bool, default: False
Whether to show element loads.
- load_scale: float, default: 1.0
Scale the size of load arrow presentation.
- show_local_axes: bool, default: False
Whether to display element local axes, including
beam-column,link, andshellelements.- local_axes_scale: float, default: 1.0
Scales the presentation size of the local axes.
- show_outline: bool, default: False
Whether to display the outline of the model.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_eigen(mode_tags, odb_tag=None, subplots=False, scale=1.0, show_outline=False, show_origin=False, style='surface', show_bc=True, bc_scale=1.0, show_mp_constraint=True, solver='-genBandArpack')[source]¶
Modal visualization.
Parameters¶
- mode_tags: Union[List, Tuple]
The modal range to visualize, [mode i, mode j].
- odb_tag: Union[int, str], default: None
Tag of output databases (ODB) to be visualized. If None, the data will be saved automatically.
- subplots: bool, default: False
If True, multiple subplots are used to present mode i to mode j. Otherwise, they are presented as slides.
- scale: float, default: 1.0
Zoom the presentation size of the mode shapes.
- show_outline: bool, default: False
Whether to display the outline of the model.
- show_origin: bool, default: False
Whether to show the undeformed shape.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
- show_bc: bool, default: True
Whether to display boundary supports.
- bc_scale: float, default: 1.0
Scale the size of boundary support display.
- show_mp_constraint: bool, default: True
Whether to show multipoint (MP) constraint.
- solverstr, optional,
OpenSees’ eigenvalue analysis solver, by default “-genBandArpack”.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_eigen_animation(mode_tag, odb_tag=None, n_cycle=5, framerate=3, scale=1.0, solver='-genBandArpack', show_outline=False, show_origin=False, style='surface', show_bc=True, bc_scale=1.0, show_mp_constraint=True)[source]¶
Modal animation visualization.
Parameters¶
- mode_tag: int
The mode tag to display.
- odb_tag: Union[int, str], default: None
Tag of output databases (ODB) to be visualized. If None, the data will be saved automatically.
- n_cycle: int, default: five
Number of cycles for the display.
- framerate: int, default: three
Framerate for the display, i.e., the number of frames per second.
- scale: float, default: 1.0
Zoom the presentation size of the mode shapes.
- solverstr, optional,
OpenSees’ eigenvalue analysis solver, by default “-genBandArpack”.
- show_outline: bool, default: False
Whether to display the outline of the model.
- show_origin: bool, default: False
Whether to show the undeformed shape.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
- show_bc: bool, default: True
Whether to display boundary supports.
- bc_scale: float, default: 1.0
Scale the size of boundary support display.
- show_mp_constraint: bool, default: True
Whether to show multipoint (MP) constraint.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_eigen_table(mode_tags, odb_tag=1, solver='-genBandArpack')[source]¶
Plot Modal Properties Table.
Parameters¶
- mode_tags: Union[List, Tuple]
The modal range to visualize, [mode i, mode j].
- odb_tag: Union[int, str], default: None
Tag of output databases (ODB) to be visualized.
- solverstr, optional,
OpenSees’ eigenvalue analysis solver, by default “-genBandArpack”.
Returns¶
None
- opstool.vis.plotly.plot_nodal_responses(odb_tag=1, slides=False, scale=1.0, show_defo=True, resp_type='disp', resp_dof=('UX', 'UY', 'UZ'), show_bc=True, bc_scale=1.0, show_mp_constraint=False, show_undeformed=False, style='surface', show_outline=False)[source]¶
Visualizing Node Responses.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- slides: bool, default: False
Display the response for each step in the form of a slideshow. Otherwise, show the step with the largest response.
- scale: float, default: 1.0
Scales the size of the deformation presentation.
- show_defo: bool, default: True
Whether to display the deformed shape.
- resp_type: str, default: disp
Type of response to be visualized. Optional: “disp”, “vel”, “accel”, “reaction”, “reactionIncInertia”, “rayleighForces”, “pressure”.
- resp_dof: str, default: (“UX”, “UY”, “UZ”)
Component to be visualized. Optional: “UX”, “UY”, “UZ”, “RX”, “RY”, “RZ”. You can also pass on a list or tuple to display multiple dimensions, for example, [“UX”, “UY”], [“UX”, “UY”, “UZ”], [“RX”, “RY”, “RZ”], [“RX”, “RY”], [“RY”, “RZ”], [“RX”, “RZ”], and so on.
Note
If the nodes include fluid pressure dof, such as those used for …UP elements, the pore pressure should be extracted using
resp_type="vel", andresp_dof="UZ".- show_bc: bool, default: True
Whether to display boundary supports.
- bc_scale: float, default: 1.0
Scale the size of boundary support display.
- show_mp_constraint: bool, default: False
Whether to show multipoint (MP) constraint.
- show_undeformed: bool, default: False
Whether to show the undeformed shape of the model.
- show_outline: bool, default: False
Whether to display the outline of the model.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’, style=’wireframe’, style=’points’, style=’points_gaussian’. Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_nodal_responses_animation(odb_tag=1, framerate=None, scale=1.0, show_defo=True, resp_type='disp', resp_dof=('UX', 'UY', 'UZ'), show_bc=True, bc_scale=1.0, show_mp_constraint=False, show_undeformed=False, style='surface', show_outline=False)[source]¶
Visualize node response animation.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- framerate: int, default: 5
Framerate for the display, i.e., the number of frames per second.
- scale: float, default: 1.0
Scales the size of the deformation presentation.
- show_defo: bool, default: True
Whether to display the deformed shape.
- resp_type: str, default: disp
Type of response to be visualized. Optional: “disp”, “vel”, “accel”, “reaction”, “reactionIncInertia”, “rayleighForces”, “pressure”.
- resp_dof: str, default: (“UX”, “UY”, “UZ”)
Component to be visualized. Optional: “UX”, “UY”, “UZ”, “RX”, “RY”, “RZ”. You can also pass on a list or tuple to display multiple dimensions, for example, [“UX”, “UY”], [“UX”, “UY”, “UZ”], [“RX”, “RY”, “RZ”], [“RX”, “RY”], [“RY”, “RZ”], [“RX”, “RZ”], and so on.
- show_bc: bool, default: True
Whether to display boundary supports.
- bc_scale: float, default: 1.0
Scale the size of boundary support display.
- show_mp_constraint: bool, default: False
Whether to show multipoint (MP) constraint.
- show_undeformed: bool, default: False
Whether to show the undeformed shape of the model.
- show_outline: bool, default: False
Whether to display the outline of the model.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_truss_responses(odb_tag=1, ele_tags=None, slides=False, show_values=True, resp_type='axialForce', alpha=1.0, show_outline=False, line_width=1.5)[source]¶
Visualizing Truss Response.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of truss elements to be visualized. If None, all truss elements are selected.
- slides: bool, default: False
Display the response for each step in the form of a slideshow. Otherwise, show the step with the largest response.
- show_values: bool, default: True
Whether to display the response value.
- resp_type: str, default: “axialForce”
Response type, optional, one of [“axialForce”, “axialDefo”, “Stress”, “Strain”].
- alpha: float, default: 1.0
Scale the size of the response graph.
Note
You can adjust the scale to make the response graph more visible. A negative number will reverse the direction.
- show_outline: bool, default: False
Whether to display the outline of the model.
- line_width: float, default: 1.5.
Line width of the response graph.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_truss_responses_animation(odb_tag=1, ele_tags=None, framerate=None, show_values=False, resp_type='axialForce', alpha=1.0, show_outline=False, line_width=1.5)[source]¶
Truss response animation.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of truss elements to be visualized. If None, all truss elements are selected.
- framerate: int, default: None
Framerate for the display, i.e., the number of frames per second.
- show_values: bool, default: False
Whether to display the response value.
- resp_type: str, default: “axialForce”
Response type, optional, one of [“axialForce”, “axialDefo”, “Stress”, “Strain”].
- alpha: float, default: 1.0
Scale the size of the response graph.
Note
You can adjust the scale to make the response graph more visible. A negative number will reverse the direction.
- show_outline: bool, default: False
Whether to display the outline of the model.
- line_width: float, default: 1.5.
Line width of the response graph.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_frame_responses(odb_tag=1, ele_tags=None, resp_type='sectionForces', resp_dof='MZ', slides=False, scale=1.0, show_values=False, line_width=5.0, show_outline=False)[source]¶
Plot the responses of the frame element.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of frame elements to be visualized. If None, all frame elements are selected.
- resp_type: str, default: “sectionforces”
Response type, optional, one of [“localForces”, “basicForces”, “basicDeformations”, “plasticDeformation”, “sectionForces”, “sectionDeformations”].
- resp_dof: str, default: “MZ”
Component type corrsponding to the resp_type.
For localForces: [“FX”, “FY”, “FZ”, “MX”, “MY”, “MZ”]
For basicForces: [“N”, “MZ”, “MY”, “T”]
For basicDeformations: [“N”, “MZ”, “MY”, “T”]
For plasticDeformation: [“N”, “MZ”, “MY”, “T”]
For sectionForces: [“N”, “MZ”, “VY”, “MY”, “VZ”, “T”]
For sectionDeformations: [“N”, “MZ”, “VY”, “MY”, “VZ”, “T”]
Note
For sectionForces and sectionDeformations, not all sections include the shear dof VY and VZ. For instance, in the most commonly used 3D fiber cross-sections, only the axial force N, bending moments MZ and MY, and torsion T are available.
- slides: bool, default: False
Display the response for each step in the form of a slideshow. Otherwise, show the step with the largest response.
- show_values: bool, default: True
Whether to display the response value.
- scale: float, default: 1.0
Scale the size of the response graph.
Note
You can adjust the scale to make the response graph more visible. A negative number will reverse the direction.
- line_width: float, default: 1.5.
Line width of the response graph.
- show_outline: bool, default: False
Whether to display the outline of the model.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_frame_responses_animation(odb_tag=1, ele_tags=None, resp_type='sectionForces', resp_dof='MZ', scale=1.0, show_values=False, framerate=None, line_width=1.5, show_outline=False)[source]¶
Animate the responses of frame elements.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of frame elements to be visualized. If None, all frame elements are selected.
- resp_type: str, default: “sectionforces”
Response type, optional, one of [“localForces”, “basicForces”, “basicDeformations”, “plasticDeformation”, “sectionForces”, “sectionDeformations”].
- resp_dof: str, default: “MZ”
Component type corrsponding to the resp_type.
For localForces: [“FX”, “FY”, “FZ”, “MX”, “MY”, “MZ”]
For basicForces: [“N”, “MZ”, “MY”, “T”]
For basicDeformations: [“N”, “MZ”, “MY”, “T”]
For plasticDeformation: [“N”, “MZ”, “MY”, “T”]
For sectionForces: [“N”, “MZ”, “VY”, “MY”, “VZ”, “T”]
For sectionDeformations: [“N”, “MZ”, “VY”, “MY”, “VZ”, “T”]
Note
For sectionForces and sectionDeformations, not all sections include the shear dof VY and VZ. For instance, in the most commonly used 3D fiber cross-sections, only the axial force N, bending moments MZ and MY, and torsion T are available.
- scale: float, default: 1.0
Scale the size of the response graph.
Note
You can adjust the scale to make the response graph more visible. A negative number will reverse the direction.
- show_values: bool, default: True
Whether to display the response value.
- framerate: int, default: None
Framerate for the display, i.e., the number of frames per second.
- line_width: float, default: 1.5.
Line width of the response graph.
- show_outline: bool, default: False
Whether to display the outline of the model.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_unstruct_responses(odb_tag=1, ele_type='Shell', ele_tags=None, slides=False, resp_type='sectionForces', resp_dof='MXX', style='surface', show_outline=False, show_values=False)[source]¶
Visualizing unstructured element (Shell, Plane, Brick) Response.
Note
The responses at all Gaussian points are averaged.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of elements to be visualized. If None, all elements are selected.
- slides: bool, default: False
Display the response for each step in the form of a slideshow. Otherwise, show the step with the largest response.
- ele_type: str, default: “Shell”
Element type, optional, one of [“Shell”, “Plane”, “Solid”].
- resp_type: str, default: None
Response type, which dependents on the element type ele_type.
- For
Shellelements, one of [“sectionForces”, “sectionDeformations”]. I.e., section forces and deformations at Gaussian integration points (per unit length). If None, defaults to “sectionForces”.
- For
- For
Planeelements, one of [“stresses”, “strains”]. I.e., stresses and strains at Gaussian integration points. If None, defaults to “stresses”.
- For
- For
BrickorSolidelements, one of [“stresses”, “strains”]. I.e., stresses and strains at Gaussian integration points. If None, defaults to “stresses”.
- For
- resp_dof: str, default: None
Dof to be visualized, which dependents on the element type ele_type.
Note
The resp_dof here is consistent with stress-strain (force-deformation), and whether it is stress or strain depends on the parameter resp_type.
- For
Shellelements, one of [“FXX”, “FYY”, “FXY”, “MXX”, “MYY”, “MXY”, “VXZ”, “VYZ”]. If None, defaults to “MXX”.
- For
For
Planeelements, one of [“sigma11”, “sigma22”, “sigma12”, “p1”, “p2”, “sigma_vm”, “tau_max”].“sigma11, sigma22, sigma12”: Normal stress and shear stress (strain) in the x-y plane.
“p1, p2”: Principal stresses (strains).
“sigma_vm”: Von Mises stress.
“tau_max”: Maximum shear stress (strains).
If None, defaults to “sigma_vm”.
For
BrickorSolidelements, one of [“sigma11”, “sigma22”, “sigma33”, “sigma12”, “sigma23”, “sigma13”, “p1”, “p2”, “p3”, “sigma_vm”, “tau_max”, “sigma_oct”, “tau_oct”]“sigma11, sigma22, sigma33”: Normal stress (strain) along x, y, z.
“sigma12, sigma23, sigma13”: Shear stress (strain).
“p1, p2, p3”: Principal stresses (strains).
“sigma_vm”: Von Mises stress.
“tau_max”: Maximum shear stress (strains).
“sigma_oct”: Octahedral normal stress (strains).
“tau_oct”: Octahedral shear stress (strains).
If None, defaults to “sigma_vm”.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
- show_values: bool, default: True
Whether to display the response value.
- show_outline: bool, default: False
Whether to display the outline of the model.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python
- opstool.vis.plotly.plot_unstruct_responses_animation(odb_tag=1, ele_tags=None, framerate=None, ele_type='Shell', resp_type=None, resp_dof=None, style='surface', show_outline=False, show_values=False)[source]¶
Unstructured element (Shell, Plane, Brick) response animation.
Note
The responses at all Gaussian points are averaged.
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of truss elements to be visualized. If None, all truss elements are selected.
- ele_type: str, default: “Shell”
Element type, optional, one of [“Shell”, “Plane”, “Solid”].
- framerate: int, default: None
Framerate for the display, i.e., the number of frames per second.
- resp_type: str, default: None
Response type, which dependents on the element type ele_type.
- For
Shellelements, one of [“sectionForces”, “sectionDeformations”]. I.e., section forces and deformations at Gaussian integration points (per unit length). If None, defaults to “sectionForces”.
- For
- For
Planeelements, one of [“stresses”, “strains”]. I.e., stresses and strains at Gaussian integration points. If None, defaults to “stresses”.
- For
- For
BrickorSolidelements, one of [“stresses”, “strains”]. I.e., stresses and strains at Gaussian integration points. If None, defaults to “stresses”.
- For
- resp_dof: str, default: None
Dof to be visualized, which dependents on the element type ele_type.
Note
The resp_dof here is consistent with stress-strain (force-deformation), and whether it is stress or strain depends on the parameter resp_type.
- For
Shellelements, one of [“FXX”, “FYY”, “FXY”, “MXX”, “MYY”, “MXY”, “VXZ”, “VYZ”]. If None, defaults to “MXX”.
- For
For
Planeelements, one of [“sigma11”, “sigma22”, “sigma12”, “p1”, “p2”, “sigma_vm”, “tau_max”].“sigma11, sigma22, sigma12”: Normal stress and shear stress (strain) in the x-y plane.
“p1, p2”: Principal stresses (strains).
“sigma_vm”: Von Mises stress.
“tau_max”: Maximum shear stress (strains).
If None, defaults to “sigma_vm”.
For
BrickorSolidelements, one of [“sigma11”, “sigma22”, “sigma33”, “sigma12”, “sigma23”, “sigma13”, “p1”, “p2”, “p3”, “sigma_vm”, “tau_max”, “sigma_oct”, “tau_oct”]“sigma11, sigma22, sigma33”: Normal stress (strain) along x, y, z.
“sigma12, sigma23, sigma13”: Shear stress (strain).
“p1, p2, p3”: Principal stresses (strains).
“sigma_vm”: Von Mises stress.
“tau_max”: Maximum shear stress (strains).
“sigma_oct”: Octahedral normal stress (strains).
“tau_oct”: Octahedral shear stress (strains).
If None, defaults to “sigma_vm”.
- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
- show_values: bool, default: True
Whether to display the response value.
- show_outline: bool, default: False
Whether to display the outline of the model.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python