From 77562041af8ea355c7005f529423600aee6505d0 Mon Sep 17 00:00:00 2001
From: Lennart Schulze <lschulze@mpi-cbg.de>
Date: Tue, 4 Jul 2023 10:49:01 +0200
Subject: [PATCH] Add template option minter_polynnomial so that redundant
 monomial specification is not needed.

---
 src/level_set/particle_cp/particle_cp.hpp    | 4 +++-
 src/level_set/particle_cp/pcp_unit_tests.cpp | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/level_set/particle_cp/particle_cp.hpp b/src/level_set/particle_cp/particle_cp.hpp
index 8b8401a..d110202 100644
--- a/src/level_set/particle_cp/particle_cp.hpp
+++ b/src/level_set/particle_cp/particle_cp.hpp
@@ -66,6 +66,7 @@ struct Redist_options
 struct quadratic {};
 struct bicubic {};
 struct taylor4 {};
+struct minter_polynomial {};
 
 
 template <typename particles_in_type, typename polynomial_degree, size_t phi_field, size_t closest_point_field, size_t normal_field, size_t curvature_field, unsigned int num_minter_coeffs>
@@ -83,7 +84,8 @@ public:
 		if (std::is_same<polynomial_degree,quadratic>::value) polynomialDegree = "quadratic";
 		else if (std::is_same<polynomial_degree,bicubic>::value) polynomialDegree = "bicubic";
 		else if (std::is_same<polynomial_degree,taylor4>::value) polynomialDegree = "taylor4";
-		else throw std::invalid_argument("Invalid polynomial degree given. Valid choices currently are quadratic, bicubic and taylor4.");
+		else if (std::is_same<polynomial_degree,minter_polynomial>::value) polynomialDegree = "minterpolation";
+		else throw std::invalid_argument("Invalid polynomial degree given. Valid choices currently are quadratic, bicubic, taylor4, minter_polynomial.");
 	}
 	
 	void run_redistancing()
diff --git a/src/level_set/particle_cp/pcp_unit_tests.cpp b/src/level_set/particle_cp/pcp_unit_tests.cpp
index e525f7f..627f3c2 100644
--- a/src/level_set/particle_cp/pcp_unit_tests.cpp
+++ b/src/level_set/particle_cp/pcp_unit_tests.cpp
@@ -124,7 +124,7 @@ BOOST_AUTO_TEST_CASE( ellipsoid )
 
 	static constexpr unsigned int num_coeffs = minter_lp_degree_one_num_coeffs(3, poly_order);
 
-	particle_cp_redistancing<particles, taylor4, sdf, cp, normal, curvature, num_coeffs> pcprdist(vd, rdistoptions);
+	particle_cp_redistancing<particles, minter_polynomial, sdf, cp, normal, curvature, num_coeffs> pcprdist(vd, rdistoptions);
 	pcprdist.run_redistancing();
 	
 	//vd.write("pcpunittest");
-- 
GitLab