From 403cbce7562bdf00f7580682b0b96e1058d0216e Mon Sep 17 00:00:00 2001
From: Walter Van Herck <w.van.herck@fz-juelich.de>
Date: Mon, 8 Jul 2019 11:15:42 +0200
Subject: [PATCH] Remove obsolete Layer::scalarReducedPotential and
 Layer::polarizedReducedPotential

---
 Core/Multilayer/Layer.cpp           | 13 -------
 Core/Multilayer/Layer.h             |  9 -----
 auto/Wrap/libBornAgainCore.py       | 12 -------
 auto/Wrap/libBornAgainCore_wrap.cpp | 56 -----------------------------
 4 files changed, 90 deletions(-)

diff --git a/Core/Multilayer/Layer.cpp b/Core/Multilayer/Layer.cpp
index 7995829c75c..cde7f5233fc 100644
--- a/Core/Multilayer/Layer.cpp
+++ b/Core/Multilayer/Layer.cpp
@@ -94,19 +94,6 @@ void Layer::registerThickness(bool make_registered)
     }
 }
 
-complex_t Layer::scalarReducedPotential(kvector_t k, double n_ref) const
-{
-    complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
-    return MaterialUtils::ScalarReducedPotential(n, k, n_ref);
-}
-
-Eigen::Matrix2cd Layer::polarizedReducedPotential(kvector_t k, double n_ref) const
-{
-    complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
-    kvector_t b_field = bField();
-    return MaterialUtils::PolarizedReducedPotential(n, b_field, k, n_ref);
-}
-
 kvector_t Layer::bField() const
 {
     return m_B_field;
diff --git a/Core/Multilayer/Layer.h b/Core/Multilayer/Layer.h
index 0659093f6dd..9e7d02b4a85 100644
--- a/Core/Multilayer/Layer.h
+++ b/Core/Multilayer/Layer.h
@@ -60,15 +60,6 @@ public:
     void setNumberOfSlices(unsigned int n_slices) { m_n_slices = n_slices; }
     unsigned int numberOfSlices() const { return m_n_slices; }
 
-    //! Return the potential term that is used in the one-dimensional Fresnel calculations
-    complex_t scalarReducedPotential(kvector_t k, double n_ref) const;
-
-#ifndef SWIG
-    //! Return the potential term that is used in the one-dimensional Fresnel calculations
-    //! in the presence of magnetization
-    Eigen::Matrix2cd polarizedReducedPotential(kvector_t k, double n_ref) const;
-#endif
-
 private:
     //! Return the magnetic B-field in this layer
     kvector_t bField() const;
diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py
index 7271e6b9fda..3c4ebcc9966 100644
--- a/auto/Wrap/libBornAgainCore.py
+++ b/auto/Wrap/libBornAgainCore.py
@@ -24499,18 +24499,6 @@ class Layer(ISample):
         """
         return _libBornAgainCore.Layer_numberOfSlices(self)
 
-
-    def scalarReducedPotential(self, k, n_ref):
-        """
-        scalarReducedPotential(Layer self, kvector_t k, double n_ref) -> complex_t
-
-        complex_t Layer::scalarReducedPotential(kvector_t k, double n_ref) const
-
-        Return the potential term that is used in the one-dimensional Fresnel calculations. 
-
-        """
-        return _libBornAgainCore.Layer_scalarReducedPotential(self, k, n_ref)
-
 Layer_swigregister = _libBornAgainCore.Layer_swigregister
 Layer_swigregister(Layer)
 
diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp
index 7b4e029a918..434bb8b62f3 100644
--- a/auto/Wrap/libBornAgainCore_wrap.cpp
+++ b/auto/Wrap/libBornAgainCore_wrap.cpp
@@ -104491,54 +104491,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_Layer_scalarReducedPotential(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  Layer *arg1 = (Layer *) 0 ;
-  kvector_t arg2 ;
-  double arg3 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 ;
-  int res2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  complex_t result;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOO:Layer_scalarReducedPotential",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Layer, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_scalarReducedPotential" "', argument " "1"" of type '" "Layer const *""'"); 
-  }
-  arg1 = reinterpret_cast< Layer * >(argp1);
-  {
-    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_BasicVector3DT_double_t,  0  | 0);
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_scalarReducedPotential" "', argument " "2"" of type '" "kvector_t""'"); 
-    }  
-    if (!argp2) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Layer_scalarReducedPotential" "', argument " "2"" of type '" "kvector_t""'");
-    } else {
-      kvector_t * temp = reinterpret_cast< kvector_t * >(argp2);
-      arg2 = *temp;
-      if (SWIG_IsNewObj(res2)) delete temp;
-    }
-  }
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Layer_scalarReducedPotential" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  result = ((Layer const *)arg1)->scalarReducedPotential(arg2,arg3);
-  resultobj = SWIG_From_std_complex_Sl_double_Sg_(static_cast< std::complex<double> >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *Layer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
@@ -136630,14 +136582,6 @@ static PyMethodDef SwigMethods[] = {
 		"unsigned int Layer::numberOfSlices() const\n"
 		"\n"
 		""},
-	 { (char *)"Layer_scalarReducedPotential", _wrap_Layer_scalarReducedPotential, METH_VARARGS, (char *)"\n"
-		"Layer_scalarReducedPotential(Layer self, kvector_t k, double n_ref) -> complex_t\n"
-		"\n"
-		"complex_t Layer::scalarReducedPotential(kvector_t k, double n_ref) const\n"
-		"\n"
-		"Return the potential term that is used in the one-dimensional Fresnel calculations. \n"
-		"\n"
-		""},
 	 { (char *)"Layer_swigregister", Layer_swigregister, METH_VARARGS, NULL},
 	 { (char *)"new_LayerRoughness", _wrap_new_LayerRoughness, METH_VARARGS, (char *)"\n"
 		"LayerRoughness()\n"
-- 
GitLab