Interpolating a scalar field in a 3D space

送分小仙女□ 提交于 2019-11-30 03:41:20

问题


I have a 3D space (x, y, z) with an additional parameter at each point (energy), giving 4 dimensions of data in total.

I would like to find a set of x, y, z points which correspond to an iso-energy surface found by interpolating between the known points.

The spacial mesh has constant spacing and surrounds the iso-energy surface entirely, however, it does not occupy a cubic space (the mesh occupies a roughly cylindrical space)

Speed is not crucial, I can leave this number crunching for a while. Although I'm coding in Python and NumPy, I can write portions of the code in FORTRAN. I can also wrap existing C/C++/FORTRAN libraries for use in the scripts, if such libraries exist.

All examples and algorithms that I have so far found online (and in Numerical Recipes) stop short of 4D data.


回答1:


There are quite a few options here...

In order to get your energy into your mesh, you'll need to use some form of interpolation. Shepard's method is a common, and reasonably simple, method to implement, and tends to work well if your data distribution is reasonable.

Once you have that done, you'll need to do some form of isosurface generation.

There are some libraries out there to make this easy. Most notably, VTK includes python wrappers and has all of the tools required to do both of these steps.

For details on how this could be done in VTK, you can check vtkShepardMethod and vtkContourFilter.




回答2:


Since you have a spatial mesh with constant spacing, you can identify all neighbors on opposite sides of the isosurface. Choose some form of interpolation (q.v. Reed Copsey's answer) and do root-finding along the line between each such neighbor.




回答3:


Why not try quadlinear interpolation?

extend Trilinear interpolation by another dimension. As long as a linear interpolation model fits your data, it should work.



来源:https://stackoverflow.com/questions/1972172/interpolating-a-scalar-field-in-a-3d-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!