Skip to content
Anurag Upadhyay edited this page Mar 27, 2022 · 2 revisions

vfo

Welcome to the vfo wiki!


vfo (Visualization for OpenSees) is a Python package to make your life better by helping you visualize your OpenSees models, Python or Tcl. It utilizes Matplotlib 3.0 library to plot 2D and 3D models in a dedicated interactive window. You can use click-and-hold to change the view angle and zoom the plot. The model image can be saved with the desired orientation directly from the interactive plot window. If you did not install matplotlib using Anaconda, you will have to install PyQt or PySide to enable an interactive window (Matplotlib Dependencies).

Animation: To save the animation movie as .mp4 file, FFmpeg codecs are required.

When using Spyder IDE and Jupyter notebook, the default setting is to produce a static, inline plot that is not interactive. To change that, write the command %matplotlib qt in the Ipython console and then execute the model plotting commands. This will produce an interactive plot in a dedicated window.

The following elements are supported:

2D and 3D Beam-Column Elements 2D and 3D Quad Elements 2D and 3D Tri Elements 8 Node Brick Elements Tetrahedron Elements


Banner


The following two commands are needed to visualize the model, as shown below:

Change plot backend to Qt. ONLY if you are using an Ipython console (e.g. Spyder)

%matplotlib qt

Change plot backend to 'Nbagg' if using Jupyter notebook to get an interactive, inline plot.

%matplotlib notebook

import vfo module

import vfo.vfo as vfo

render the model after defining all the nodes and elements

vfo.plot_model()

plot mode shape

vfo.plot_modeshape(3)


In order to plot the deformed shape, an output database has to be created first using createODB() command.

1. createODB()

To create and save an output database,

createODB("Model","LoadCase", Nmodes=0, deltaT=0.0, monitorEleTags=[], monitorEleType="twoNodeLink", numSections=1, monitorGroupName="GroupName", monitorOutput="deformations", dofs=[])

Clone this wiki locally