Skip to content

post.OpenSeesMatlabPost ¤

Bases: handle

OpenSeesMatlabPost Post-processing interface for OpenSeesMatlab.

OpenSeesMatlabPost provides high-level utilities for collecting model information, saving/loading model metadata, collecting eigenvalue results, and creating output databases for step-by-step response storage.

Users normally access this class through the post property of the main OpenSeesMatlab object:

1
2
  opsmat = OpenSeesMatlab();
  post = opsmat.post;

The post-processing workflow is typically:

  1. Build an OpenSees model with opsmat.opensees.
  2. Collect or save model metadata with getModelData or saveModelData.
  3. Collect eigen data with getEigenData or saveEigenData when needed.
  4. Create an ODB with createODB for response history storage.
  5. Use opsmat.vis to visualize collected model/eigen/response data.
Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  opsmat = OpenSeesMatlab();
  ops = opsmat.opensees;

  % Build model with ops...
  % ops.wipe();
  % ops.model(...);
  % ops.node(...);
  % ops.element(...);

  post = opsmat.post;
  post.setOutputDir(".openseesmatlab.output");

  modelInfo = post.getModelData();
  post.saveModelData("ModelA");

  eigenData = post.getEigenData(numModes=3, solver="-genBandArpack");
  post.saveEigenData("ModelA", 3, solver="-genBandArpack");

Methods:

  • setOutputDir

    Set the output directory used by post-processing save operations.

  • saveModelData

    Collect and save current OpenSees model information to an HDF5 file.

  • getModelData

    Get model information from the current OpenSees model or from file.

  • saveEigenData

    Collect eigenvalue analysis results and save them to an HDF5 file.

  • getEigenData

    Get eigen data from file or collect it from the current model.

  • createODB

    Create an output database for storing response data over analysis steps.

  • getODBData

    Get response data from an ODB file.

  • getModelDataFromODB

    Get model data from an ODB.

  • getNodalResponse

    Get nodal response data from an ODB.

  • getElementResponse

    Get element response data from an ODB.

  • writeResponsePVD

    Write nodal and Shell, Plane, Solid element responses to ParaView-readable VTU/PVD files.

setOutputDir ¤

(dir=".openseesmatlab.output")

Set the output directory used by post-processing save operations.

The output directory is used by saveModelData, saveEigenData, and response database utilities. If the directory does not exist, it is created automatically.

Input arguments:

  • dir (char or string) –

    Output directory path. Relative paths are interpreted relative to the current MATLAB working directory.

Example
1
2
post = opsmat.post;
post.setOutputDir(".openseesmatlab.output");

saveModelData ¤

(odbTag="1")

Collect and save current OpenSees model information to an HDF5 file.

The saved file is named modelData_.hdf5 and is written to the directory returned by getOutputDir. Use getModelData(odbTag) to read the saved model data back from disk.

Input arguments:

  • odbTag (char, string, or numeric) –

    Identifier used in the saved file name. Default is 1.

Example
1
2
3
post = opsmat.post;
post.setOutputDir(".openseesmatlab.output");
post.saveModelData("ModelA");

getModelData ¤

(odbTag="")

Get model information from the current OpenSees model or from file.

Without odbTag, this method collects model metadata directly from the current OpenSees model in memory. With odbTag, it reads the file modelData_.hdf5 from the current output directory.

Input arguments:

  • odbTag (char, string, or numeric) –

    Identifier of saved model data. If omitted or empty, model data is collected from the current OpenSees model.

Output arguments:

  • modelInfo ( struct ) –

    Model information structure used by post-processing and visualization utilities.

Examples:

1
2
modelInfo = opsmat.post.getModelData();
modelInfo = opsmat.post.getModelData("ModelA");

saveEigenData ¤

(odbTag="1", numModes=1, solver="-genBandArpack", IncludeModelInfo: logical = false, InterpolateBeam: logical = true, NptsPerElement: double = 6)

