From 85d9629c4e3faf844ee0f7c23c39ac2d724877ca Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 3 Mar 2021 22:12:01 +0100
Subject: [PATCH] Copy-edit basic GISAS example

---
 Examples/scatter2d/CylindersInDWBA.py | 15 ++++---
 auto/Wrap/doxygenDevice.i             |  3 ++
 auto/Wrap/libBornAgainDevice.py       |  7 +--
 auto/Wrap/libBornAgainDevice_wrap.cpp | 65 ++++++++++++++++++++++++---
 4 files changed, 75 insertions(+), 15 deletions(-)
 mode change 100644 => 100755 Examples/scatter2d/CylindersInDWBA.py

diff --git a/Examples/scatter2d/CylindersInDWBA.py b/Examples/scatter2d/CylindersInDWBA.py
old mode 100644
new mode 100755
index a9b18ba2e49..0543af7624b
--- a/Examples/scatter2d/CylindersInDWBA.py
+++ b/Examples/scatter2d/CylindersInDWBA.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python3
 """
-Cylinder form factor in DWBA
+Basic example of a DWBA simulation of a GISAS experiment:
+Scattering by a dilute random assembly of cylinders on a substrate.
 """
 import bornagain as ba
 from bornagain import deg, nm
@@ -12,19 +13,19 @@ def get_sample():
     """
 
     # Define materials
-    material_Particle = ba.HomogeneousMaterial("Particle", 0.0006, 2e-08)
-    material_Substrate = ba.HomogeneousMaterial("Substrate", 6e-06, 2e-08)
-    material_Vacuum = ba.HomogeneousMaterial("Vacuum", 0.0, 0.0)
+    material_Particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-08)
+    material_Substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-08)
+    material_Vacuum = ba.HomogeneousMaterial("Vacuum", 0, 0)
 
     # Define form factors
-    ff = ba.FormFactorCylinder(5.0*nm, 5.0*nm)
+    ff = ba.FormFactorCylinder(5*nm, 5*nm)
 
     # Define particles
     particle = ba.Particle(material_Particle, ff)
 
     # Define particle layouts
     layout = ba.ParticleLayout()
-    layout.addParticle(particle, 1.0)
+    layout.addParticle(particle, 1)
     layout.setWeight(1)
     layout.setTotalParticleSurfaceDensity(0.01)
 
@@ -42,7 +43,7 @@ def get_sample():
 
 
 def get_simulation(sample):
-    beam = ba.Beam(1.0, 0.1*nm, ba.Direction(0.2*deg, 0*deg))
+    beam = ba.Beam(1, 0.1*nm, ba.Direction(0.2*deg, 0*deg))
     detector = ba.SphericalDetector(200, -2*deg, 2*deg, 200, 0*deg, 2*deg)
     simulation = ba.GISASSimulation(beam, sample, detector)
     return simulation
diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i
index 67f4e9e14d1..de634f45136 100644
--- a/auto/Wrap/doxygenDevice.i
+++ b/auto/Wrap/doxygenDevice.i
@@ -1608,6 +1608,9 @@ C++ includes: OutputData.h
 %feature("docstring")  OutputData::OutputData "OutputData< T >::OutputData(const OutputData &)=delete
 ";
 
+%feature("docstring")  OutputData::OutputData "OutputData< T >::OutputData(OutputData &&)
+";
+
 %feature("docstring")  OutputData::~OutputData "OutputData< T >::~OutputData()
 ";
 
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index 7819ef44a04..4add660a186 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -2226,13 +2226,14 @@ class IntensityData(object):
     thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
     __repr__ = _swig_repr
 
-    def __init__(self):
+    def __init__(self, *args):
         r"""
         __init__(IntensityData self) -> IntensityData
