Commit cde780c6 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Switch off coplanar interpolation as it is weird still

parent 8d50dcb2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ int main(int argc, char** argv) {
        const auto vector_field = config.get<bool>("vector_field", (observable == "ElectricField"));

        const auto interpolate = config.get<bool>("interpolate", true);
        const auto allow_decay = config.get<bool>("allow_coplanar_interpolation", false);
        const auto radius_step = config.get<double>("radius_step", 0.5);
        const auto volume_cut = config.get<double>("volume_cut", 10e-9);

@@ -362,7 +363,7 @@ int main(int argc, char** argv) {

                // No interpolation requested, return nearest neighbor:
                if(!interpolate) {
                    auto idx = octree.findNeighbor<unibn::L2Distance<Point>>(q);
                    auto idx = static_cast<size_t>(octree.findNeighbor<unibn::L2Distance<Point>>(q));
                    new_mesh.push_back(field.at(idx));
                    z += zstep;
                    continue;
@@ -405,7 +406,7 @@ int main(int argc, char** argv) {
                    }

                    // If we have too many neighbors, we could dcay to using lower-dimension interpolation:
                    if(radius > initial_radius && results.size() > 100) {
                    if(allow_decay && radius > initial_radius && results.size() > 100) {
                        LOG_ONCE(WARNING) << "Large number of neighbors found, this hints to a quasi-co"
                                          << (dimension == 3 ? "planar" : "linear") << " situation" << std::endl
                                          << "Decaying to interpolation in " << (dimension == 3 ? "planar" : "linear")
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ It should be noted that the Mesh Converter depends on the core utilities of the
* `initial_radius`: Initial node neighbors search radius in micro meters. Defaults to the minimal cell dimension of the final interpolated mesh.
* `radius_step`: Radius step if no neighbor is found (defaults to `0.5um`). Only used for barycentric interpolation.
* `max_radius`: Maximum search radius (default is `50um`). Only used for barycentric interpolation.
* `allow_coplanar_interpolation`: Allow the interpolation to use coplanar/colinear vertices if no full interpolation volume can be found after increasing the search radius and if more than 100 neighbors are found. Defaults to `false`. It should be noted that this feature is experimental and that it can produce `NaN` results for the interpolated field.
* `allow_failure`: Allow the interpolation of a single mesh point to fail, i.e. when no neighbors could be found. If set to `true`, the respective mesh element will be set to zero and the interpolation will continue, if `false` the interpolation will be aborted. Defaults to `false`. Only used for barycentric interpolation.
* `volume_cut`: Minimum volume for tetrahedron for non-coplanar vertices (defaults to minimum double value). Only used for barycentric interpolation.
* `divisions`: Number of divisions of the new regular mesh for each dimension, 2D or 3D vector depending on the `dimension` setting. Defaults to 100 bins in each dimension.