Skip to content

MeshConverer: Add Simple Closest-Neighbor Method

Simon Spannagel requested to merge p/meshcoplanarity into master

This extends the Mesh Converter with a new mode, selected by setting interpolate = false in the configuration. The manual describes the two modes as follows now:

Simple Closest-Neighbor Search

In this mode, selected by setting the parameter interpolate = false, no interpolation of field values is performed, but for every output mesh point, the values from the closest neighbor of the input mesh is taken. In most cases this approach should produce reasonably precise results with a granularity similar to the respective adaptive mesh granularity in the respective region.

Barycentric Interpolation Method

In this mode, the regular mesh is created by scanning the model volume in regular X, Y and Z steps and using a barycentric interpolation method to calculate the respective electric field vector on the new point. The interpolation uses the four closest, no-coplanar, neighbor vertex nodes such, that the respective tetrahedron encloses the query point.

In addition, a new method is implemented that allows a full-volume interpolation to decay to a coplanar interpolation under specific circumstances. However, this sometimes produced NaNs or inf results for the interpolated field, is therefore off by default und probably needs some more investigation.

Edited by Simon Spannagel

Merge request reports