From 8e74e55ff2b98cfef7a166037faf96483c0ac16d Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Tue, 20 Jul 2021 14:33:57 +0200
Subject: [PATCH] rm ISimulation::clone, and a number of pointless tests

---
 Core/Fitting/FitObjective.cpp                 |   5 +-
 Core/Simulation/DepthProbeSimulation.cpp      |  17 --
 Core/Simulation/DepthProbeSimulation.h        |   4 -
 Core/Simulation/GISASSimulation.cpp           |   5 -
 Core/Simulation/GISASSimulation.h             |   4 -
 Core/Simulation/ISimulation.cpp               |  14 --
 Core/Simulation/ISimulation.h                 |   6 +-
 Core/Simulation/ISimulation2D.cpp             |   5 -
 Core/Simulation/ISimulation2D.h               |   4 -
 Core/Simulation/OffSpecularSimulation.cpp     |   9 -
 Core/Simulation/OffSpecularSimulation.h       |   4 -
 Core/Simulation/SpecularSimulation.cpp        |  14 --
 Core/Simulation/SpecularSimulation.h          |   4 -
 .../Core/CoreSpecial/BatchSimulation.cpp      |  57 -----
 .../Core/CoreSpecial/CMakeLists.txt           |   1 -
 .../Core/Core/GISASSimulationTest.cpp         |  24 --
 .../Core/Fresnel/DepthProbeSimulationTest.cpp |  34 ---
 .../Core/Fresnel/SpecularSimulationTest.cpp   |  61 -----
 auto/Wrap/doxygenCore.i                       |  18 --
 auto/Wrap/libBornAgainCore.py                 |  50 +---
 auto/Wrap/libBornAgainCore_wrap.cpp           | 224 ++----------------
 21 files changed, 22 insertions(+), 542 deletions(-)
 delete mode 100644 Tests/Functional/Core/CoreSpecial/BatchSimulation.cpp

diff --git a/Core/Fitting/FitObjective.cpp b/Core/Fitting/FitObjective.cpp
index c0212f0f169..cd7994f3a68 100644
--- a/Core/Fitting/FitObjective.cpp
+++ b/Core/Fitting/FitObjective.cpp
@@ -49,10 +49,7 @@ private:
 simulation_builder_t FitObjective::simulationBuilder(PyBuilderCallback& callback)
 {
     return [&callback](const mumufit::Parameters& params) {
-        auto simulation = callback.build_simulation(params);
-        std::unique_ptr<ISimulation> clone(simulation->clone());
-        delete simulation; // deleting Python object
-        return clone;
+        return std::unique_ptr<ISimulation>(callback.build_simulation(params));
     };
 }
 
diff --git a/Core/Simulation/DepthProbeSimulation.cpp b/Core/Simulation/DepthProbeSimulation.cpp
index d351a87c453..ac5cf7f033b 100644
--- a/Core/Simulation/DepthProbeSimulation.cpp
+++ b/Core/Simulation/DepthProbeSimulation.cpp
@@ -34,11 +34,6 @@ DepthProbeSimulation::DepthProbeSimulation() : ISimulation()
 
 DepthProbeSimulation::~DepthProbeSimulation() = default;
 
-DepthProbeSimulation* DepthProbeSimulation::clone() const
-{
-    return new DepthProbeSimulation(*this);
-}
-
 size_t DepthProbeSimulation::numberOfDiffuseElements() const
 {
     return getAlphaAxis()->size();
@@ -97,18 +92,6 @@ ICoordSystem* DepthProbeSimulation::createCoordSystem() const
 }
 #endif
 
-DepthProbeSimulation::DepthProbeSimulation(const DepthProbeSimulation& other)
-    : ISimulation(other), m_eles(other.m_eles), m_cache(other.m_cache)
-{
-    if (other.m_alpha_axis)
-        m_alpha_axis.reset(other.m_alpha_axis->clone());
-    if (other.m_z_axis)
-        m_z_axis.reset(other.m_z_axis->clone());
-    for (auto iter = m_eles.begin(); iter != m_eles.end(); ++iter)
-        iter->setZPositions(m_alpha_axis.get());
-    initialize();
-}
-
 void DepthProbeSimulation::setBeamParameters(double lambda, const IAxis& alpha_axis,
                                              const IFootprintFactor* beam_shape)
 {
diff --git a/Core/Simulation/DepthProbeSimulation.h b/Core/Simulation/DepthProbeSimulation.h
index 9a843b7a605..3a74c4d83d5 100644
--- a/Core/Simulation/DepthProbeSimulation.h
+++ b/Core/Simulation/DepthProbeSimulation.h
@@ -35,8 +35,6 @@ public:
     DepthProbeSimulation();
     ~DepthProbeSimulation() override;
 
-    DepthProbeSimulation* clone() const override;
-
     void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
 
     //! Returns the results of the simulation in a format that supports unit conversion and export
@@ -65,8 +63,6 @@ public:
 #endif
 
 private:
-    DepthProbeSimulation(const DepthProbeSimulation& other);
-
     //! Sets beam parameters with alpha_i of the beam defined in the range.
     void setBeamParameters(double lambda, const IAxis& alpha_axis,
                            const IFootprintFactor* beam_shape);
diff --git a/Core/Simulation/GISASSimulation.cpp b/Core/Simulation/GISASSimulation.cpp
index ed61f740542..31da289ca94 100644
--- a/Core/Simulation/GISASSimulation.cpp
+++ b/Core/Simulation/GISASSimulation.cpp
@@ -36,11 +36,6 @@ GISASSimulation::GISASSimulation()
     initialize();
 }
 
-GISASSimulation::GISASSimulation(const GISASSimulation& other) : ISimulation2D(other)
-{
-    initialize();
-}
-
 void GISASSimulation::initialize()
 {
     setName("GISASSimulation");
diff --git a/Core/Simulation/GISASSimulation.h b/Core/Simulation/GISASSimulation.h
index 98f1af45da7..12616f1b873 100644
--- a/Core/Simulation/GISASSimulation.h
+++ b/Core/Simulation/GISASSimulation.h
@@ -33,8 +33,6 @@ public:
     GISASSimulation();
     ~GISASSimulation() {}
 
-    GISASSimulation* clone() const override { return new GISASSimulation(*this); }
-
     void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
 
     //! Put into a clean state for running a simulation
@@ -55,8 +53,6 @@ public:
 #endif // SWIG
 
 private:
-    GISASSimulation(const GISASSimulation& other);
-
     //! Initializes the vector of ISimulation elements
     void initDiffuseElementVector() override;
 
diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp
index 66b1bd0bc24..3b3676d2359 100644
--- a/Core/Simulation/ISimulation.cpp
+++ b/Core/Simulation/ISimulation.cpp
@@ -121,20 +121,6 @@ ISimulation::ISimulation()
     initialize();
 }
 
