raysect / source

The main source repository for the Raysect project.
http://www.raysect.org
BSD 3-Clause "New" or "Revised" License
86 stars 23 forks source link

Add discrete interpolators for regular 3D meshes. #389

Open vsnever opened 3 years ago

vsnever commented 3 years ago

To augment the Cherab plasma object with the impurity data from ERO 2.0 runs, I need a discrete interpolator for regular cylindrical meshes. Although this interpolator is primarily needed for Cherab, I think it might be general enough to be included in Raysect.

So far I have implemented an interpolator for regular Cartesian 3D mesh along with inrpolators for cylindrical meshes, both periodic and non-periodic in azimuth. All of them are for scalar data for now. Here is the code, https://github.com/vsnever/raysect-source/commit/e5aa0597a4cec1674e613c95507a831c6f8ff57d.

The field of application of such interpolators is narrower than that of Discrete3DMesh, but the cell index calculation in case of regular meshes is much faster compared to K-d tree search and inside-outside test for tetrahedra.

@CnlPepper, do you think it's worth adding these interpolators to Raysect? If so, I'll make the interpolators for vector data as well and add tests and demos.