Spatial coordinates based evaluation #1214
-
Hello, @nschloe and others, First of all, thank you for the effort in making this library. I have a specific question to my application. I have a .vtu file which has a mesh and associated data. Below is an image of what the mesh looks like - Below is an the same mesh with "psi" , the data in the mesh I would like to work with - What I would like to do is explained in the image below - I would like to extract a list of "psi" values along the y-axis. There is a long version of solving this - extracting each value separately and then matching them up. I was wondering if there's clever way of doing this using already defined functions? My primary goal is to be able to measure the circular feature that you see in the images, and my criteria for measuring is "psi". Any help or guidance would be greatly appreciated! I have also attached the .vtu file. Again, thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
First of all, don't use the jet color scheme. You'll see that your circle doesn't have a boundary as sharp as it looks in the images. About your problem: Evaluating functions on meshes can be hard. The main issue is finding in which cell a particular point (x,y) sits. I wouldn't know how to do this except one-by-one. |
Beta Was this translation helpful? Give feedback.
-
You can check out |
Beta Was this translation helpful? Give feedback.
-
Thank you, @nschloe and @keurfonluu . I shall explore both your recommendations, and will update this post once I've found a concrete solution. |
Beta Was this translation helpful? Give feedback.
meshio
is simply a mesh reader/writer library. To achieve what you want to do, you need more advanced tools.You can check out
pyvista
's functionsample_over_line
to extract data along a line.pyvista
is a wrapper for VTK which partially relies onmeshio
too for mesh I/O.