Surface plot along boundary of domain

I would like to be able to plot a scalar quantity along a 1D boundary of a 2D domain in Paraview. For example, given the 2D domain below, I would like to extract a plot of the scalar field along the left boundary. This data comes from a finite element simulation that uses a triangulation of the domain.

To date, my workflow for doing this exists entirely outside of Parview. I collect the boundary faces, orient them in the same direction, and then plot the scalar field restricted to these faces. However, I would like to be able to use the flexibility and abstractions that Paraview offers. I have the following potential approaches in mind:

  1. Add a separate 1D mesh representing the submanifold (boundary) to the VTK file that uses the same coordinates as the primary mesh, then use PlotData to plot the data on this mesh.

  2. Use the Plot Over Line filter on the 2D mesh.

Both of these have downsides, namely that the first option requires adding additional fields to the visualization file in order to represent information that is already there (redundancy), while option 2 is restricted to straight boundaries and is difficult to line up exactly with the true domain boundary.

I am building my .VTK files using PointData on an unstructured grid. I looked at this support thread: Surface plot or polyline plot and was hoping to apply this workflow to my case, but it looks like Extract Feature Edges is not available for my datasets – there was a message saying that Extract Feature Edges it is only available for vtkPolyData.

I tried using Extract Edges with this dataset, but it extracted the edges from all elements in the mesh, including the interior elements. This is not what I am looking for (see the screenshot below):


Does anybody have advice or a preferred workflow for this? It seems like this is a pretty common need when plotting surface quantities, such as pressure coefficient in a CFD simulation.

To complicate my situation, I am trying to fully transition my workflow to use the CellGrid data structures that natively support Discontinuous Galerkin discretizations. I have worked with @dcthomp on this before, not sure if you have some advice to lend here? When I open the CellGrid dataset, I can’t use Extract Edges because it is only available for vtkDataSet. Any help would be appreciated. I have attached small examples of both the PointData .vtk file and the CellGrid .dg files that I used to produce the results.

squarePointData.vtk (8.9 KB)

squreCellGrid.dg (7.9 KB)

Hi,

Unstructured grids are the generic 3D meshes of VTK. If you have a surfacic dataset, you should prefer polydata.

From ParaView, you can Extract Surface to get a polydata of the external surface of your unstructured grid.

When manipulating the line widget, you can use shortcuts to pick the exact mesh point that is under the cursor.

You can draw a PolyLineSource and then Plot Over Line From Custom Source

No idea about CellGrids.

My advice is to “Insert Coin Here” :slight_smile: . It is not a feature that is currently implemented and we don’t have a customer willing to pay for it yet. There is at best a partial implementation. If you have some funding or would like to include Kitware on a grant proposal to fund a feature like this, we are certainly open to it.

Here are the issues to address before you can do the kind of line/curve plot you mention:

  1. If you only want to extract values on 1-d boundaries of cells (rather than curves anywhere along the surface), it might be best to write a separate filter that evaluates points along a side set of the cells you care about (left side, right side, etc.) and creates poly-data from that. It would not be a huge effort (probably a few days of work). You can include sides of cells in your simulation output and they “inherit” all the cell-attributes from their parent cells.
  2. If you want to plot along arbitrary curves, there is a CellGridProbe filter and it can take a vtkPolyLineSource (or anything that produces vtkPolyData) filter as its probe “input” (it also takes a cell grid as the “source”). The filter will locate world-coordinate points from the probe input and find cell-grid cells containing those points in the “source,” then determine the parametric coordinates and evaluate a cell-attribute at those parametric coordinates. The filter even has a VTK test showing it works but there’s a bug in the ParaView filter XML I didn’t discover until the last round of funding we had was already spent. So, it ignores whatever cell-attribute you select in ParaView to sample with the probe.
  3. Software picking is not implemented for cell grids yet. So, the P and Ctrl+P/Cmd-P keyboard shortcuts you use when defining a poly-line source will not let you snap line/curve endpoints to points of a cell-grid.
  4. The CellGridProbe filter doesn’t look for nearby cells, so if you have curved surface cells, it is unlikely to map any of the input polydata points to the cell-grid since they won’t follow the surface precisely in 3-d; most of the probe points will be marked as “NaN.”