-ISimulation::ISimulation(const ISimulation& other)
-    : ICloneable()
-    , INode()
-    , m_options(other.m_options)
-    , m_progress(other.m_progress)
-    , m_sample_provider(other.m_sample_provider)
-    , m_distribution_handler(other.m_distribution_handler)
-    , m_instrument(other.instrument())
-{
-    if (other.m_background)
-        setBackground(*other.m_background);
-    initialize();
-}
-
 ISimulation::~ISimulation() = default;
 
 void ISimulation::initialize()
diff --git a/Core/Simulation/ISimulation.h b/Core/Simulation/ISimulation.h
index d3c7f9fafaa..541106a8998 100644
--- a/Core/Simulation/ISimulation.h
+++ b/Core/Simulation/ISimulation.h
@@ -36,14 +36,12 @@ class ProcessedSample;
 //! weighting over parameter distributions, ...
 //! @ingroup simulation
 
-class ISimulation : public ICloneable, public INode {
+class ISimulation : public INode {
 public:
     ISimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector);
     ISimulation();
     virtual ~ISimulation();
 
-    virtual ISimulation* clone() const = 0;
-
     //! Put into a clean state for running a simulation
     virtual void prepareSimulation();
 
@@ -104,8 +102,6 @@ public:
 #endif // SWIG
 
 protected:
-    ISimulation(const ISimulation& other);
-
     //! Creates the appropriate data structure (e.g. 2D intensity map) from the calculated
     //! DiffuseElement objects
     virtual void transferResultsToIntensityMap() {}
diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp
index e9ef68da690..ba580c49333 100644
--- a/Core/Simulation/ISimulation2D.cpp
+++ b/Core/Simulation/ISimulation2D.cpp
@@ -70,11 +70,6 @@ void ISimulation2D::setRegionOfInterest(double xlow, double ylow, double xup, do
     detector2D().setRegionOfInterest(xlow, ylow, xup, yup);
 }
 
-ISimulation2D::ISimulation2D(const ISimulation2D& other)
-    : ISimulation(other), m_eles(other.m_eles), m_cache(other.m_cache)
-{
-}
-
 size_t ISimulation2D::numberOfDiffuseElements() const
 {
     if (!m_detector_context)
diff --git a/Core/Simulation/ISimulation2D.h b/Core/Simulation/ISimulation2D.h
index 59194fdac58..b11807126dd 100644
--- a/Core/Simulation/ISimulation2D.h
+++ b/Core/Simulation/ISimulation2D.h
@@ -33,8 +33,6 @@ public:
     ISimulation2D();
     ~ISimulation2D() override;
 
-    ISimulation2D* clone() const override = 0;
-
     IDetector2D& detector2D();
     const IDetector2D& detector2D() const;
 
@@ -68,8 +66,6 @@ public:
     void setRegionOfInterest(double xlow, double ylow, double xup, double yup);
 
 protected:
-    ISimulation2D(const ISimulation2D& other);
-
     virtual void initCoordSystem() {}
 
     //! Gets the number of elements this simulation needs to calculate
diff --git a/Core/Simulation/OffSpecularSimulation.cpp b/Core/Simulation/OffSpecularSimulation.cpp
index adf0ae1faf3..b90957b2b84 100644
--- a/Core/Simulation/OffSpecularSimulation.cpp
+++ b/Core/Simulation/OffSpecularSimulation.cpp
@@ -96,15 +96,6 @@ size_t OffSpecularSimulation::intensityMapSize() const
     return m_alpha_i_axis->size() * detector().axis(1).size();
 }
 
-OffSpecularSimulation::OffSpecularSimulation(const OffSpecularSimulation& other)
-    : ISimulation2D(other)
-{
-    if (other.m_alpha_i_axis)
-        m_alpha_i_axis.reset(other.m_alpha_i_axis->clone());
-    m_intensity_map.copyFrom(other.m_intensity_map);
-    initialize();
-}
-
 void OffSpecularSimulation::initDiffuseElementVector()
 {
     m_eles.clear();
diff --git a/Core/Simulation/OffSpecularSimulation.h b/Core/Simulation/OffSpecularSimulation.h
index 764b3d2c907..6f78a05fc6a 100644
--- a/Core/Simulation/OffSpecularSimulation.h
+++ b/Core/Simulation/OffSpecularSimulation.h
@@ -29,8 +29,6 @@ public:
     OffSpecularSimulation();
     ~OffSpecularSimulation() override {}
 
-    OffSpecularSimulation* clone() const override { return new OffSpecularSimulation(*this); }
-
     void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
 
     //! Put into a clean state for running a simulation
@@ -54,8 +52,6 @@ public:
     size_t intensityMapSize() const override;
 
 private:
-    OffSpecularSimulation(const OffSpecularSimulation& other);
-
     //! Initializes the vector of ISimulation elements
     void initDiffuseElementVector() override;
 
diff --git a/Core/Simulation/SpecularSimulation.cpp b/Core/Simulation/SpecularSimulation.cpp
index eb2a5d8f88b..2449bebe65f 100644
--- a/Core/Simulation/SpecularSimulation.cpp
+++ b/Core/Simulation/SpecularSimulation.cpp
@@ -64,22 +64,8 @@ SpecularSimulation::SpecularSimulation() : ISimulation()
     instrument().setDetector(detector);
 }
 
-SpecularSimulation::SpecularSimulation(const SpecularSimulation& other)
-    : ISimulation(other)
-    , m_scan(other.m_scan ? other.m_scan->clone() : nullptr)
-    , m_eles(other.m_eles)
-    , m_cache(other.m_cache)
-{
-    initialize();
-}
-
 SpecularSimulation::~SpecularSimulation() = default;
 
-SpecularSimulation* SpecularSimulation::clone() const
-{
-    return new SpecularSimulation(*this);
-}
-
 void SpecularSimulation::prepareSimulation()
 {
     if (detector().dimension() != 1) // detector must have only one axis
diff --git a/Core/Simulation/SpecularSimulation.h b/Core/Simulation/SpecularSimulation.h
index cf3cd0a541c..8443197b552 100644
--- a/Core/Simulation/SpecularSimulation.h
+++ b/Core/Simulation/SpecularSimulation.h
@@ -34,8 +34,6 @@ public:
     SpecularSimulation();
     ~SpecularSimulation() override;
 
-    SpecularSimulation* clone() const override;
-
     //! Put into a clean state for running a simulation.
     void prepareSimulation() override;
 
@@ -65,8 +63,6 @@ public:
 #endif // USER_API
 
 private:
-    SpecularSimulation(const SpecularSimulation& other); // used by clone()
-
     //! Initializes the vector of ISimulation elements
     void initDiffuseElementVector() override;
 
diff --git a/Tests/Functional/Core/CoreSpecial/BatchSimulation.cpp b/Tests/Functional/Core/CoreSpecial/BatchSimulation.cpp
deleted file mode 100644
index 9308dc2e1ce..00000000000
--- a/Tests/Functional/Core/CoreSpecial/BatchSimulation.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//  ************************************************************************************************
-//
-//  BornAgain: simulate and fit reflection and scattering
-//
-//! @file      Tests/Functional/Core/CoreSpecial/BatchSimulation.cpp
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2018
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-//  ************************************************************************************************
-
-#include "Core/Examples/SimulationFactory.h"
-#include "Device/Data/DataUtils.h"
-#include "Sample/StandardSamples/SampleBuilderFactory.h"
-#include "Tests/GTestWrapper/google_test.h"
-#include <iostream>
-#include <memory>
-
-class BatchSimulation : public ::testing::Test {
-};
-
-TEST_F(BatchSimulation, BatchSimulation)
-{
-    SimulationFactory sim_registry;
-    const std::unique_ptr<ISimulation> simulation = sim_registry.createItemPtr("MiniGISAS");
-
-    SampleBuilderFactory sampleFactory;
-    std::shared_ptr<class ISampleBuilder> builder(
-        sampleFactory.createItemPtr("CylindersInBABuilder").release());
-    simulation->setSampleBuilder(builder);
-    simulation->runSimulation();
-    auto sim_result = simulation->result();
-    const auto reference = sim_result.data();
-    const auto result = reference->clone();
-    result->setAllTo(0.0);
-
-    const unsigned n_batches = 9;
-    const double threshold = 2e-10;
-    for (unsigned i_batch = 0; i_batch < n_batches; ++i_batch) {
-        const std::unique_ptr<ISimulation> batch(simulation->clone());
-        ThreadInfo threadInfo;
-        threadInfo.n_threads = 1;
-        threadInfo.n_batches = n_batches;
-        threadInfo.current_batch = i_batch;
-        batch->options().setThreadInfo(threadInfo);
-        batch->runSimulation();
-        auto batch_result = batch->result();
-        std::unique_ptr<OutputData<double>> batchResult(batch_result.data());
-        *result += *batchResult;
-    }
-
-    double diff = DataUtils::Data::relativeDataDifference(*result, *reference);
-
-    EXPECT_LE(diff, threshold);
-}
diff --git a/Tests/Functional/Core/CoreSpecial/CMakeLists.txt b/Tests/Functional/Core/CoreSpecial/CMakeLists.txt
index 9e0fa22a79b..0806087ce79 100644
--- a/Tests/Functional/Core/CoreSpecial/CMakeLists.txt
+++ b/Tests/Functional/Core/CoreSpecial/CMakeLists.txt
@@ -3,7 +3,6 @@ include(GoogleTest) # provides gtest_discover_tests
 set(test TestCoreSpecial)
 
 set(source_files
-    BatchSimulation.cpp
     FourierTransformationTest.cpp
     CoreIOPathTest.cpp
     )
diff --git a/Tests/UnitTests/Core/Core/GISASSimulationTest.cpp b/Tests/UnitTests/Core/Core/GISASSimulationTest.cpp
index a41af4cb23e..ea084a58fcf 100644
--- a/Tests/UnitTests/Core/Core/GISASSimulationTest.cpp
+++ b/Tests/UnitTests/Core/Core/GISASSimulationTest.cpp
@@ -30,27 +30,3 @@ TEST_F(GISASSimulationTest, SimulationConstruction)
     EXPECT_NO_THROW(simulation.result());
     EXPECT_EQ(2u, simulation.getChildren().size());
 }
-
-TEST_F(GISASSimulationTest, SimulationClone1)
-{
-    GISASSimulation simulation;
-    auto p_clone = simulation.clone();
-    EXPECT_EQ(nullptr, p_clone->sample());
-    EXPECT_EQ(0u, p_clone->intensityMapSize());
-    EXPECT_THROW(p_clone->result(), std::runtime_error);
-    EXPECT_EQ(1u, p_clone->getChildren().size());
-    delete p_clone;
-}
-
-TEST_F(GISASSimulationTest, SimulationClone2)
-{
-    GISASSimulation simulation;
-    simulation.setSample(MultiLayer());
-    simulation.setDetectorParameters(10, -2.0, 2.0, 20, 0.0, 2.0);
-    auto p_clone = simulation.clone();
-    EXPECT_NE(nullptr, p_clone->sample());
-    EXPECT_EQ(200u, p_clone->intensityMapSize());
-    EXPECT_NO_THROW(p_clone->result());
-    EXPECT_EQ(2u, p_clone->getChildren().size());
-    delete p_clone;
-}
diff --git a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp
index 4334f1a3b6a..816dd672d40 100644
--- a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp
+++ b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp
@@ -62,15 +62,6 @@ void DepthProbeSimulationTest::checkEmptySimulation(DepthProbeSimulation& sim)
     checkBeamState(sim);
 }
 
