Skip to content

Extend plotSolution to visualize arbitrary geometries #41

@nikoscham

Description

@nikoscham

The plotSolution function currently supports:

  • 1D line plots for scalar solutions (see e.g the tutorial)
  • 2D contour plots for structured rectangular grids (reshaping node coordinates into grids) (see e.g the tutorial)
  • 2D contour plots for unstructured meshes using node-based interpolation (via Plotly's contour type with x y z arrays) (see e.g the tutorial)

However, it does not handle true element-based visualization for arbitrary polygonal topologies.

Tasks:

  • Introduce a new plotType option, e.g., "polygon"
  • Use Plotly's scatter with fill: 'toself' or mesh3d to draw individual polygonal elements based on element connectivity (e.g., from nop arrays in meshGenerationScript.js)
  • For each element, extract node coordinates and solution values to create filled polygons with color mapping

Example API usage: plotSolution(solutionVector, nodesCoordinates, solverConfig, "2D", "polygon", plotDivId);

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions