OpenQuake Vulnerability Modellers Toolkit Suite

Contents:

  • 1. Installation
  • 2. Change Log
  • 3. Intensity Measure Calculation
  • 4. Intensity Measure Selection
  • 5. Model Calibration
  • 6. Model Building and Analysis
  • 7. Postprocessing
  • 8. Storey Loss Function Generation
  • 9. Visualisation
    • 9.1. Modal Shapes
      • plotter.plot_modes()
    • 9.2. Static Pushover Animation
    • 9.3. Cyclic Pushover Animation
    • 9.4. Nonlinear Time-History Animation
    • 9.5. MCA Results
    • 9.6. IDA Results
    • 9.7. MSA Results
    • 9.8. Fragility Functions from MCA
    • 9.9. Fragility Functions from IDA
    • 9.10. Fragility Functions from MSA
    • 9.11. Storey Loss Functions
    • 9.12. Vulnerability Functions
  • 10. Demos
  • 11. Examples
OpenQuake Vulnerability Modellers Toolkit Suite
  • 9. Visualisation
  • 9.1. Modal Shapes
  • View page source

9.1. Modal Shapes

plotter.plot_modes(node_list, mode_shape_vectors, T, export_path=None)[source]

Plots 2-D mode shape profiles in a square grid layout (2×2, 3×3, …).

Each mode occupies one cell with two side-by-side profile plots: left = X-displacement vs Z (blue), right = Y-displacement vs Z (green). Normalised displacement values are annotated next to every node dot. A grey undeformed reference line (x=0) is drawn in every panel.

9.1. Sign convention

Eigenvectors have arbitrary sign. The method flips each mode so that the top-node displacement in the dominant horizontal direction is always positive.

9.1. Grid layout

ncols = ceil(sqrt(N)), nrows = ceil(N / ncols). Unused cells in the last row are hidden.

9.1. Title placement

Each mode title (e.g. 'Mode 1 [X-dir] — T₁ = 0.312 s') is placed via fig.text() at the horizontal midpoint of both panels so that it is centred over the X- and Y-displacement plots together.

9.1. Adaptive scaling

Font sizes for node annotations, axis labels, tick marks, and panel titles, as well as the vertical panel spacing (hspace) and the figure top margin (top), all scale automatically with the number of grid rows and the number of nodes per panel. This prevents text and title overlap when plotting a large number of modes.

param node_list:

Ordered OpenSees node tags (base node first).

type node_list:

list of int

param mode_shape_vectors:

One array per mode; columns are [ux, uy, uz], pre-normalised by max abs value as returned by do_modal_analysis.

type mode_shape_vectors:

list of numpy.ndarray, shape (n_nodes, 3)

param T:

Natural periods [s] for each mode.

type T:

list of float

param export_path:

File path to save the figure. If None the figure is displayed interactively.

type export_path:

str, optional

rtype:

None

Example

from openquake.vmtk.plotter import plotter

pl = plotter()
# T, mode_shapes from modeller.do_modal_analysis()
pl.plot_modes(
    node_list=model.node_list,
    mode_shape_vectors=mode_shapes,
    T=T,
    export_path="mode_shapes.png",
)
Previous Next

© Copyright 2024-2025, GEM Risk.

Built with Sphinx using a theme provided by Read the Docs.