Collect eigenvalue analysis results and save them to an HDF5 file.

The saved file is named eigenData_.hdf5 and is written to the directory returned by getOutputDir. The method first collects model information from the current OpenSees model, then computes and stores the requested eigen data.

Input arguments:

  • odbTag (char, string, or numeric) –

    Identifier used in the saved file name. Default is 1.

  • numModes (positive integer) –

    Number of modes to collect and save. Default is 1.

  • solver (char or string) –

    OpenSees eigen solver option. Default is "-genBandArpack".

  • IncludeModelInfo (logical) –

    If true, include model information in the saved eigen-data structure. Default is false.

  • InterpolateBeam (logical) –

    If true, interpolate beam element modal displacements by shape functions. Default is true.

  • NptsPerElement (integer >= 2) –

    Number of interpolation points per beam element. Default is 6.

Examples:

1
2
3
4
5
6
7
post.saveEigenData("ModelA", 3);
post.saveEigenData("ModelA", 3, solver="-genBandArpack");
post.saveEigenData("ModelA", 3, ...
    solver="-genBandArpack", ...
    IncludeModelInfo=true, ...
    InterpolateBeam=false, ...
    NptsPerElement=8);

getEigenData ¤

(odbTag="", numModes=1, solver="-genBandArpack", IncludeModelInfo: logical = false, InterpolateBeam: logical = true, NptsPerElement: double = 6)

Get eigen data from file or collect it from the current model.

If odbTag is provided, this method reads eigenData_.hdf5 from the current output directory. Otherwise, it collects eigen data from the current OpenSees model using the requested number of modes and solver options.

Input arguments:

  • odbTag (char, string, or numeric) –

    Identifier of saved eigen data. If provided and nonempty, data is loaded from eigenData_.hdf5.

  • numModes (positive integer) –

    Number of modes to collect when odbTag is not provided. Default is 1.

  • solver (char or string) –

    OpenSees eigen solver option. Default is "-genBandArpack".

  • IncludeModelInfo (logical) –

    If true, include model information in the output structure. Default is false.

  • InterpolateBeam (logical) –

    If true, interpolate beam element modal displacements. Default is true.

  • NptsPerElement (integer >= 2) –

    Number of interpolation points per beam element. Default is 6.

Output arguments:

  • out ( struct ) –

    Eigenvalue analysis results.

Examples:

1
2
3
4
eigenData = post.getEigenData(numModes=3);
eigenData = post.getEigenData(numModes=3, solver="-genBandArpack");
eigenData = post.getEigenData(numModes=3, InterpolateBeam=false);
eigenData = post.getEigenData(odbTag="ModelA");

createODB ¤

(odbTag="", flushEvery=20, saveNodalResp: logical = true, saveFrameResp: logical = true, saveTrussResp: logical = true, saveLinkResp: logical = true, saveShellResp: logical = true, saveFiberSecResp: logical = false, savePlaneResp: logical = true, saveSolidResp: logical = true, saveContactResp: logical = true, nodeTags: double = [], frameTags: double = [], trussTags: double = [], linkTags: double = [], shellTags: double = [], planeTags: double = [], solidTags: double = [], contactTags: double = [], elasticFrameSecPoints: double = 9, interpolateBeamDisp="off", computeMechanicalMeasures={"principal", "tauMax", "octahedral", "vonMises"}, projectGaussToNodes="extrapolate")

Create an output database for storing response data over analysis steps.

The returned ODB object can fetch and store model responses after each analysis step. This is the recommended workflow for response histories that will later be loaded, queried, or visualized.

Example
1
odb = post.createODB("MyODB", flushEvery=50);

