From d68ab712bcd4b392874cc267c61fba438820290f Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 7 Nov 2017 09:24:52 +0100 Subject: [PATCH] Use get_intermediate_point after merging directions. --- source/grid/manifold_lib.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 7c7325e231..44a0a1c503 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -461,6 +461,22 @@ get_new_point (const ArrayView> &vertices, const unsigned int n_merged_points = directions.size(); + // check if we only have two points now, in which case we can use the + // get_intermediate_point function + if (n_merged_points == 2) + { + SphericalManifold<3,3> unit_manifold; + Assert(std::abs(merged_weights[0] + merged_weights[1] - 1.0) < 1e-13, + ExcMessage("Weights do not sum up to 1")); + Point<3> intermediate = unit_manifold.get_intermediate_point + (Point<3>(directions[0]), Point<3>(directions[1]), merged_weights[1]); + // copy back to spacedim-point + Point p; + for (unsigned int d=0; d vPerp; Tensor<2,2> Hessian; Tensor<1,2> gradient; -- 2.39.5