-TEST_F(DepthProbeSimulationTest, InitialState)
-{
-    std::unique_ptr<DepthProbeSimulation> sim = std::make_unique<DepthProbeSimulation>();
-    std::unique_ptr<DepthProbeSimulation> sim_clone(sim->clone());
-    checkEmptySimulation(*sim);
-    sim.reset();
-    checkEmptySimulation(*sim_clone);
-}
-
 TEST_F(DepthProbeSimulationTest, CheckAxesOfDefaultSimulation)
 {
     auto sim = defaultSimulation();
@@ -86,11 +77,6 @@ TEST_F(DepthProbeSimulationTest, CheckAxesOfDefaultSimulation)
     EXPECT_EQ(z_axis->size(), 12u);
     EXPECT_EQ(z_axis->lowerBound(), -30.0 * Units::nm);
     EXPECT_EQ(z_axis->upperBound(), 10.0 * Units::nm);
-
-    const auto sim_clone = sim->clone();
-    EXPECT_FALSE(alpha_axis == sim_clone->getAlphaAxis());
-    EXPECT_FALSE(z_axis == sim_clone->getZAxis());
-    delete sim_clone;
 }
 
 TEST_F(DepthProbeSimulationTest, SetBeamParameters)
@@ -164,26 +150,6 @@ TEST_F(DepthProbeSimulationTest, ResultAquisition)
     checkBeamState(*sim);
 }
 