-        OutputData< T >::OutputData(const OutputData &)=delete
+        __init__(IntensityData self, IntensityData arg2) -> IntensityData
+        OutputData< T >::OutputData(OutputData &&)
 
         """
-        _libBornAgainDevice.IntensityData_swiginit(self, _libBornAgainDevice.new_IntensityData())
+        _libBornAgainDevice.IntensityData_swiginit(self, _libBornAgainDevice.new_IntensityData(*args))
     __swig_destroy__ = _libBornAgainDevice.delete_IntensityData
 
     def clone(self):
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index 6af8d7f64d8..dbb0e209eff 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -28861,11 +28861,11 @@ SWIGINTERN PyObject *vector_cvector_t_swiginit(PyObject *SWIGUNUSEDPARM(self), P
   return SWIG_Python_InitShadowInstance(args);
 }
 
-SWIGINTERN PyObject *_wrap_new_IntensityData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_IntensityData__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) {
   PyObject *resultobj = 0;
   OutputData< double > *result = 0 ;
   
-  if (!SWIG_Python_UnpackTuple(args, "new_IntensityData", 0, 0, 0)) SWIG_fail;
+  if ((nobjs < 0) || (nobjs > 0)) SWIG_fail;
   result = (OutputData< double > *)new OutputData< double >();
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OutputDataT_double_t, SWIG_POINTER_NEW |  0 );
   return resultobj;
@@ -28874,6 +28874,60 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_new_IntensityData__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
+  PyObject *resultobj = 0;
+  OutputData< double > *arg1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  OutputData< double > *result = 0 ;
+  
+  if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_OutputDataT_double_t,  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IntensityData" "', argument " "1"" of type '" "OutputData< double > &&""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_IntensityData" "', argument " "1"" of type '" "OutputData< double > &&""'"); 
+  }
+  arg1 = reinterpret_cast< OutputData< double > * >(argp1);
+  result = (OutputData< double > *)new OutputData< double >((OutputData< double > &&)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OutputDataT_double_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_IntensityData(PyObject *self, PyObject *args) {
+  Py_ssize_t argc;
+  PyObject *argv[2] = {
+    0
+  };
+  
+  if (!(argc = SWIG_Python_UnpackTuple(args, "new_IntensityData", 0, 1, argv))) SWIG_fail;
+  --argc;
+  if (argc == 0) {
+    return _wrap_new_IntensityData__SWIG_0(self, argc, argv);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OutputDataT_double_t, SWIG_POINTER_NO_NULL);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_IntensityData__SWIG_1(self, argc, argv);
+    }
+  }
+  
+fail:
+  SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_IntensityData'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    OutputData< double >::OutputData()\n"
+    "    OutputData< double >::OutputData(OutputData< double > &&)\n");
+  return 0;
+}
+
+
 SWIGINTERN PyObject *_wrap_delete_IntensityData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   OutputData< double > *arg1 = (OutputData< double > *) 0 ;
@@ -44424,9 +44478,10 @@ static PyMethodDef SwigMethods[] = {
 	 { "delete_vector_cvector_t", _wrap_delete_vector_cvector_t, METH_O, "delete_vector_cvector_t(vector_cvector_t self)"},
 	 { "vector_cvector_t_swigregister", vector_cvector_t_swigregister, METH_O, NULL},
 	 { "vector_cvector_t_swiginit", vector_cvector_t_swiginit, METH_VARARGS, NULL},
-	 { "new_IntensityData", _wrap_new_IntensityData, METH_NOARGS, "\n"
-		"new_IntensityData() -> IntensityData\n"
-		"OutputData< T >::OutputData(const OutputData &)=delete\n"
+	 { "new_IntensityData", _wrap_new_IntensityData, METH_VARARGS, "\n"
+		"IntensityData()\n"
+		"new_IntensityData(IntensityData arg1) -> IntensityData\n"
+		"OutputData< T >::OutputData(OutputData &&)\n"
 		"\n"
 		""},
 	 { "delete_IntensityData", _wrap_delete_IntensityData, METH_O, "\n"
-- 
GitLab