Input arguments:

  • odbTag (char | string | numeric) –

    A unique identifier for the ODB.

  • flushEvery (integer) –

    If provided, specifies the frequency (in steps) at which to save data to disk.

  • elasticFrameSecPoints (integer, default: 9 ) –

    Number of points to use for elastic frame section integration.

  • interpolateBeamDisp (char | string | integer, default: "off" ) –

    If "on", interpolate beam element displacements to integration points. If int, treat as number of points per element for interpolation.

  • computeMechanicalMeasures (cell array of char | string, default: {"principal", "vonMises", "octahedral", "tauMax"} ) –

    Specifies which mechanical measures to compute for frame responses. Options include:

    • "principal" (principal stresses)
    • "vonMises" (von Mises stress)
    • "octahedral" (octahedral shear and normal stress)
    • "tauMax" (maximum shear stress)

getODBData ¤

(odbTag="")

Get response data from an ODB file.

Example
1
data = obj.getODBData("MyODB")

Input arguments:

Output arguments:

  • data ( struct ) –

    A struct containing the response data for the specified step and frame.

getModelDataFromODB ¤

(odbTag="")

Get model data from an ODB.

Input arguments:

Output arguments:

  • data ( struct ) –

    The model data from the ODB.

getNodalResponse ¤

(odbTag="", nodeTags: double = [], respType="")

Get nodal response data from an ODB.

Example
1
2
data = obj.getNodalResponse("MyODB")
data = obj.getNodalResponse("MyODB", nodeTags=[1,2,3], respType="disp")

Input arguments:

  • odbTag (char | string | numeric) –

    The identifier of the ODB to read from.

  • nodeTags (double array) –

    An array of node tags to filter the response data. If empty or not provided, responses for all nodes will be returned.

  • respType (char | string) –

    The type of nodal response to retrieve (e.g., "disp", "vel", "acc"). If empty or not provided, all types of nodal responses will be returned.

Output arguments:

  • data ( struct ) –

    A struct containing the nodal response data for the specified nodes and response type.

getElementResponse ¤

(odbTag="", eleType="", eleTags: double = [], respType="")

Get element response data from an ODB.

Example
1
2
data = obj.getElementResponse("MyODB")
data = obj.getElementResponse("MyODB", eleTags=[1,2,3], respType="force")

Input arguments:

  • odbTag (char | string | numeric) –

    The identifier of the ODB to read from.

  • eleTags (double array) –

    An array of element tags to filter the response data. If empty or not provided, responses for all elements will be returned.

  • eleType (char | string) –

    The type of element to filter the response data (e.g., "Frame", "Truss", "Shell", "Plane", "Solid"). If empty or not provided, responses for all element types will be returned.

  • respType (char | string) –

    The type of element response to retrieve (e.g., "force", "stress"). If empty or not provided, all types of element responses will be returned.

Output arguments:

  • data ( struct ) –

    A struct containing the element response data for the specified elements and response type.

writeResponsePVD ¤

(odbTag="", outDir="paraview_output", baseName="pv", includeNodal: logical = true, includeShell: logical = true, includePlane: logical = true, includeSolid: logical = true)

Write nodal and Shell, Plane, Solid element responses to ParaView-readable VTU/PVD files.

Example
1
2
obj.writeResponsePVD("MyODB")
obj.writeResponsePVD("MyODB", includeShell=true, includePlane=true, includeSolid=true)

Input arguments:

  • odbTag (char | string | numeric) –

    The identifier of the ODB to read from.

  • outDir (char | string) –

    The directory to save the output files. Default is "paraview_output".

  • baseName (char | string) –

    The base name for the output files. Default is "pv".

  • includeNodal (logical) –

    Flags to specify which types of responses to include in the output. By default, all types are included.

  • includeShell (logical) –

    Flags to specify which types of responses to include in the output. By default, all types are included.

  • includePlane (logical) –

    Flags to specify which types of responses to include in the output. By default, all types are included.

  • includeSolid (logical) –

    Flags to specify which types of responses to include in the output. By default, all types are included.

post.ODB ¤

Bases: handle

Output database for OpenSees response data.¤

close ¤

()

Remove the recorder tag if it exists. This will stop the recorder from collecting data.