-TEST_F(DepthProbeSimulationTest, SimulationClone)
-{
-    auto sim = defaultSimulation();
-
-    sim->runSimulation();
-    SimulationResult sim_result = sim->result();
-    std::unique_ptr<DepthProbeSimulation> clone(sim->clone());
-    sim.reset();
-
-    SimulationResult clone_result = clone->result();
-
-    auto sim_output = sim_result.data();
-    auto clone_output = clone_result.data();
-
-    EXPECT_EQ(sim_output->getAllocatedSize(), clone_output->getAllocatedSize());
-    for (size_t i = 0; i < sim_output->getAllocatedSize(); ++i) {
-        EXPECT_EQ((*sim_output)[i], (*clone_output)[i]);
-    }
-}
-
 TEST_F(DepthProbeSimulationTest, AddingBeamDistributions)
 {
     auto sim = defaultSimulation();
diff --git a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp
index 366b02e230f..ed7dd91f6c0 100644
--- a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp
+++ b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp
@@ -56,17 +56,6 @@ std::unique_ptr<SpecularSimulation> SpecularSimulationTest::defaultSimulation()
     return result;
 }
 
-TEST_F(SpecularSimulationTest, CloneOfEmpty)
-{
-    SpecularSimulation sim;
-
-    std::unique_ptr<SpecularSimulation> clone(sim.clone());
-    ASSERT_THROW(clone->runSimulation(), std::runtime_error);
-    ASSERT_THROW(clone->coordinateAxis(), std::runtime_error);
-    EXPECT_EQ(nullptr, clone->sample());
-    ASSERT_THROW(clone->result(), std::runtime_error);
-}
-
 TEST_F(SpecularSimulationTest, SetAngularScan)
 {
     SpecularSimulation sim;
@@ -212,56 +201,6 @@ TEST_F(SpecularSimulationTest, ConstructSimulation)
                 Units::deg * 1e-10);
 }
 
-TEST_F(SpecularSimulationTest, SimulationClone)
-{
-    auto sim = SpecularSimulation();
-
-    const auto polarization = kvector_t({0., 0., 0.876});
-    const auto analyzer = kvector_t({0., 0., 1.});
-    sim.beam().setPolarization(polarization);
-    sim.detector().setAnalyzerProperties(analyzer, 0.33, 0.22);
-    sim.beam().setIntensity(42.42);
-    sim.setBackground(ConstantBackground(1.e-7));
-    sim.setSample(multilayer);
-    const auto scan = AngularSpecScan(1.0, 10, 0.0 * Units::deg, 2.0 * Units::deg);
-    sim.setScan(scan);
-
-    std::unique_ptr<SpecularSimulation> clone(sim.clone());
-
-    EXPECT_EQ(3u, clone->sample()->numberOfLayers());
-
-    SimulationResult clone_result = clone->result();
-    auto data = clone_result.data();
-    EXPECT_EQ(data->getAllocatedSize(), 10u);
-    EXPECT_EQ(data->totalSum(), 0.0);
-    EXPECT_EQ(0.0 * Units::deg, clone->coordinateAxis()->lowerBound());
-    EXPECT_EQ(2.0 * Units::deg, clone->coordinateAxis()->upperBound());
-
-    EXPECT_EQ(clone->beam().getBlochVector(), polarization);
-    EXPECT_EQ(clone->beam().intensity(), 42.42);
-    EXPECT_EQ(clone->detector().detectionProperties().analyzerDirection(), analyzer);
-    EXPECT_EQ(clone->detector().detectionProperties().analyzerEfficiency(), 0.33);
-    EXPECT_EQ(clone->detector().detectionProperties().analyzerTotalTransmission(), 0.22);
-
-    const auto background = dynamic_cast<const ConstantBackground*>(clone->background());
-    EXPECT_NE(background, nullptr);
-    if (background) {
-        EXPECT_EQ(background->backgroundValue(), 1.e-7);
-    }
-    auto scanClone = dynamic_cast<const AngularSpecScan*>(clone->dataHandler());
-    EXPECT_NE(scanClone, nullptr);
-    EXPECT_NE(scanClone->coordinateAxis(), scan.coordinateAxis());
-    EXPECT_EQ(*scanClone->coordinateAxis(), *scan.coordinateAxis());
-
-    sim.runSimulation();
-
-    std::unique_ptr<SpecularSimulation> clone2(sim.clone());
-    clone_result = clone2->result();
-
-    const auto output_data = clone_result.data();
-    EXPECT_EQ(10u, output_data->getAllocatedSize());
-}
-
 TEST_F(SpecularSimulationTest, AddingBeamDistributions)
 {
     auto sim = defaultSimulation();
diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i
index 93b3d858aac..b1c66681175 100644
--- a/auto/Wrap/doxygenCore.i
+++ b/auto/Wrap/doxygenCore.i
@@ -353,9 +353,6 @@ Set calculation flag (if it's false, zero intensity is assigned to the element)
 %feature("docstring")  DepthProbeSimulation::~DepthProbeSimulation "DepthProbeSimulation::~DepthProbeSimulation() override
 ";
 
-%feature("docstring")  DepthProbeSimulation::clone "DepthProbeSimulation * DepthProbeSimulation::clone() const override
-";
-
 %feature("docstring")  DepthProbeSimulation::accept "void DepthProbeSimulation::accept(INodeVisitor *visitor) const override
 ";
 
@@ -737,9 +734,6 @@ C++ includes: GISASSimulation.h
 %feature("docstring")  GISASSimulation::~GISASSimulation "GISASSimulation::~GISASSimulation()
 ";
 
-%feature("docstring")  GISASSimulation::clone "GISASSimulation* GISASSimulation::clone() const override
-";
-
 %feature("docstring")  GISASSimulation::accept "void GISASSimulation::accept(INodeVisitor *visitor) const override
 ";
 
@@ -949,9 +943,6 @@ C++ includes: ISimulation.h
 %feature("docstring")  ISimulation::~ISimulation "ISimulation::~ISimulation()
 ";
 
-%feature("docstring")  ISimulation::clone "virtual ISimulation* ISimulation::clone() const =0
-";
-
 %feature("docstring")  ISimulation::prepareSimulation "void ISimulation::prepareSimulation()
 
 Put into a clean state for running a simulation. 
@@ -1076,9 +1067,6 @@ C++ includes: ISimulation2D.h
 %feature("docstring")  ISimulation2D::~ISimulation2D "ISimulation2D::~ISimulation2D() override
 ";
 
-%feature("docstring")  ISimulation2D::clone "ISimulation2D* ISimulation2D::clone() const override=0
-";
-
 %feature("docstring")  ISimulation2D::detector2D "IDetector2D & ISimulation2D::detector2D()
 ";
 
@@ -1427,9 +1415,6 @@ C++ includes: OffSpecularSimulation.h
 %feature("docstring")  OffSpecularSimulation::~OffSpecularSimulation "OffSpecularSimulation::~OffSpecularSimulation() override
 ";
 
-%feature("docstring")  OffSpecularSimulation::clone "OffSpecularSimulation* OffSpecularSimulation::clone() const override
-";
-
 %feature("docstring")  OffSpecularSimulation::accept "void OffSpecularSimulation::accept(INodeVisitor *visitor) const override
 ";
 
@@ -2023,9 +2008,6 @@ C++ includes: SpecularSimulation.h
 %feature("docstring")  SpecularSimulation::~SpecularSimulation "SpecularSimulation::~SpecularSimulation() override
 ";
 
-%feature("docstring")  SpecularSimulation::clone "SpecularSimulation * SpecularSimulation::clone() const override
-";
-
 %feature("docstring")  SpecularSimulation::prepareSimulation "void SpecularSimulation::prepareSimulation() override
 
 Put into a clean state for running a simulation. 
diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py
index d9dc0a8b058..c03d544a173 100644
--- a/auto/Wrap/libBornAgainCore.py
+++ b/auto/Wrap/libBornAgainCore.py
@@ -3459,7 +3459,7 @@ class QSpecScan(object):
 # Register QSpecScan in _libBornAgainCore:
 _libBornAgainCore.QSpecScan_swigregister(QSpecScan)
 
-class ISimulation(libBornAgainBase.ICloneable, libBornAgainParam.INode):
+class ISimulation(libBornAgainParam.INode):
     r"""
 
 
@@ -3476,14 +3476,6 @@ class ISimulation(libBornAgainBase.ICloneable, libBornAgainParam.INode):
     __repr__ = _swig_repr
     __swig_destroy__ = _libBornAgainCore.delete_ISimulation
 
-    def clone(self):
-        r"""
-        clone(ISimulation self) -> ISimulation
-        virtual ISimulation* ISimulation::clone() const =0
-
-        """
-        return _libBornAgainCore.ISimulation_clone(self)
-
     def prepareSimulation(self):
         r"""
         prepareSimulation(ISimulation self)
@@ -3698,14 +3690,6 @@ class ISimulation2D(ISimulation):
     __repr__ = _swig_repr
     __swig_destroy__ = _libBornAgainCore.delete_ISimulation2D
 
-    def clone(self):
-        r"""
-        clone(ISimulation2D self) -> ISimulation2D
-        ISimulation2D* ISimulation2D::clone() const override=0
-
-        """
-        return _libBornAgainCore.ISimulation2D_clone(self)
-
     def detector2D(self, *args):
         r"""
         detector2D(ISimulation2D self) -> IDetector2D
@@ -3831,14 +3815,6 @@ class GISASSimulation(ISimulation2D):
         _libBornAgainCore.GISASSimulation_swiginit(self, _libBornAgainCore.new_GISASSimulation(*args))
     __swig_destroy__ = _libBornAgainCore.delete_GISASSimulation
 
-    def clone(self):
-        r"""
-        clone(GISASSimulation self) -> GISASSimulation
-        GISASSimulation* GISASSimulation::clone() const override
-
-        """
-        return _libBornAgainCore.GISASSimulation_clone(self)
-
     def accept(self, visitor):
         r"""
         accept(GISASSimulation self, INodeVisitor * visitor)
@@ -3905,14 +3881,6 @@ class DepthProbeSimulation(ISimulation):
         _libBornAgainCore.DepthProbeSimulation_swiginit(self, _libBornAgainCore.new_DepthProbeSimulation())
     __swig_destroy__ = _libBornAgainCore.delete_DepthProbeSimulation
 
-    def clone(self):
-        r"""
-        clone(DepthProbeSimulation self) -> DepthProbeSimulation
-        DepthProbeSimulation * DepthProbeSimulation::clone() const override
-
-        """
-        return _libBornAgainCore.DepthProbeSimulation_clone(self)
-
     def accept(self, visitor):
         r"""
         accept(DepthProbeSimulation self, INodeVisitor * visitor)
@@ -4006,14 +3974,6 @@ class SpecularSimulation(ISimulation):
         _libBornAgainCore.SpecularSimulation_swiginit(self, _libBornAgainCore.new_SpecularSimulation())
     __swig_destroy__ = _libBornAgainCore.delete_SpecularSimulation
 
-    def clone(self):
-        r"""
-        clone(SpecularSimulation self) -> SpecularSimulation
-        SpecularSimulation * SpecularSimulation::clone() const override
-
-        """
-        return _libBornAgainCore.SpecularSimulation_clone(self)
-
     def prepareSimulation(self):
         r"""
         prepareSimulation(SpecularSimulation self)
@@ -4113,14 +4073,6 @@ class OffSpecularSimulation(ISimulation2D):
         _libBornAgainCore.OffSpecularSimulation_swiginit(self, _libBornAgainCore.new_OffSpecularSimulation(*args))
     __swig_destroy__ = _libBornAgainCore.delete_OffSpecularSimulation
 
-    def clone(self):
-        r"""
-        clone(OffSpecularSimulation self) -> OffSpecularSimulation
-        OffSpecularSimulation* OffSpecularSimulation::clone() const override
-
-        """
-        return _libBornAgainCore.OffSpecularSimulation_clone(self)
-
     def accept(self, visitor):
         r"""
         accept(OffSpecularSimulation self, INodeVisitor * visitor)
diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp
index 353159d1e0b..18f748a742e 100644
--- a/auto/Wrap/libBornAgainCore_wrap.cpp
+++ b/auto/Wrap/libBornAgainCore_wrap.cpp
@@ -38772,29 +38772,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_ISimulation_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ISimulation *arg1 = (ISimulation *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  ISimulation *result = 0 ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ISimulation, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation_clone" "', argument " "1"" of type '" "ISimulation const *""'"); 
-  }
-  arg1 = reinterpret_cast< ISimulation * >(argp1);
-  result = (ISimulation *)((ISimulation const *)arg1)->clone();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ISimulation, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_ISimulation_prepareSimulation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   ISimulation *arg1 = (ISimulation *) 0 ;
@@ -39880,29 +39857,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_ISimulation2D_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  ISimulation2D *arg1 = (ISimulation2D *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  ISimulation2D *result = 0 ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ISimulation2D, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ISimulation2D_clone" "', argument " "1"" of type '" "ISimulation2D const *""'"); 
-  }
-  arg1 = reinterpret_cast< ISimulation2D * >(argp1);
-  result = (ISimulation2D *)((ISimulation2D const *)arg1)->clone();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ISimulation2D, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_ISimulation2D_detector2D__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
   PyObject *resultobj = 0;
   ISimulation2D *arg1 = (ISimulation2D *) 0 ;
@@ -40424,29 +40378,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_GISASSimulation_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  GISASSimulation *arg1 = (GISASSimulation *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  GISASSimulation *result = 0 ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GISASSimulation, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GISASSimulation_clone" "', argument " "1"" of type '" "GISASSimulation const *""'"); 
-  }
-  arg1 = reinterpret_cast< GISASSimulation * >(argp1);
-  result = (GISASSimulation *)((GISASSimulation const *)arg1)->clone();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GISASSimulation, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_GISASSimulation_accept(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   GISASSimulation *arg1 = (GISASSimulation *) 0 ;
@@ -40635,29 +40566,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_DepthProbeSimulation_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  DepthProbeSimulation *arg1 = (DepthProbeSimulation *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  DepthProbeSimulation *result = 0 ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DepthProbeSimulation, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DepthProbeSimulation_clone" "', argument " "1"" of type '" "DepthProbeSimulation const *""'"); 
-  }
-  arg1 = reinterpret_cast< DepthProbeSimulation * >(argp1);
-  result = (DepthProbeSimulation *)((DepthProbeSimulation const *)arg1)->clone();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DepthProbeSimulation, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_DepthProbeSimulation_accept(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   DepthProbeSimulation *arg1 = (DepthProbeSimulation *) 0 ;
@@ -41071,29 +40979,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_SpecularSimulation_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  SpecularSimulation *arg1 = (SpecularSimulation *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  SpecularSimulation *result = 0 ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SpecularSimulation, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SpecularSimulation_clone" "', argument " "1"" of type '" "SpecularSimulation const *""'"); 
-  }
-  arg1 = reinterpret_cast< SpecularSimulation * >(argp1);
-  result = (SpecularSimulation *)((SpecularSimulation const *)arg1)->clone();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SpecularSimulation, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_SpecularSimulation_prepareSimulation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   SpecularSimulation *arg1 = (SpecularSimulation *) 0 ;
@@ -41398,29 +41283,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_OffSpecularSimulation_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  OffSpecularSimulation *arg1 = (OffSpecularSimulation *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  OffSpecularSimulation *result = 0 ;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OffSpecularSimulation, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OffSpecularSimulation_clone" "', argument " "1"" of type '" "OffSpecularSimulation const *""'"); 
-  }
-  arg1 = reinterpret_cast< OffSpecularSimulation * >(argp1);
-  result = (OffSpecularSimulation *)((OffSpecularSimulation const *)arg1)->clone();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OffSpecularSimulation, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_OffSpecularSimulation_accept(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   OffSpecularSimulation *arg1 = (OffSpecularSimulation *) 0 ;
@@ -44470,11 +44332,6 @@ static PyMethodDef SwigMethods[] = {
 		"ISimulation::~ISimulation()\n"
 		"\n"
 		""},
-	 { "ISimulation_clone", _wrap_ISimulation_clone, METH_O, "\n"
-		"ISimulation_clone(ISimulation self) -> ISimulation\n"
-		"virtual ISimulation* ISimulation::clone() const =0\n"
-		"\n"
-		""},
 	 { "ISimulation_prepareSimulation", _wrap_ISimulation_prepareSimulation, METH_O, "\n"
 		"ISimulation_prepareSimulation(ISimulation self)\n"
 		"void ISimulation::prepareSimulation()\n"
@@ -44607,11 +44464,6 @@ static PyMethodDef SwigMethods[] = {
 		"ISimulation2D::~ISimulation2D() override\n"
 		"\n"
 		""},
-	 { "ISimulation2D_clone", _wrap_ISimulation2D_clone, METH_O, "\n"
-		"ISimulation2D_clone(ISimulation2D self) -> ISimulation2D\n"
-		"ISimulation2D* ISimulation2D::clone() const override=0\n"
-		"\n"
-		""},
 	 { "ISimulation2D_detector2D", _wrap_ISimulation2D_detector2D, METH_VARARGS, "\n"
 		"ISimulation2D_detector2D(ISimulation2D self) -> IDetector2D\n"
 		"ISimulation2D_detector2D(ISimulation2D self) -> IDetector2D const &\n"
@@ -44702,11 +44554,6 @@ static PyMethodDef SwigMethods[] = {
 		"GISASSimulation::~GISASSimulation()\n"
 		"\n"
 		""},
-	 { "GISASSimulation_clone", _wrap_GISASSimulation_clone, METH_O, "\n"
-		"GISASSimulation_clone(GISASSimulation self) -> GISASSimulation\n"
-		"GISASSimulation* GISASSimulation::clone() const override\n"
-		"\n"
-		""},
 	 { "GISASSimulation_accept", _wrap_GISASSimulation_accept, METH_VARARGS, "\n"
 		"GISASSimulation_accept(GISASSimulation self, INodeVisitor * visitor)\n"
 		"void GISASSimulation::accept(INodeVisitor *visitor) const override\n"
@@ -44752,11 +44599,6 @@ static PyMethodDef SwigMethods[] = {
 		"DepthProbeSimulation::~DepthProbeSimulation() override\n"
 		"\n"
 		""},
-	 { "DepthProbeSimulation_clone", _wrap_DepthProbeSimulation_clone, METH_O, "\n"
-		"DepthProbeSimulation_clone(DepthProbeSimulation self) -> DepthProbeSimulation\n"
-		"DepthProbeSimulation * DepthProbeSimulation::clone() const override\n"
-		"\n"
-		""},
 	 { "DepthProbeSimulation_accept", _wrap_DepthProbeSimulation_accept, METH_VARARGS, "\n"
 		"DepthProbeSimulation_accept(DepthProbeSimulation self, INodeVisitor * visitor)\n"
 		"void DepthProbeSimulation::accept(INodeVisitor *visitor) const override\n"
@@ -44816,11 +44658,6 @@ static PyMethodDef SwigMethods[] = {
 		"SpecularSimulation::~SpecularSimulation() override\n"
 		"\n"
 		""},
-	 { "SpecularSimulation_clone", _wrap_SpecularSimulation_clone, METH_O, "\n"
-		"SpecularSimulation_clone(SpecularSimulation self) -> SpecularSimulation\n"
-		"SpecularSimulation * SpecularSimulation::clone() const override\n"
-		"\n"
-		""},
 	 { "SpecularSimulation_prepareSimulation", _wrap_SpecularSimulation_prepareSimulation, METH_O, "\n"
 		"SpecularSimulation_prepareSimulation(SpecularSimulation self)\n"
 		"void SpecularSimulation::prepareSimulation() override\n"
@@ -44881,11 +44718,6 @@ static PyMethodDef SwigMethods[] = {
 		"OffSpecularSimulation::~OffSpecularSimulation() override\n"
 		"\n"
 		""},
-	 { "OffSpecularSimulation_clone", _wrap_OffSpecularSimulation_clone, METH_O, "\n"
-		"OffSpecularSimulation_clone(OffSpecularSimulation self) -> OffSpecularSimulation\n"
-		"OffSpecularSimulation* OffSpecularSimulation::clone() const override\n"
-		"\n"
-		""},
 	 { "OffSpecularSimulation_accept", _wrap_OffSpecularSimulation_accept, METH_VARARGS, "\n"
 		"OffSpecularSimulation_accept(OffSpecularSimulation self, INodeVisitor * visitor)\n"
 		"void OffSpecularSimulation::accept(INodeVisitor *visitor) const override\n"
@@ -45379,56 +45211,38 @@ static void *_p_GISASSimulationTo_p_ISimulation2D(void *x, int *SWIGUNUSEDPARM(n
 static void *_p_OffSpecularSimulationTo_p_ISimulation2D(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ISimulation2D *)  ((OffSpecularSimulation *) x));
 }
-static void *_p_IFormFactorTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISampleNode *) ((IFormFactor *) x));
+static void *_p_IChiSquaredModuleTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *)  ((IChiSquaredModule *) x));
 }
-static void *_p_OffSpecularSimulationTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISimulation *)(ISimulation2D *) ((OffSpecularSimulation *) x));
+static void *_p_ChiSquaredModuleTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *) (IChiSquaredModule *) ((ChiSquaredModule *) x));
 }
-static void *_p_SpecularSimulationTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISimulation *) ((SpecularSimulation *) x));
+static void *_p_IFormFactorTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *) (ISampleNode *) ((IFormFactor *) x));
 }
-static void *_p_DepthProbeSimulationTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISimulation *) ((DepthProbeSimulation *) x));
+static void *_p_AngularSpecScanTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *) (ISpecularScan *) ((AngularSpecScan *) x));
 }
-static void *_p_GISASSimulationTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISimulation *)(ISimulation2D *) ((GISASSimulation *) x));
+static void *_p_QSpecScanTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *) (ISpecularScan *) ((QSpecScan *) x));
 }
-static void *_p_ISimulationTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *)  ((ISimulation *) x));
+static void *_p_IBackgroundTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *)  ((IBackground *) x));
 }
 static void *_p_ConstantBackgroundTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *) (IBackground *) ((ConstantBackground *) x));
 }
-static void *_p_IBackgroundTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *)  ((IBackground *) x));
-}
 static void *_p_PoissonNoiseBackgroundTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *) (IBackground *) ((PoissonNoiseBackground *) x));
 }
-static void *_p_ISpecularScanTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *)  ((ISpecularScan *) x));
-}
-static void *_p_IBornFFTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISampleNode *)(IFormFactor *) ((IBornFF *) x));
-}
-static void *_p_IChiSquaredModuleTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *)  ((IChiSquaredModule *) x));
-}
-static void *_p_ChiSquaredModuleTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (IChiSquaredModule *) ((ChiSquaredModule *) x));
-}
 static void *_p_ISampleNodeTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *)  ((ISampleNode *) x));
 }
-static void *_p_QSpecScanTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISpecularScan *) ((QSpecScan *) x));
-}
-static void *_p_AngularSpecScanTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISpecularScan *) ((AngularSpecScan *) x));
+static void *_p_IBornFFTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *) (ISampleNode *)(IFormFactor *) ((IBornFF *) x));
 }
-static void *_p_ISimulation2DTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISimulation *) ((ISimulation2D *) x));
+static void *_p_ISpecularScanTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *)  ((ISpecularScan *) x));
 }
 static swig_type_info _swigt__p_AngularSpecScan = {"_p_AngularSpecScan", "AngularSpecScan *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_AxisInfo = {"_p_AxisInfo", "std::vector< AxisInfo >::value_type *|AxisInfo *", 0, 0, (void*)0, 0};
@@ -45447,8 +45261,8 @@ static swig_type_info _swigt__p_IBackground = {"_p_IBackground", "IBackground *"
 static swig_type_info _swigt__p_IChiSquaredModule = {"_p_IChiSquaredModule", "IChiSquaredModule *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_ICloneable = {"_p_ICloneable", "ICloneable *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_IFormFactor = {"_p_IFormFactor", 0, 0, 0, 0, 0};
-static swig_type_info _swigt__p_IBornFF = {"_p_IBornFF", 0, 0, 0, 0, 0};
 static swig_type_info _swigt__p_ISampleNode = {"_p_ISampleNode", 0, 0, 0, 0, 0};
+static swig_type_info _swigt__p_IBornFF = {"_p_IBornFF", 0, 0, 0, 0, 0};
 static swig_type_info _swigt__p_IComponent = {"_p_IComponent", "IComponent *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_IDetector = {"_p_IDetector", "IDetector *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_IDetector2D = {"_p_IDetector2D", "IDetector2D *", 0, 0, (void*)0, 0};
@@ -45664,9 +45478,9 @@ static swig_cast_info _swigc__p_IAxis[] = {  {&_swigt__p_IAxis, 0, 0, 0},{0, 0,
 static swig_cast_info _swigc__p_IBackground[] = {  {&_swigt__p_IBackground, 0, 0, 0},  {&_swigt__p_ConstantBackground, _p_ConstantBackgroundTo_p_IBackground, 0, 0},  {&_swigt__p_PoissonNoiseBackground, _p_PoissonNoiseBackgroundTo_p_IBackground, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IChiSquaredModule[] = {  {&_swigt__p_IChiSquaredModule, 0, 0, 0},  {&_swigt__p_ChiSquaredModule, _p_ChiSquaredModuleTo_p_IChiSquaredModule, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IFormFactor[] = {{&_swigt__p_IFormFactor, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_IBornFF[] = {{&_swigt__p_IBornFF, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ISampleNode[] = {{&_swigt__p_ISampleNode, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_ICloneable[] = {  {&_swigt__p_IFormFactor, _p_IFormFactorTo_p_ICloneable, 0, 0},  {&_swigt__p_SpecularSimulation, _p_SpecularSimulationTo_p_ICloneable, 0, 0},  {&_swigt__p_DepthProbeSimulation, _p_DepthProbeSimulationTo_p_ICloneable, 0, 0},  {&_swigt__p_OffSpecularSimulation, _p_OffSpecularSimulationTo_p_ICloneable, 0, 0},  {&_swigt__p_GISASSimulation, _p_GISASSimulationTo_p_ICloneable, 0, 0},  {&_swigt__p_ISimulation, _p_ISimulationTo_p_ICloneable, 0, 0},  {&_swigt__p_ICloneable, 0, 0, 0},  {&_swigt__p_ConstantBackground, _p_ConstantBackgroundTo_p_ICloneable, 0, 0},  {&_swigt__p_IBackground, _p_IBackgroundTo_p_ICloneable, 0, 0},  {&_swigt__p_PoissonNoiseBackground, _p_PoissonNoiseBackgroundTo_p_ICloneable, 0, 0},  {&_swigt__p_ISpecularScan, _p_ISpecularScanTo_p_ICloneable, 0, 0},  {&_swigt__p_IBornFF, _p_IBornFFTo_p_ICloneable, 0, 0},  {&_swigt__p_ChiSquaredModule, _p_ChiSquaredModuleTo_p_ICloneable, 0, 0},  {&_swigt__p_IChiSquaredModule, _p_IChiSquaredModuleTo_p_ICloneable, 0, 0},  {&_swigt__p_QSpecScan, _p_QSpecScanTo_p_ICloneable, 0, 0},  {&_swigt__p_AngularSpecScan, _p_AngularSpecScanTo_p_ICloneable, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_ICloneable, 0, 0},  {&_swigt__p_ISimulation2D, _p_ISimulation2DTo_p_ICloneable, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_IBornFF[] = {{&_swigt__p_IBornFF, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_ICloneable[] = {  {&_swigt__p_IChiSquaredModule, _p_IChiSquaredModuleTo_p_ICloneable, 0, 0},  {&_swigt__p_ChiSquaredModule, _p_ChiSquaredModuleTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormFactor, _p_IFormFactorTo_p_ICloneable, 0, 0},  {&_swigt__p_AngularSpecScan, _p_AngularSpecScanTo_p_ICloneable, 0, 0},  {&_swigt__p_QSpecScan, _p_QSpecScanTo_p_ICloneable, 0, 0},  {&_swigt__p_IBackground, _p_IBackgroundTo_p_ICloneable, 0, 0},  {&_swigt__p_ConstantBackground, _p_ConstantBackgroundTo_p_ICloneable, 0, 0},  {&_swigt__p_PoissonNoiseBackground, _p_PoissonNoiseBackgroundTo_p_ICloneable, 0, 0},  {&_swigt__p_ICloneable, 0, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_ICloneable, 0, 0},  {&_swigt__p_IBornFF, _p_IBornFFTo_p_ICloneable, 0, 0},  {&_swigt__p_ISpecularScan, _p_ISpecularScanTo_p_ICloneable, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IComponent[] = {  {&_swigt__p_IFormFactor, _p_IFormFactorTo_p_IComponent, 0, 0},  {&_swigt__p_SpecularSimulation, _p_SpecularSimulationTo_p_IComponent, 0, 0},  {&_swigt__p_DepthProbeSimulation, _p_DepthProbeSimulationTo_p_IComponent, 0, 0},  {&_swigt__p_OffSpecularSimulation, _p_OffSpecularSimulationTo_p_IComponent, 0, 0},  {&_swigt__p_GISASSimulation, _p_GISASSimulationTo_p_IComponent, 0, 0},  {&_swigt__p_ISimulation, _p_ISimulationTo_p_IComponent, 0, 0},  {&_swigt__p_IParametricComponent, _p_IParametricComponentTo_p_IComponent, 0, 0},  {&_swigt__p_IComponent, 0, 0, 0},  {&_swigt__p_PoissonNoiseBackground, _p_PoissonNoiseBackgroundTo_p_IComponent, 0, 0},  {&_swigt__p_ConstantBackground, _p_ConstantBackgroundTo_p_IComponent, 0, 0},  {&_swigt__p_IBackground, _p_IBackgroundTo_p_IComponent, 0, 0},  {&_swigt__p_IBornFF, _p_IBornFFTo_p_IComponent, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_IComponent, 0, 0},  {&_swigt__p_ParameterDistribution, _p_ParameterDistributionTo_p_IComponent, 0, 0},  {&_swigt__p_ISimulation2D, _p_ISimulation2DTo_p_IComponent, 0, 0},  {&_swigt__p_INode, _p_INodeTo_p_IComponent, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IDetector[] = {  {&_swigt__p_IDetector, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IDetector2D[] = {  {&_swigt__p_IDetector2D, 0, 0, 0},{0, 0, 0, 0}};
-- 
GitLab