From e59aaee8076f3ef34dd2fecb8716b749bb2bdce5 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Thu, 16 Dec 2021 18:22:18 +0100 Subject: [PATCH] move many classes to Resample, start file Slicer --- Base/Vector/WavevectorInfo.cpp | 2 +- GUI/View/Realspace/RealSpaceBuilderUtils.cpp | 8 +- Resample/Coherence/CoherentFFSum.cpp | 2 +- Resample/Coherence/SumDWBA.cpp | 6 +- Resample/Coherence/SumDWBA.h | 12 +- .../Particle/IReParticle.cpp | 14 +- .../Particle/IReParticle.h | 22 +- .../Particle/ParticleInSlice.h | 12 +- .../Particle/ReCompound.cpp | 34 +- .../Particle/ReCompound.h | 28 +- .../Particle/ReCoreShell.cpp | 26 +- .../Particle/ReCoreShell.h | 26 +- .../Particle/ReMesocrystal.cpp | 24 +- .../Particle/ReMesocrystal.h | 30 +- .../Particle/ReParticle.cpp | 46 +- .../Particle/ReParticle.h | 28 +- Resample/Processed/ProcessedSample.cpp | 2 +- Resample/Processed/Slicer.cpp | 269 ++++++++++ Resample/Processed/Slicer.h | 43 ++ .../HardParticle/FormFactorAnisoPyramid.cpp | 2 +- Sample/HardParticle/FormFactorAnisoPyramid.h | 4 +- Sample/HardParticle/FormFactorBox.cpp | 2 +- Sample/HardParticle/FormFactorBox.h | 4 +- .../FormFactorCantellatedCube.cpp | 2 +- .../HardParticle/FormFactorCantellatedCube.h | 4 +- Sample/HardParticle/FormFactorCone6.cpp | 2 +- Sample/HardParticle/FormFactorCone6.h | 4 +- .../HardParticle/FormFactorCuboctahedron.cpp | 2 +- Sample/HardParticle/FormFactorCuboctahedron.h | 4 +- .../HardParticle/FormFactorDodecahedron.cpp | 2 +- Sample/HardParticle/FormFactorDodecahedron.h | 4 +- Sample/HardParticle/FormFactorIcosahedron.cpp | 2 +- Sample/HardParticle/FormFactorIcosahedron.h | 4 +- Sample/HardParticle/FormFactorPrism3.cpp | 2 +- Sample/HardParticle/FormFactorPrism3.h | 4 +- Sample/HardParticle/FormFactorPrism6.cpp | 2 +- Sample/HardParticle/FormFactorPrism6.h | 4 +- Sample/HardParticle/FormFactorPyramid.cpp | 2 +- Sample/HardParticle/FormFactorPyramid.h | 4 +- Sample/HardParticle/FormFactorTetrahedron.cpp | 2 +- Sample/HardParticle/FormFactorTetrahedron.h | 4 +- .../HardParticle/FormFactorTruncatedCube.cpp | 2 +- Sample/HardParticle/FormFactorTruncatedCube.h | 4 +- Sample/HardParticle/IFormFactorPolyhedron.cpp | 26 +- Sample/HardParticle/IFormFactorPolyhedron.h | 10 +- Sample/HardParticle/IFormFactorPrism.cpp | 24 +- Sample/HardParticle/IFormFactorPrism.h | 10 +- Sample/Particle/Crystal.cpp | 2 +- Sample/Particle/Crystal.h | 2 +- Sample/Particle/IParticle.cpp | 6 +- Sample/Particle/IParticle.h | 4 +- Sample/Particle/MesoCrystal.cpp | 10 +- Sample/Particle/Particle.cpp | 6 +- Sample/Particle/ParticleComposition.cpp | 10 +- Sample/Particle/ParticleComposition.h | 2 +- Sample/Particle/ParticleCoreShell.cpp | 6 +- Sample/Scattering/IBornFF.cpp | 61 +-- Sample/Scattering/IBornFF.h | 22 +- Sample/ff/PolyhedralTopology.h | 2 +- Sample/ff/Polyhedron.h | 2 +- Tests/Unit/Core/PythonFormattingTest.cpp | 4 +- Wrap/Swig/ignoreSample.i | 4 +- Wrap/Swig/libBornAgainCore.i | 4 +- Wrap/Swig/libBornAgainResample.i | 2 +- Wrap/Swig/libBornAgainSample.i | 26 +- auto/Wrap/doxygenResample.i | 16 +- auto/Wrap/doxygenSample.i | 9 - auto/Wrap/libBornAgainSample.py | 36 -- auto/Wrap/libBornAgainSample_wrap.cpp | 481 +++--------------- auto/Wrap/libBornAgainSample_wrap.h | 6 +- 70 files changed, 673 insertions(+), 826 deletions(-) rename Sample/Scattering/IFormFactor.cpp => Resample/Particle/IReParticle.cpp (68%) rename Sample/Scattering/IFormFactor.h => Resample/Particle/IReParticle.h (80%) rename {Sample => Resample}/Particle/ParticleInSlice.h (77%) rename Sample/Particle/FormFactorComposition.cpp => Resample/Particle/ReCompound.cpp (64%) rename Sample/Particle/FormFactorComposition.h => Resample/Particle/ReCompound.h (62%) rename Sample/Particle/FormFactorCoreShell.cpp => Resample/Particle/ReCoreShell.cpp (52%) rename Sample/Particle/FormFactorCoreShell.h => Resample/Particle/ReCoreShell.h (64%) rename Sample/Particle/FormFactorCrystal.cpp => Resample/Particle/ReMesocrystal.cpp (81%) rename Sample/Particle/FormFactorCrystal.h => Resample/Particle/ReMesocrystal.h (64%) rename Sample/Scattering/DecoratedFF.cpp => Resample/Particle/ReParticle.cpp (75%) rename Sample/Scattering/DecoratedFF.h => Resample/Particle/ReParticle.h (72%) create mode 100644 Resample/Processed/Slicer.cpp create mode 100644 Resample/Processed/Slicer.h diff --git a/Base/Vector/WavevectorInfo.cpp b/Base/Vector/WavevectorInfo.cpp index 96e7cf8d5d0..9a137158ee2 100644 --- a/Base/Vector/WavevectorInfo.cpp +++ b/Base/Vector/WavevectorInfo.cpp @@ -25,7 +25,7 @@ WavevectorInfo::WavevectorInfo(R3 ki, R3 kf, double wavelength) { } -// TODO: can be removed when IFormFactor::volume() is refactored +// TODO: can be removed when IReParticle::volume() is refactored // (static function is provided to easily track usage of default constructor) WavevectorInfo WavevectorInfo::makeZeroQ() { diff --git a/GUI/View/Realspace/RealSpaceBuilderUtils.cpp b/GUI/View/Realspace/RealSpaceBuilderUtils.cpp index ffca4b57aae..663d2d6d2d4 100644 --- a/GUI/View/Realspace/RealSpaceBuilderUtils.cpp +++ b/GUI/View/Realspace/RealSpaceBuilderUtils.cpp @@ -31,7 +31,7 @@ #include "Sample/Particle/MesoCrystal.h" #include "Sample/Particle/Particle.h" #include "Sample/Particle/ParticleCoreShell.h" -#include "Sample/Scattering/DecoratedFF.h" +#include "Resample/Particle/ReParticle.h" namespace { @@ -39,9 +39,9 @@ const double layerBorderWidth = 10.0; const IBornFF* getUnderlyingFormFactor(const IBornFF* ff) { - // TRUE as long as ff is of DecoratedFF (or its derived) type - while (dynamic_cast<const DecoratedFF*>(ff)) - ff = dynamic_cast<const DecoratedFF*>(ff)->formfactor(); + // TRUE as long as ff is of ReParticle (or its derived) type + while (dynamic_cast<const ReParticle*>(ff)) + ff = dynamic_cast<const ReParticle*>(ff)->formfactor(); const auto* ffb = dynamic_cast<const IBornFF*>(ff); ASSERT(ffb); return ffb; diff --git a/Resample/Coherence/CoherentFFSum.cpp b/Resample/Coherence/CoherentFFSum.cpp index 6a294c5d978..24765984e14 100644 --- a/Resample/Coherence/CoherentFFSum.cpp +++ b/Resample/Coherence/CoherentFFSum.cpp @@ -14,7 +14,7 @@ #include "Resample/Coherence/CoherentFFSum.h" #include "Resample/Coherence/SumDWBA.h" -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" #include <utility> CoherentFFSum::CoherentFFSum(double abundance, std::vector<std::shared_ptr<const SumDWBA>> terms) diff --git a/Resample/Coherence/SumDWBA.cpp b/Resample/Coherence/SumDWBA.cpp index ce6e9244158..35557d24376 100644 --- a/Resample/Coherence/SumDWBA.cpp +++ b/Resample/Coherence/SumDWBA.cpp @@ -18,7 +18,7 @@ #include "Resample/Element/DiffuseElement.h" #include "Resample/Flux/MatrixFlux.h" #include "Resample/Flux/ScalarFlux.h" -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" namespace { @@ -31,9 +31,9 @@ complex_t VecMatVecProduct(const Eigen::Vector2cd& vec1, const Eigen::Matrix2cd& } // namespace -SumDWBA::SumDWBA(const IFormFactor& ff, size_t i_layer) : m_ff(ff.clone()), m_i_layer(i_layer) {} +SumDWBA::SumDWBA(const IReParticle& ff, size_t i_layer) : m_ff(ff.clone()), m_i_layer(i_layer) {} -SumDWBA::SumDWBA(const IFormFactor& ff) : m_ff(ff.clone()), m_i_layer() {} +SumDWBA::SumDWBA(const IReParticle& ff) : m_ff(ff.clone()), m_i_layer() {} SumDWBA::~SumDWBA() = default; diff --git a/Resample/Coherence/SumDWBA.h b/Resample/Coherence/SumDWBA.h index 78503c1c60a..c786a335a0f 100644 --- a/Resample/Coherence/SumDWBA.h +++ b/Resample/Coherence/SumDWBA.h @@ -27,21 +27,21 @@ class DiffuseElement; // used by all children class IFlux; // used by all children -class IFormFactor; +class IReParticle; class WavevectorInfo; // used by all children //! Computes coherent sum of the four DWBA terms. -//! Wraps an IFormFactor, and provides functions evaluate or evaluatePol. +//! Wraps an IReParticle, and provides functions evaluate or evaluatePol. //! Used from CoherentFFSum. class SumDWBA { public: - SumDWBA(const IFormFactor& ff, size_t i_layer); - SumDWBA(const IFormFactor& ff); + SumDWBA(const IReParticle& ff, size_t i_layer); + SumDWBA(const IReParticle& ff); virtual ~SumDWBA(); - const IFormFactor& ff() const { return *m_ff; } + const IReParticle& ff() const { return *m_ff; } size_t iLayer() const; //! Returns the coherent sum of the four DWBA terms for scalar scattering. @@ -51,7 +51,7 @@ public: Eigen::Matrix2cd coherentPolFF(const DiffuseElement& ele) const; private: - const std::unique_ptr<const IFormFactor> m_ff; + const std::unique_ptr<const IReParticle> m_ff; const std::optional<size_t> m_i_layer; friend class TestPolarizedDWBATerm; diff --git a/Sample/Scattering/IFormFactor.cpp b/Resample/Particle/IReParticle.cpp similarity index 68% rename from Sample/Scattering/IFormFactor.cpp rename to Resample/Particle/IReParticle.cpp index fe6a250299c..492e00553d8 100644 --- a/Sample/Scattering/IFormFactor.cpp +++ b/Resample/Particle/IReParticle.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Scattering/IFormFactor.cpp -//! @brief Implements interface class IFormFactor. +//! @file Resample/Particle/IReParticle.cpp +//! @brief Implements interface class IReParticle. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,22 +12,22 @@ // // ************************************************************************************************ -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" #include "Base/Vector/WavevectorInfo.h" #include <memory> -IFormFactor::IFormFactor(const NodeMeta& meta, const std::vector<double>& PValues) +IReParticle::IReParticle(const NodeMeta& meta, const std::vector<double>& PValues) : INode(meta, PValues) { } -Eigen::Matrix2cd IFormFactor::thePolFF(const WavevectorInfo&) const +Eigen::Matrix2cd IReParticle::thePolFF(const WavevectorInfo&) const { // Throws to prevent unanticipated behaviour - throw std::runtime_error("IFormFactor::evaluatePol: is not implemented by default"); + throw std::runtime_error("IReParticle::evaluatePol: is not implemented by default"); } -double IFormFactor::volume() const +double IReParticle::volume() const { auto zero_wavevectors = WavevectorInfo::makeZeroQ(); return std::abs(theFF(zero_wavevectors)); diff --git a/Sample/Scattering/IFormFactor.h b/Resample/Particle/IReParticle.h similarity index 80% rename from Sample/Scattering/IFormFactor.h rename to Resample/Particle/IReParticle.h index 57125718a01..6bedb92d6be 100644 --- a/Sample/Scattering/IFormFactor.h +++ b/Resample/Particle/IReParticle.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Scattering/IFormFactor.h -//! @brief Defines and implements interface IFormFactor. +//! @file Resample/Particle/IReParticle.h +//! @brief Defines and implements interface IReParticle. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -13,8 +13,8 @@ // ************************************************************************************************ #ifndef USER_API -#ifndef BORNAGAIN_SAMPLE_SCATTERING_IFORMFACTOR_H -#define BORNAGAIN_SAMPLE_SCATTERING_IFORMFACTOR_H +#ifndef BORNAGAIN_RESAMPLE_PARTICLE_IREPARTICLE_H +#define BORNAGAIN_RESAMPLE_PARTICLE_IREPARTICLE_H #include "Base/Types/ICloneable.h" #include "Param/Node/INode.h" @@ -29,19 +29,19 @@ class WavevectorInfo; //! Abstract base class for all form factors. //! -//! The actual form factor is returned by the complex valued function IFormFactor::evaluate, +//! The actual form factor is returned by the complex valued function IReParticle::evaluate, //! which depends on the incoming and outgoing wave vectors ki and kf. //! If it only depends on the scattering vector q=ki-kf, then it is a DecoratedBorn. -class IFormFactor : public ICloneable, public INode { +class IReParticle : public ICloneable, public INode { protected: - IFormFactor() = default; - IFormFactor(const NodeMeta& meta, const std::vector<double>& PValues); + IReParticle() = default; + IReParticle(const NodeMeta& meta, const std::vector<double>& PValues); public: - ~IFormFactor() override = default; + ~IReParticle() override = default; - IFormFactor* clone() const override = 0; + IReParticle* clone() const override = 0; //! Passes the material in which this particle is embedded. virtual void setAmbientMaterial(const Material&) {} @@ -69,5 +69,5 @@ public: #endif // SWIG }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_IFORMFACTOR_H +#endif // BORNAGAIN_RESAMPLE_PARTICLE_IREPARTICLE_H #endif // USER_API diff --git a/Sample/Particle/ParticleInSlice.h b/Resample/Particle/ParticleInSlice.h similarity index 77% rename from Sample/Particle/ParticleInSlice.h rename to Resample/Particle/ParticleInSlice.h index c8bc7aac8b0..f0a1d1df7e4 100644 --- a/Sample/Particle/ParticleInSlice.h +++ b/Resample/Particle/ParticleInSlice.h @@ -2,7 +2,7 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/ParticleInSlice.h +//! @file Resample/Particle/ParticleInSlice.h //! @brief Defines struct ParticleInSlice; there are no member functions to implement. //! //! @homepage http://www.bornagainproject.org @@ -17,11 +17,11 @@ #endif #ifndef USER_API -#ifndef BORNAGAIN_SAMPLE_PARTICLE_PARTICLEINSLICE_H -#define BORNAGAIN_SAMPLE_PARTICLE_PARTICLEINSLICE_H +#ifndef BORNAGAIN_RESAMPLE_PARTICLE_PARTICLEINSLICE_H +#define BORNAGAIN_RESAMPLE_PARTICLE_PARTICLEINSLICE_H #include "Sample/Material/Admixtures.h" -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" #include <memory> //! Struct that contains information on a sliced particle. @@ -31,9 +31,9 @@ //! @ingroup intern struct ParticleInSlice { - std::unique_ptr<IFormFactor> sliced_ff; + std::unique_ptr<IReParticle> sliced_ff; Admixtures admixtures; }; -#endif // BORNAGAIN_SAMPLE_PARTICLE_PARTICLEINSLICE_H +#endif // BORNAGAIN_RESAMPLE_PARTICLE_PARTICLEINSLICE_H #endif // USER_API diff --git a/Sample/Particle/FormFactorComposition.cpp b/Resample/Particle/ReCompound.cpp similarity index 64% rename from Sample/Particle/FormFactorComposition.cpp rename to Resample/Particle/ReCompound.cpp index 467e6fa22a1..e54f7773853 100644 --- a/Sample/Particle/FormFactorComposition.cpp +++ b/Resample/Particle/ReCompound.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/FormFactorComposition.cpp -//! @brief Implements class FormFactorComposition. +//! @file Resample/Particle/ReCompound.cpp +//! @brief Implements class ReCompound. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,25 +12,25 @@ // // ************************************************************************************************ -#include "Sample/Particle/FormFactorComposition.h" +#include "Resample/Particle/ReCompound.h" #include "Base/Util/Algorithms.h" #include "Base/Vector/WavevectorInfo.h" // debug -FormFactorComposition::~FormFactorComposition() +ReCompound::~ReCompound() { for (size_t index = 0; index < m_formfactors.size(); ++index) delete m_formfactors[index]; } -FormFactorComposition* FormFactorComposition::clone() const +ReCompound* ReCompound::clone() const { - auto* result = new FormFactorComposition(); + auto* result = new ReCompound(); for (size_t index = 0; index < m_formfactors.size(); ++index) result->addFormFactor(*m_formfactors[index]); return result; } -double FormFactorComposition::radialExtension() const +double ReCompound::radialExtension() const { double result{0.0}; for (size_t index = 0; index < m_formfactors.size(); ++index) @@ -38,37 +38,37 @@ double FormFactorComposition::radialExtension() const return result; } -double FormFactorComposition::bottomZ(const IRotation* rotation) const +double ReCompound::bottomZ(const IRotation* rotation) const { if (m_formfactors.empty()) - throw std::runtime_error("FormFactorComposition::bottomZ() -> Error: " + throw std::runtime_error("ReCompound::bottomZ() -> Error: " "'this' contains no form factors."); return BaseUtils::algo::min_value( m_formfactors.begin(), m_formfactors.end(), - [&rotation](IFormFactor* ff) { return ff->bottomZ(rotation); }); + [&rotation](IReParticle* ff) { return ff->bottomZ(rotation); }); } -double FormFactorComposition::topZ(const IRotation* rotation) const +double ReCompound::topZ(const IRotation* rotation) const { if (m_formfactors.empty()) - throw std::runtime_error("FormFactorComposition::topZ() -> Error: " + throw std::runtime_error("ReCompound::topZ() -> Error: " "'this' contains no form factors."); return BaseUtils::algo::max_value(m_formfactors.begin(), m_formfactors.end(), - [&rotation](IFormFactor* ff) { return ff->topZ(rotation); }); + [&rotation](IReParticle* ff) { return ff->topZ(rotation); }); } -void FormFactorComposition::addFormFactor(const IFormFactor& formfactor) +void ReCompound::addFormFactor(const IReParticle& formfactor) { m_formfactors.push_back(formfactor.clone()); } -void FormFactorComposition::setAmbientMaterial(const Material& material) +void ReCompound::setAmbientMaterial(const Material& material) { for (size_t index = 0; index < m_formfactors.size(); ++index) m_formfactors[index]->setAmbientMaterial(material); } -complex_t FormFactorComposition::theFF(const WavevectorInfo& wavevectors) const +complex_t ReCompound::theFF(const WavevectorInfo& wavevectors) const { complex_t result(0.0, 0.0); for (size_t index = 0; index < m_formfactors.size(); ++index) @@ -76,7 +76,7 @@ complex_t FormFactorComposition::theFF(const WavevectorInfo& wavevectors) const return result; } -Eigen::Matrix2cd FormFactorComposition::thePolFF(const WavevectorInfo& wavevectors) const +Eigen::Matrix2cd ReCompound::thePolFF(const WavevectorInfo& wavevectors) const { Eigen::Matrix2cd result = Eigen::Matrix2cd::Zero(); for (size_t index = 0; index < m_formfactors.size(); ++index) diff --git a/Sample/Particle/FormFactorComposition.h b/Resample/Particle/ReCompound.h similarity index 62% rename from Sample/Particle/FormFactorComposition.h rename to Resample/Particle/ReCompound.h index 414b6c121a4..7328601557a 100644 --- a/Sample/Particle/FormFactorComposition.h +++ b/Resample/Particle/ReCompound.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/FormFactorComposition.h -//! @brief Defines class FormFactorComposition. +//! @file Resample/Particle/ReCompound.h +//! @brief Defines class ReCompound. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -13,25 +13,25 @@ // ************************************************************************************************ #ifndef USER_API -#ifndef BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCOMPOSITION_H -#define BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCOMPOSITION_H +#ifndef BORNAGAIN_RESAMPLE_PARTICLE_RECOMPOUND_H +#define BORNAGAIN_RESAMPLE_PARTICLE_RECOMPOUND_H -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" -//! Coherent sum of different scalar IFormFactor%s. +//! Coherent sum of different scalar IReParticle%s. //! //! Used by ParticleComposition. //! If same particles are at different positions, then consider //! FormFactorDecoratorMultiPositionFactor (restore from commit 0500a26de76). -class FormFactorComposition : public IFormFactor { +class ReCompound : public IReParticle { public: - std::string className() const final { return "FormFactorComposition"; } + std::string className() const final { return "ReCompound"; } - FormFactorComposition() = default; - ~FormFactorComposition() override; + ReCompound() = default; + ~ReCompound() override; - FormFactorComposition* clone() const override; + ReCompound* clone() const override; double radialExtension() const override; @@ -39,7 +39,7 @@ public: double topZ(const IRotation* rotation) const override; - void addFormFactor(const IFormFactor& formfactor); + void addFormFactor(const IReParticle& formfactor); void setAmbientMaterial(const Material& material) override; @@ -51,8 +51,8 @@ public: #endif protected: - std::vector<IFormFactor*> m_formfactors; + std::vector<IReParticle*> m_formfactors; }; -#endif // BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCOMPOSITION_H +#endif // BORNAGAIN_RESAMPLE_PARTICLE_RECOMPOUND_H #endif // USER_API diff --git a/Sample/Particle/FormFactorCoreShell.cpp b/Resample/Particle/ReCoreShell.cpp similarity index 52% rename from Sample/Particle/FormFactorCoreShell.cpp rename to Resample/Particle/ReCoreShell.cpp index e391933775f..95c93ec1150 100644 --- a/Sample/Particle/FormFactorCoreShell.cpp +++ b/Resample/Particle/ReCoreShell.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/FormFactorCoreShell.cpp -//! @brief Implements class FormFactorCoreShell. +//! @file Resample/Particle/ReCoreShell.cpp +//! @brief Implements class ReCoreShell. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,47 +12,47 @@ // // ************************************************************************************************ -#include "Sample/Particle/FormFactorCoreShell.h" +#include "Resample/Particle/ReCoreShell.h" #include "Base/Vector/WavevectorInfo.h" // debug -FormFactorCoreShell::FormFactorCoreShell(IFormFactor* core, IFormFactor* shell) +ReCoreShell::ReCoreShell(IReParticle* core, IReParticle* shell) : m_core(core), m_shell(shell) { } -FormFactorCoreShell::~FormFactorCoreShell() = default; +ReCoreShell::~ReCoreShell() = default; -FormFactorCoreShell* FormFactorCoreShell::clone() const +ReCoreShell* ReCoreShell::clone() const { - return new FormFactorCoreShell(m_core->clone(), m_shell->clone()); + return new ReCoreShell(m_core->clone(), m_shell->clone()); } -double FormFactorCoreShell::radialExtension() const +double ReCoreShell::radialExtension() const { return m_shell->radialExtension(); } -double FormFactorCoreShell::bottomZ(const IRotation* rotation) const +double ReCoreShell::bottomZ(const IRotation* rotation) const { return m_shell->bottomZ(rotation); } -double FormFactorCoreShell::topZ(const IRotation* rotation) const +double ReCoreShell::topZ(const IRotation* rotation) const { return m_shell->topZ(rotation); } -void FormFactorCoreShell::setAmbientMaterial(const Material& material) +void ReCoreShell::setAmbientMaterial(const Material& material) { m_shell->setAmbientMaterial(material); } -complex_t FormFactorCoreShell::theFF(const WavevectorInfo& wavevectors) const +complex_t ReCoreShell::theFF(const WavevectorInfo& wavevectors) const { return m_shell->theFF(wavevectors) + m_core->theFF(wavevectors); } -Eigen::Matrix2cd FormFactorCoreShell::thePolFF(const WavevectorInfo& wavevectors) const +Eigen::Matrix2cd ReCoreShell::thePolFF(const WavevectorInfo& wavevectors) const { return m_shell->thePolFF(wavevectors) + m_core->thePolFF(wavevectors); } diff --git a/Sample/Particle/FormFactorCoreShell.h b/Resample/Particle/ReCoreShell.h similarity index 64% rename from Sample/Particle/FormFactorCoreShell.h rename to Resample/Particle/ReCoreShell.h index 0ee068f4edf..ebdf26a9eee 100644 --- a/Sample/Particle/FormFactorCoreShell.h +++ b/Resample/Particle/ReCoreShell.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/FormFactorCoreShell.h -//! @brief Defines class FormFactorCoreShell. +//! @file Resample/Particle/ReCoreShell.h +//! @brief Defines class ReCoreShell. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -17,10 +17,10 @@ #endif #ifndef USER_API -#ifndef BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCORESHELL_H -#define BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCORESHELL_H +#ifndef BORNAGAIN_RESAMPLE_PARTICLE_RECORESHELL_H +#define BORNAGAIN_RESAMPLE_PARTICLE_RECORESHELL_H -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" #include <memory> @@ -28,14 +28,14 @@ //! //! Used by ParticleCoreShell. -class FormFactorCoreShell : public IFormFactor { +class ReCoreShell : public IReParticle { public: - std::string className() const final { return "FormFactorCoreShell"; } + std::string className() const final { return "ReCoreShell"; } - FormFactorCoreShell(IFormFactor* core, IFormFactor* shell); - ~FormFactorCoreShell() override; + ReCoreShell(IReParticle* core, IReParticle* shell); + ~ReCoreShell() override; - FormFactorCoreShell* clone() const override; + ReCoreShell* clone() const override; double radialExtension() const override; @@ -53,9 +53,9 @@ public: #endif protected: - std::unique_ptr<IFormFactor> m_core; - std::unique_ptr<IFormFactor> m_shell; + std::unique_ptr<IReParticle> m_core; + std::unique_ptr<IReParticle> m_shell; }; -#endif // BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCORESHELL_H +#endif // BORNAGAIN_RESAMPLE_PARTICLE_RECORESHELL_H #endif // USER_API diff --git a/Sample/Particle/FormFactorCrystal.cpp b/Resample/Particle/ReMesocrystal.cpp similarity index 81% rename from Sample/Particle/FormFactorCrystal.cpp rename to Resample/Particle/ReMesocrystal.cpp index 036a51d3ad5..27867539a7c 100644 --- a/Sample/Particle/FormFactorCrystal.cpp +++ b/Resample/Particle/ReMesocrystal.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/FormFactorCrystal.cpp -//! @brief Implements class FormFactorCrystal. +//! @file Resample/Particle/ReMesocrystal.cpp +//! @brief Implements class ReMesocrystal. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,12 +12,12 @@ // // ************************************************************************************************ -#include "Sample/Particle/FormFactorCrystal.h" +#include "Resample/Particle/ReMesocrystal.h" #include "Base/Math/Constants.h" #include "Base/Vector/WavevectorInfo.h" -FormFactorCrystal::FormFactorCrystal(const Lattice3D& lattice, const IFormFactor& basis_formfactor, - const IFormFactor& meso_formfactor, double position_variance) +ReMesocrystal::ReMesocrystal(const Lattice3D& lattice, const IReParticle& basis_formfactor, + const IReParticle& meso_formfactor, double position_variance) : m_lattice(lattice) , m_basis_formfactor(basis_formfactor.clone()) , m_meso_formfactor(meso_formfactor.clone()) @@ -26,23 +26,23 @@ FormFactorCrystal::FormFactorCrystal(const Lattice3D& lattice, const IFormFactor calculateLargestReciprocalDistance(); } -FormFactorCrystal::~FormFactorCrystal() +ReMesocrystal::~ReMesocrystal() { delete m_basis_formfactor; delete m_meso_formfactor; } -double FormFactorCrystal::bottomZ(const IRotation* rotation) const +double ReMesocrystal::bottomZ(const IRotation* rotation) const { return m_meso_formfactor->bottomZ(rotation); } -double FormFactorCrystal::topZ(const IRotation* rotation) const +double ReMesocrystal::topZ(const IRotation* rotation) const { return m_meso_formfactor->topZ(rotation); } -complex_t FormFactorCrystal::theFF(const WavevectorInfo& wavevectors) const +complex_t ReMesocrystal::theFF(const WavevectorInfo& wavevectors) const { // retrieve reciprocal lattice vectors within reasonable radius C3 q = wavevectors.getQ(); @@ -64,7 +64,7 @@ complex_t FormFactorCrystal::theFF(const WavevectorInfo& wavevectors) const return result / m_lattice.unitCellVolume(); } -Eigen::Matrix2cd FormFactorCrystal::thePolFF(const WavevectorInfo& wavevectors) const +Eigen::Matrix2cd ReMesocrystal::thePolFF(const WavevectorInfo& wavevectors) const { // retrieve reciprocal lattice vectors within reasonable radius C3 q = wavevectors.getQ(); @@ -86,7 +86,7 @@ Eigen::Matrix2cd FormFactorCrystal::thePolFF(const WavevectorInfo& wavevectors) return result / m_lattice.unitCellVolume(); } -void FormFactorCrystal::calculateLargestReciprocalDistance() +void ReMesocrystal::calculateLargestReciprocalDistance() { R3 a1 = m_lattice.basisVectorA(); R3 a2 = m_lattice.basisVectorB(); @@ -96,7 +96,7 @@ void FormFactorCrystal::calculateLargestReciprocalDistance() m_max_rec_length = std::max(m_max_rec_length, M_PI / a3.mag()); } -complex_t FormFactorCrystal::debyeWallerFactor(const R3& q_i) const +complex_t ReMesocrystal::debyeWallerFactor(const R3& q_i) const { auto q2 = q_i.mag2(); return std::exp(-q2 * m_position_variance / 2.0); diff --git a/Sample/Particle/FormFactorCrystal.h b/Resample/Particle/ReMesocrystal.h similarity index 64% rename from Sample/Particle/FormFactorCrystal.h rename to Resample/Particle/ReMesocrystal.h index 61a42953cec..06c1506c9c9 100644 --- a/Sample/Particle/FormFactorCrystal.h +++ b/Resample/Particle/ReMesocrystal.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Particle/FormFactorCrystal.h -//! @brief Defines class FormFactorCrystal. +//! @file Resample/Particle/ReMesocrystal.h +//! @brief Defines class ReMesocrystal. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,26 +12,26 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCRYSTAL_H -#define BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCRYSTAL_H +#ifndef BORNAGAIN_RESAMPLE_PARTICLE_REMESOCRYSTAL_H +#define BORNAGAIN_RESAMPLE_PARTICLE_REMESOCRYSTAL_H #include "Sample/Lattice/Lattice3D.h" -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" //! The form factor of a MesoCrystal. //! @ingroup formfactors -class FormFactorCrystal : public IFormFactor { +class ReMesocrystal : public IReParticle { public: - std::string className() const final { return "FormFactorCrystal"; } + std::string className() const final { return "ReMesocrystal"; } - FormFactorCrystal(const Lattice3D& lattice, const IFormFactor& basis_formfactor, - const IFormFactor& meso_formfactor, double position_variance = 0.0); - ~FormFactorCrystal() override; + ReMesocrystal(const Lattice3D& lattice, const IReParticle& basis_formfactor, + const IReParticle& meso_formfactor, double position_variance = 0.0); + ~ReMesocrystal() override; - FormFactorCrystal* clone() const override + ReMesocrystal* clone() const override { - return new FormFactorCrystal(m_lattice, *m_basis_formfactor, *m_meso_formfactor, + return new ReMesocrystal(m_lattice, *m_basis_formfactor, *m_meso_formfactor, m_position_variance); } @@ -57,10 +57,10 @@ private: complex_t debyeWallerFactor(const R3& q_i) const; Lattice3D m_lattice; - IFormFactor* m_basis_formfactor; - IFormFactor* m_meso_formfactor; //!< The outer shape of this mesocrystal + IReParticle* m_basis_formfactor; + IReParticle* m_meso_formfactor; //!< The outer shape of this mesocrystal double m_position_variance; double m_max_rec_length; }; -#endif // BORNAGAIN_SAMPLE_PARTICLE_FORMFACTORCRYSTAL_H +#endif // BORNAGAIN_RESAMPLE_PARTICLE_REMESOCRYSTAL_H diff --git a/Sample/Scattering/DecoratedFF.cpp b/Resample/Particle/ReParticle.cpp similarity index 75% rename from Sample/Scattering/DecoratedFF.cpp rename to Resample/Particle/ReParticle.cpp index f51c8746bac..409d10ecb3b 100644 --- a/Sample/Scattering/DecoratedFF.cpp +++ b/Resample/Particle/ReParticle.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Scattering/DecoratedFF.cpp -//! @brief Implements interface class DecoratedFF. +//! @file Resample/Particle/ReParticle.cpp +//! @brief Implements interface class ReParticle. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,7 +12,7 @@ // // ************************************************************************************************ -#include "Sample/Scattering/DecoratedFF.h" +#include "Resample/Particle/ReParticle.h" #include "Base/Vector/RotMatrix.h" #include "Base/Vector/WavevectorInfo.h" // debug #include "Sample/Material/Material.h" @@ -20,7 +20,7 @@ #include "Sample/Scattering/IBornFF.h" #include "Sample/Scattering/Rotations.h" -DecoratedFF::DecoratedFF(IBornFF* ff, const Material* material, const Material* ambient_material, +ReParticle::ReParticle(IBornFF* ff, const Material* material, const Material* ambient_material, const R3* position, const RotMatrix* rotMatrix) : m_ff(std::move(ff)) , m_material(std::move(material)) @@ -30,26 +30,26 @@ DecoratedFF::DecoratedFF(IBornFF* ff, const Material* material, const Material* { } -DecoratedFF::DecoratedFF(const IBornFF& ff) - : DecoratedFF(ff.clone(), nullptr, nullptr, nullptr, nullptr) +ReParticle::ReParticle(const IBornFF& ff) + : ReParticle(ff.clone(), nullptr, nullptr, nullptr, nullptr) { } -DecoratedFF::~DecoratedFF() = default; +ReParticle::~ReParticle() = default; -DecoratedFF* DecoratedFF::clone() const +ReParticle* ReParticle::clone() const { - return new DecoratedFF(m_ff->clone(), m_material ? new Material(*m_material) : nullptr, + return new ReParticle(m_ff->clone(), m_material ? new Material(*m_material) : nullptr, m_ambient_material ? new Material(*m_ambient_material) : nullptr, m_position ? new R3(*m_position) : nullptr, m_rotMatrix ? new RotMatrix(*m_rotMatrix) : nullptr); } -DecoratedFF* DecoratedFF::createTransformedFormFactor(const IBornFF& formfactor, +ReParticle* ReParticle::createTransformedFormFactor(const IBornFF& formfactor, const IRotation* rot, R3 translation) { - auto* result = new DecoratedFF(formfactor); + auto* result = new ReParticle(formfactor); if (rot && !rot->isIdentity()) result->setRotMatrix(rot->rotMatrix()); if (translation != R3()) @@ -57,47 +57,47 @@ DecoratedFF* DecoratedFF::createTransformedFormFactor(const IBornFF& formfactor, return result; } -void DecoratedFF::setMaterial(const Material& material) +void ReParticle::setMaterial(const Material& material) { m_material = std::make_unique<Material>(material); } -void DecoratedFF::setAmbientMaterial(const Material& ambient_material) +void ReParticle::setAmbientMaterial(const Material& ambient_material) { m_ambient_material = std::make_unique<Material>(ambient_material); } -void DecoratedFF::setPosition(const R3& position) +void ReParticle::setPosition(const R3& position) { m_position = std::make_unique<R3>(position); } -void DecoratedFF::setRotMatrix(const RotMatrix& rotMatrix) +void ReParticle::setRotMatrix(const RotMatrix& rotMatrix) { m_rotMatrix = std::make_unique<RotMatrix>(rotMatrix); } -double DecoratedFF::volume() const +double ReParticle::volume() const { return m_ff->volume(); } -double DecoratedFF::radialExtension() const +double ReParticle::radialExtension() const { return m_ff->radialExtension(); } -const IBornFF* DecoratedFF::formfactor() const +const IBornFF* ReParticle::formfactor() const { return m_ff.get(); } -complex_t DecoratedFF::formfactor(C3 q) const +complex_t ReParticle::formfactor(C3 q) const { return m_ff->formfactor(q); } -complex_t DecoratedFF::theFF(const WavevectorInfo& wavevectors) const +complex_t ReParticle::theFF(const WavevectorInfo& wavevectors) const { WavevectorInfo wavevectors2 = m_rotMatrix ? wavevectors.transformed(m_rotMatrix->getInverse()) : wavevectors; @@ -111,7 +111,7 @@ complex_t DecoratedFF::theFF(const WavevectorInfo& wavevectors) const return result; } -Eigen::Matrix2cd DecoratedFF::thePolFF(const WavevectorInfo& wavevectors) const +Eigen::Matrix2cd ReParticle::thePolFF(const WavevectorInfo& wavevectors) const { WavevectorInfo wavevectors2 = m_rotMatrix ? wavevectors.transformed(m_rotMatrix->getInverse()) : wavevectors; @@ -133,7 +133,7 @@ Eigen::Matrix2cd DecoratedFF::thePolFF(const WavevectorInfo& wavevectors) const return result; } -double DecoratedFF::bottomZ(const IRotation* rotation) const +double ReParticle::bottomZ(const IRotation* rotation) const { RotMatrix transform = rotation ? rotation->rotMatrix() : RotMatrix(); if (m_rotMatrix) @@ -145,7 +145,7 @@ double DecoratedFF::bottomZ(const IRotation* rotation) const return result; } -double DecoratedFF::topZ(const IRotation* rotation) const +double ReParticle::topZ(const IRotation* rotation) const { RotMatrix transform = rotation ? rotation->rotMatrix() : RotMatrix(); if (m_rotMatrix) diff --git a/Sample/Scattering/DecoratedFF.h b/Resample/Particle/ReParticle.h similarity index 72% rename from Sample/Scattering/DecoratedFF.h rename to Resample/Particle/ReParticle.h index d70368afafb..bc8a9b61fec 100644 --- a/Sample/Scattering/DecoratedFF.h +++ b/Resample/Particle/ReParticle.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Scattering/DecoratedFF.h -//! @brief Defines interface class DecoratedFF. +//! @file Resample/Particle/ReParticle.h +//! @brief Defines interface class ReParticle. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -13,10 +13,10 @@ // ************************************************************************************************ #ifndef USER_API -#ifndef BORNAGAIN_SAMPLE_SCATTERING_DECORATEDFF_H -#define BORNAGAIN_SAMPLE_SCATTERING_DECORATEDFF_H +#ifndef BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H +#define BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" #include <heinz/Vectors3D.h> class IBornFF; @@ -27,15 +27,15 @@ class RotMatrix; //! (a scalar factor, a position-dependent phase factor, ...). //! //! This class is designed according to the Decorator Pattern. -//! It inherits from IFormFactor _and_ has a member of type IFormFactor*. +//! It inherits from IReParticle _and_ has a member of type IReParticle*. -class DecoratedFF : public IFormFactor { +class ReParticle : public IReParticle { public: - DecoratedFF(const IBornFF& ff); - ~DecoratedFF() override; + ReParticle(const IBornFF& ff); + ~ReParticle() override; - DecoratedFF* clone() const override; - std::string className() const override { return "DecoratedFF"; } + ReParticle* clone() const override; + std::string className() const override { return "ReParticle"; } //! Sets the material of the scatterer void setMaterial(const Material& material); @@ -63,14 +63,14 @@ public: virtual complex_t formfactor(C3 q) const; - static DecoratedFF* createTransformedFormFactor(const IBornFF& formfactor, const IRotation* rot, + static ReParticle* createTransformedFormFactor(const IBornFF& formfactor, const IRotation* rot, R3 translation); protected: std::unique_ptr<const IBornFF> m_ff; // private: - DecoratedFF(IBornFF* ff, const Material* material, const Material* ambient_material, + ReParticle(IBornFF* ff, const Material* material, const Material* ambient_material, const R3* position, const RotMatrix* rotMatrix); std::unique_ptr<const Material> m_material; @@ -79,5 +79,5 @@ protected: std::unique_ptr<const RotMatrix> m_rotMatrix; }; -#endif // BORNAGAIN_SAMPLE_SCATTERING_DECORATEDFF_H +#endif // BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H #endif // USER_API diff --git a/Resample/Processed/ProcessedSample.cpp b/Resample/Processed/ProcessedSample.cpp index 90582b7c151..8eb337b2f08 100644 --- a/Resample/Processed/ProcessedSample.cpp +++ b/Resample/Processed/ProcessedSample.cpp @@ -32,7 +32,7 @@ #include "Sample/Multilayer/MultiLayer.h" #include "Sample/Multilayer/MultilayerUtils.h" #include "Sample/Particle/IParticle.h" -#include "Sample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ParticleInSlice.h" namespace { diff --git a/Resample/Processed/Slicer.cpp b/Resample/Processed/Slicer.cpp new file mode 100644 index 00000000000..30dd08be2fe --- /dev/null +++ b/Resample/Processed/Slicer.cpp @@ -0,0 +1,269 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Resample/Processed/Slicer.cpp +//! @brief Implements function preprocessor::sliceFormFactor +//! +//! @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 "Sample/Processed/Slicer.h" +#include "Resample/Particle/ReParticle.h" +#include "Sample/HardParticle/HardParticles.h" + +namespace { + +//! Nested structure that holds slicing effects on position and removed parts. +struct SlicingEffects { + R3 position; + double dz_bottom; + double dz_top; +}; + +SlicingEffects computeSlicingEffects(ZLimits limits, const R3& position, double height) +{ + R3 new_position(position); + double z_bottom = position.z(); + double z_top = position.z() + height; + double dz_top = std::isinf(limits.zTop()) ? -1 : z_top - limits.zTop(); + double dz_bottom = std::isinf(limits.zBottom()) ? -1 : limits.zBottom() - z_bottom; + ASSERT(dz_top >= 0 || dz_bottom >= 0); + ASSERT(dz_bottom <= height); + ASSERT(dz_top <= height); + if (dz_bottom < 0) + dz_bottom = 0; + if (dz_top < 0) + dz_top = 0; + if (dz_bottom > 0) + new_position.setZ(limits.zBottom()); + return {new_position, dz_bottom, dz_top}; +} + +bool shapeIsContainedInLimits(const IBornFF& formfactor, ZLimits limits, const IRotation* rotation, + R3 translation) +{ + double zbottom = formfactor.bottomZ(rotation) + translation.z(); + double ztop = formfactor.topZ(rotation) + translation.z(); + + return limits.zBottom() <= zbottom && ztop <= limits.zTop(); +} + +bool shapeOutsideLimits(const IBornFF& formfactor, ZLimits limits, const IRotation* rotation, + R3 translation) +{ + double zbottom = formfactor.bottomZ(rotation) + translation.z(); + double ztop = formfactor.topZ(rotation) + translation.z(); + + return ztop <= limits.zBottom() || zbottom >= limits.zTop(); +} + +} // namespace + + +ReParticle* preprocessor::sliceFormFactor(const IBornFF& ff, + ZLimits limits, const IRotation* rot, + R3 translation) +{ + const SlicingEffects effects = computeSlicingEffects(limits, translation, m_height); + + std::unique_ptr<IBornFF> slicedff; + if (const auto& f = dynamic_cast<const FormFactorAnisoPyramid&>(ff)) { + double dbase_edge = 2 * effects.dz_bottom * Math::cot(f.alpha()); + slicedff = std::make_unique<FormFactorAnisoPyramid>( + f.length() - dbase_edge, width() - dbase_edge, + f.height() - effects.dz_bottom - effects.dz_top, f.alpha()); + } else + throw std::runtime_error("Slicing not implemented for " + ff.shapeName()); + + return ReParticle::createTransformedFormFactor(*slicedff, rot, effects.position); +} + +/* +ReParticle* FormFactorBox::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorBox slicedff(m_length, m_width, m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorCone6::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + double dbase_edge = effects.dz_bottom * Math::cot(m_alpha); + FormFactorCone6 slicedff(m_base_edge - dbase_edge, + m_height - effects.dz_bottom - effects.dz_top, m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorCone::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + double dradius = effects.dz_bottom * m_cot_alpha; + FormFactorCone slicedff(m_radius - dradius, m_height - effects.dz_bottom - effects.dz_top, + m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + + +ReParticle* FormFactorCuboctahedron::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height * (1 + m_height_ratio)); + if (effects.dz_bottom > m_height) { + double dbase_edge = 2 * (effects.dz_bottom - m_height) * Math::cot(m_alpha); + FormFactorPyramid slicedff( + m_length - dbase_edge, + m_height * (1 + m_height_ratio) - effects.dz_bottom - effects.dz_top, m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); + } + if (effects.dz_top > m_height_ratio * m_height) { + double dbase_edge = 2 * (m_height - effects.dz_bottom) * Math::cot(m_alpha); + FormFactorPyramid slicedff( + m_length - dbase_edge, + m_height * (1 + m_height_ratio) - effects.dz_bottom - effects.dz_top, M_PI - m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); + } + FormFactorCuboctahedron slicedff(m_length, m_height - effects.dz_bottom, + m_height_ratio * m_height - effects.dz_top, m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorCylinder::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorCylinder slicedff(m_radius, m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorEllipsoidalCylinder::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorEllipsoidalCylinder slicedff(m_radius_x, m_radius_y, + m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorFullSphere::sliceFormFactor(ZLimits limits, const IRotation* rotation, + R3 translation) const +{ + R3 new_translation = translation; + if (rotation) { + R3 center(0.0, 0.0, m_radius); + new_translation += rotation->transformed(center) - center; + } + double height = 2.0 * m_radius; + auto effects = computeSlicingEffects(limits, new_translation, height); + FormFactorTruncatedSphere slicedff(m_radius, height - effects.dz_bottom, effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, nullptr, effects.position); +} + +ReParticle* FormFactorFullSpheroid::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + double flattening = m_height / (2.0 * m_radius); + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorTruncatedSpheroid slicedff(m_radius, m_height - effects.dz_bottom, flattening, + effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + + +ReParticle* FormFactorLongBoxGauss::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorLongBoxGauss slicedff(m_length, m_width, + m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorLongBoxLorentz::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorLongBoxLorentz slicedff(m_length, m_width, + m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + + +ReParticle* FormFactorPrism3::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorPrism3 slicedff(m_base_edge, m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorPrism6::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + FormFactorPrism6 slicedff(m_base_edge, m_height - effects.dz_bottom - effects.dz_top); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorPyramid::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + double dbase_edge = 2 * effects.dz_bottom * Math::cot(m_alpha); + FormFactorPyramid slicedff(m_base_edge - dbase_edge, + m_height - effects.dz_bottom - effects.dz_top, m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorTetrahedron::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + auto effects = computeSlicingEffects(limits, translation, m_height); + double dbase_edge = 2 * sqrt(3) * effects.dz_bottom * Math::cot(m_alpha); + FormFactorTetrahedron slicedff(m_base_edge - dbase_edge, + m_height - effects.dz_bottom - effects.dz_top, m_alpha); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorTruncatedSphere::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + double height = m_height - m_dh; + auto effects = computeSlicingEffects(limits, translation, height); + FormFactorTruncatedSphere slicedff(m_radius, m_height - effects.dz_bottom, + effects.dz_top + m_dh); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} + +ReParticle* FormFactorTruncatedSpheroid::sliceFormFactor(ZLimits limits, const IRotation* rot, + R3 translation) const +{ + double height = m_height - m_dh; + auto effects = computeSlicingEffects(limits, translation, height); + FormFactorTruncatedSpheroid slicedff(m_radius, height - effects.dz_bottom, m_height_flattening, + effects.dz_top + m_dh); + return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); +} +*/ + +ReParticle* preprocessor::createSlicedFormFactor(IBornFF& ff, + ZLimits limits, const IRotation* rot, + R3 translation) +{ + if (shapeIsContainedInLimits(ff, limits, rot, translation)) + return ReParticle::createTransformedFormFactor(ff, rot, translation); + if (shapeOutsideLimits(ff, limits, rot, translation)) + return nullptr; + if (ff.canSliceAnalytically(rot)) + return preprocessor::sliceFormFactor(ff, limits, rot, translation); + throw std::runtime_error("Slicing of " + className() + + " not supported for the given rotation!"); +} diff --git a/Resample/Processed/Slicer.h b/Resample/Processed/Slicer.h new file mode 100644 index 00000000000..1a2a130df78 --- /dev/null +++ b/Resample/Processed/Slicer.h @@ -0,0 +1,43 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Resample/Processed/Slicer.h +//! @brief Defines function preprocessor::sliceFormFactor +//! +//! @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) +// +// ************************************************************************************************ + +#ifdef SWIG +#error no need to expose this header to Swig +#endif + +#ifndef USER_API +#ifndef BORNAGAIN_RESAMPLE_PROCESSED_SLICER_H +#define BORNAGAIN_RESAMPLE_PROCESSED_SLICER_H + +#include <heinz/Vectors3D.h> + +class IBornFF; +class ZLimits; +class IRotation; +class ReParticle; + +namespace preprocessor { + +ReParticle* sliceFormFactor(const IBornFF& ff, + ZLimits limits, const IRotation* rot, + R3 translation); + +ReParticle* createSlicedFormFactor(IBornFF& ff, + ZLimits limits, const IRotation* rot, + R3 translation); + +} // namespace preprocessor + +#endif // BORNAGAIN_RESAMPLE_PROCESSED_SLICER_H +#endif // USER_API diff --git a/Sample/HardParticle/FormFactorAnisoPyramid.cpp b/Sample/HardParticle/FormFactorAnisoPyramid.cpp index a9f30a5a366..88a7e9211ac 100644 --- a/Sample/HardParticle/FormFactorAnisoPyramid.cpp +++ b/Sample/HardParticle/FormFactorAnisoPyramid.cpp @@ -25,7 +25,7 @@ const ff::PolyhedralTopology FormFactorAnisoPyramid::topology = {{{{3, 2, 1, 0}, false}; FormFactorAnisoPyramid::FormFactorAnisoPyramid(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"AnisoPyramid", "frustum with rectangular base", {{"Length", "nm", "side length of base in x direction", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorAnisoPyramid.h b/Sample/HardParticle/FormFactorAnisoPyramid.h index 2973c0051da..2b77747cacc 100644 --- a/Sample/HardParticle/FormFactorAnisoPyramid.h +++ b/Sample/HardParticle/FormFactorAnisoPyramid.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORANISOPYRAMID_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORANISOPYRAMID_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A frustum (truncated pyramid) with rectangular base. //! @ingroup hardParticle -class FormFactorAnisoPyramid : public IFormFactorPolyhedron { +class FormFactorAnisoPyramid : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorAnisoPyramid"; } diff --git a/Sample/HardParticle/FormFactorBox.cpp b/Sample/HardParticle/FormFactorBox.cpp index 15fa8b371d2..7d861d4566d 100644 --- a/Sample/HardParticle/FormFactorBox.cpp +++ b/Sample/HardParticle/FormFactorBox.cpp @@ -16,7 +16,7 @@ #include "Base/Math/Functions.h" FormFactorBox::FormFactorBox(const std::vector<double> P) - : IFormFactorPrism({"Box", + : IReParticlePrism({"Box", "rectangular cuboid", {{"Length", "nm", "side length in x direction", 0, +INF, 0}, {"Width", "nm", "side length in y direction", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorBox.h b/Sample/HardParticle/FormFactorBox.h index cb798c8107f..717da68c9cc 100644 --- a/Sample/HardParticle/FormFactorBox.h +++ b/Sample/HardParticle/FormFactorBox.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORBOX_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORBOX_H -#include "Sample/HardParticle/IFormFactorPrism.h" +#include "Sample/HardParticle/IReParticlePrism.h" //! A rectangular prism (parallelepiped). //! @ingroup hardParticle -class FormFactorBox : public IFormFactorPrism { +class FormFactorBox : public IReParticlePrism { public: std::string className() const final { return "FormFactorBox"; } diff --git a/Sample/HardParticle/FormFactorCantellatedCube.cpp b/Sample/HardParticle/FormFactorCantellatedCube.cpp index 5d221fe0862..3d34a8c8f33 100644 --- a/Sample/HardParticle/FormFactorCantellatedCube.cpp +++ b/Sample/HardParticle/FormFactorCantellatedCube.cpp @@ -46,7 +46,7 @@ const ff::PolyhedralTopology FormFactorCantellatedCube::topology = { true}; FormFactorCantellatedCube::FormFactorCantellatedCube(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"CantellatedCube", "a cube with truncated edges and vertices", {{"Length", "nm", "length of untruncated edge", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorCantellatedCube.h b/Sample/HardParticle/FormFactorCantellatedCube.h index 5eaa896677f..c5d955e996a 100644 --- a/Sample/HardParticle/FormFactorCantellatedCube.h +++ b/Sample/HardParticle/FormFactorCantellatedCube.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORCANTELLATEDCUBE_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORCANTELLATEDCUBE_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A cube, with truncation of all edges and corners, as in Croset (2017) Fig 7 //! @ingroup hardParticle -class FormFactorCantellatedCube : public IFormFactorPolyhedron { +class FormFactorCantellatedCube : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorCantellatedCube"; } diff --git a/Sample/HardParticle/FormFactorCone6.cpp b/Sample/HardParticle/FormFactorCone6.cpp index dd6d742f96f..05d0e2100a1 100644 --- a/Sample/HardParticle/FormFactorCone6.cpp +++ b/Sample/HardParticle/FormFactorCone6.cpp @@ -27,7 +27,7 @@ const ff::PolyhedralTopology FormFactorCone6::topology = {{{{5, 4, 3, 2, 1, 0}, false}; FormFactorCone6::FormFactorCone6(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"Cone6", "frustum with regular hexagonal base", {{"BaseEdge", "nm", "base edge length", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorCone6.h b/Sample/HardParticle/FormFactorCone6.h index 1847cd466d0..cb457396570 100644 --- a/Sample/HardParticle/FormFactorCone6.h +++ b/Sample/HardParticle/FormFactorCone6.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORCONE6_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORCONE6_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A frustum (truncated pyramid) with regular hexagonal base. //! @ingroup hardParticle -class FormFactorCone6 : public IFormFactorPolyhedron { +class FormFactorCone6 : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorCone6"; } diff --git a/Sample/HardParticle/FormFactorCuboctahedron.cpp b/Sample/HardParticle/FormFactorCuboctahedron.cpp index 451b27bce0c..539028bcfa1 100644 --- a/Sample/HardParticle/FormFactorCuboctahedron.cpp +++ b/Sample/HardParticle/FormFactorCuboctahedron.cpp @@ -30,7 +30,7 @@ const ff::PolyhedralTopology FormFactorCuboctahedron::topology = {{{{3, 2, 1, 0} false}; FormFactorCuboctahedron::FormFactorCuboctahedron(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"Cuboctahedron", "truncated quadratic bipyramid", {{"Length", "nm", "edge length of base square (common face of both pyramids)", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorCuboctahedron.h b/Sample/HardParticle/FormFactorCuboctahedron.h index 952389e0eb0..cbd2db79065 100644 --- a/Sample/HardParticle/FormFactorCuboctahedron.h +++ b/Sample/HardParticle/FormFactorCuboctahedron.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORCUBOCTAHEDRON_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORCUBOCTAHEDRON_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A truncated bifrustum with quadratic base. //! @ingroup hardParticle -class FormFactorCuboctahedron : public IFormFactorPolyhedron { +class FormFactorCuboctahedron : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorCuboctahedron"; } diff --git a/Sample/HardParticle/FormFactorDodecahedron.cpp b/Sample/HardParticle/FormFactorDodecahedron.cpp index 7f52c17bfe9..938eb4f62e1 100644 --- a/Sample/HardParticle/FormFactorDodecahedron.cpp +++ b/Sample/HardParticle/FormFactorDodecahedron.cpp @@ -33,7 +33,7 @@ const ff::PolyhedralTopology FormFactorDodecahedron::topology = {{// bottom: true}; FormFactorDodecahedron::FormFactorDodecahedron(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"Dodecahedron", "regular dodecahedron", {{"Edge", "nm", "edge length", 0, +INF, 0}}}, P) , m_edge(m_P[0]) { diff --git a/Sample/HardParticle/FormFactorDodecahedron.h b/Sample/HardParticle/FormFactorDodecahedron.h index dfef647a03d..0b28c557d60 100644 --- a/Sample/HardParticle/FormFactorDodecahedron.h +++ b/Sample/HardParticle/FormFactorDodecahedron.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORDODECAHEDRON_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORDODECAHEDRON_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A regular dodecahedron. //! @ingroup hardParticle -class FormFactorDodecahedron : public IFormFactorPolyhedron { +class FormFactorDodecahedron : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorDodecahedron"; } diff --git a/Sample/HardParticle/FormFactorIcosahedron.cpp b/Sample/HardParticle/FormFactorIcosahedron.cpp index 925adddda33..ea8574544c0 100644 --- a/Sample/HardParticle/FormFactorIcosahedron.cpp +++ b/Sample/HardParticle/FormFactorIcosahedron.cpp @@ -43,7 +43,7 @@ const ff::PolyhedralTopology FormFactorIcosahedron::topology = {{// bottom: true}; FormFactorIcosahedron::FormFactorIcosahedron(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"Icosahedron", "regular icosahedron", {{"Edge", "nm", "edge length", 0, +INF, 0}}}, P) , m_edge(m_P[0]) { diff --git a/Sample/HardParticle/FormFactorIcosahedron.h b/Sample/HardParticle/FormFactorIcosahedron.h index b414970ad51..cf58bdf3e54 100644 --- a/Sample/HardParticle/FormFactorIcosahedron.h +++ b/Sample/HardParticle/FormFactorIcosahedron.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORICOSAHEDRON_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORICOSAHEDRON_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A regular icosahedron. //! @ingroup hardParticle -class FormFactorIcosahedron : public IFormFactorPolyhedron { +class FormFactorIcosahedron : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorIcosahedron"; } diff --git a/Sample/HardParticle/FormFactorPrism3.cpp b/Sample/HardParticle/FormFactorPrism3.cpp index 8ff00b664da..e9ca8feef9c 100644 --- a/Sample/HardParticle/FormFactorPrism3.cpp +++ b/Sample/HardParticle/FormFactorPrism3.cpp @@ -16,7 +16,7 @@ #include <iostream> FormFactorPrism3::FormFactorPrism3(const std::vector<double> P) - : IFormFactorPrism({"Prism3", + : IReParticlePrism({"Prism3", "prism with regular trigonal base", {{"BaseEdge", "nm", "edge length of trigonal base", 0, +INF, 0}, {"Height", "nm", "height", 0, +INF, 0}}}, diff --git a/Sample/HardParticle/FormFactorPrism3.h b/Sample/HardParticle/FormFactorPrism3.h index a3a39624adb..1b82ad1e9c8 100644 --- a/Sample/HardParticle/FormFactorPrism3.h +++ b/Sample/HardParticle/FormFactorPrism3.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORPRISM3_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORPRISM3_H -#include "Sample/HardParticle/IFormFactorPrism.h" +#include "Sample/HardParticle/IReParticlePrism.h" //! A prism based on an equilateral triangle. //! @ingroup hardParticle -class FormFactorPrism3 : public IFormFactorPrism { +class FormFactorPrism3 : public IReParticlePrism { public: std::string className() const final { return "FormFactorPrism3"; } diff --git a/Sample/HardParticle/FormFactorPrism6.cpp b/Sample/HardParticle/FormFactorPrism6.cpp index 76d9534557a..1cda9bbf46d 100644 --- a/Sample/HardParticle/FormFactorPrism6.cpp +++ b/Sample/HardParticle/FormFactorPrism6.cpp @@ -15,7 +15,7 @@ #include "Sample/HardParticle/FormFactorPrism6.h" FormFactorPrism6::FormFactorPrism6(const std::vector<double> P) - : IFormFactorPrism({"Prism6", + : IReParticlePrism({"Prism6", "prism with regular hexagonal base", {{"BaseEdge", "nm", "edge length of hexagonal base", 0, +INF, 0}, {"Height", "nm", "height", 0, +INF, 0}}}, diff --git a/Sample/HardParticle/FormFactorPrism6.h b/Sample/HardParticle/FormFactorPrism6.h index 783ee421703..00fdb627447 100644 --- a/Sample/HardParticle/FormFactorPrism6.h +++ b/Sample/HardParticle/FormFactorPrism6.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORPRISM6_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORPRISM6_H -#include "Sample/HardParticle/IFormFactorPrism.h" +#include "Sample/HardParticle/IReParticlePrism.h" //! A prism based on a regular hexagonal. //! @ingroup hardParticle -class FormFactorPrism6 : public IFormFactorPrism { +class FormFactorPrism6 : public IReParticlePrism { public: std::string className() const final { return "FormFactorPrism6"; } diff --git a/Sample/HardParticle/FormFactorPyramid.cpp b/Sample/HardParticle/FormFactorPyramid.cpp index f5eebce4e74..41d63a540a6 100644 --- a/Sample/HardParticle/FormFactorPyramid.cpp +++ b/Sample/HardParticle/FormFactorPyramid.cpp @@ -28,7 +28,7 @@ const ff::PolyhedralTopology FormFactorPyramid::topology = { false}; FormFactorPyramid::FormFactorPyramid(const std::vector<double> P) - : IFormFactorPolyhedron({"Pyramid", + : IReParticlePolyhedron({"Pyramid", "frustum with quadratic base", {{"BaseEdge", "nm", "base edge length", 0, +INF, 0}, {"Height", "nm", "height", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorPyramid.h b/Sample/HardParticle/FormFactorPyramid.h index 38221b82666..9cc7973e293 100644 --- a/Sample/HardParticle/FormFactorPyramid.h +++ b/Sample/HardParticle/FormFactorPyramid.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORPYRAMID_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORPYRAMID_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A frustum with a quadratic base. //! @ingroup hardParticle -class FormFactorPyramid : public IFormFactorPolyhedron { +class FormFactorPyramid : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorPyramid"; } diff --git a/Sample/HardParticle/FormFactorTetrahedron.cpp b/Sample/HardParticle/FormFactorTetrahedron.cpp index 3ed043a3c0b..4494d7f4412 100644 --- a/Sample/HardParticle/FormFactorTetrahedron.cpp +++ b/Sample/HardParticle/FormFactorTetrahedron.cpp @@ -24,7 +24,7 @@ const ff::PolyhedralTopology FormFactorTetrahedron::topology = {{{{2, 1, 0}, fal false}; FormFactorTetrahedron::FormFactorTetrahedron(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"Tetrahedron", "actually, not a tetrahedron, but a trigonal frustum", {{"BaseEdge", "nm", "edge of base triangle", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorTetrahedron.h b/Sample/HardParticle/FormFactorTetrahedron.h index d5e5eef53f2..31773f5dd12 100644 --- a/Sample/HardParticle/FormFactorTetrahedron.h +++ b/Sample/HardParticle/FormFactorTetrahedron.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORTETRAHEDRON_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORTETRAHEDRON_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A frustum with equilateral trigonal base. //! @ingroup hardParticle -class FormFactorTetrahedron : public IFormFactorPolyhedron { +class FormFactorTetrahedron : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorTetrahedron"; } diff --git a/Sample/HardParticle/FormFactorTruncatedCube.cpp b/Sample/HardParticle/FormFactorTruncatedCube.cpp index ce2a92324d7..8150867a8d8 100644 --- a/Sample/HardParticle/FormFactorTruncatedCube.cpp +++ b/Sample/HardParticle/FormFactorTruncatedCube.cpp @@ -32,7 +32,7 @@ const ff::PolyhedralTopology FormFactorTruncatedCube::topology = { true}; FormFactorTruncatedCube::FormFactorTruncatedCube(const std::vector<double> P) - : IFormFactorPolyhedron( + : IReParticlePolyhedron( {"TruncatedCube", "class_tooltip", {{"Length", "nm", "untruncated edge length", 0, +INF, 0}, diff --git a/Sample/HardParticle/FormFactorTruncatedCube.h b/Sample/HardParticle/FormFactorTruncatedCube.h index 62db33fe90d..bee1607010c 100644 --- a/Sample/HardParticle/FormFactorTruncatedCube.h +++ b/Sample/HardParticle/FormFactorTruncatedCube.h @@ -15,12 +15,12 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORTRUNCATEDCUBE_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORTRUNCATEDCUBE_H -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" //! A cube, with tetrahedral truncation of all corners //! @ingroup hardParticle -class FormFactorTruncatedCube : public IFormFactorPolyhedron { +class FormFactorTruncatedCube : public IReParticlePolyhedron { public: std::string className() const final { return "FormFactorTruncatedCube"; } diff --git a/Sample/HardParticle/IFormFactorPolyhedron.cpp b/Sample/HardParticle/IFormFactorPolyhedron.cpp index 55adc5caffd..9a5283e196c 100644 --- a/Sample/HardParticle/IFormFactorPolyhedron.cpp +++ b/Sample/HardParticle/IFormFactorPolyhedron.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/HardParticle/IFormFactorPolyhedron.cpp -//! @brief Implements interface IFormFactorPolyhedron. +//! @file Sample/HardParticle/IReParticlePolyhedron.cpp +//! @brief Implements interface IReParticlePolyhedron. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -16,61 +16,61 @@ //! by Joachim Wuttke, entitled //! "Form factor (Fourier shape transform) of polygon and polyhedron." -#include "Sample/HardParticle/IFormFactorPolyhedron.h" +#include "Sample/HardParticle/IReParticlePolyhedron.h" #include "Sample/ff/PolyhedralComponents.h" #include "Sample/ff/Polyhedron.h" // #ifdef ALGORITHM_DIAGNOSTIC // TODO restore -// void IFormFactorPolyhedron::setLimits(double _q, int _n) +// void IReParticlePolyhedron::setLimits(double _q, int _n) // { // q_limit_series = _q; // n_limit_series = _n; // } // #endif -IFormFactorPolyhedron::IFormFactorPolyhedron(const NodeMeta& meta, +IReParticlePolyhedron::IReParticlePolyhedron(const NodeMeta& meta, const std::vector<double>& PValues) : IBornFF(meta, PValues) { } -IFormFactorPolyhedron::~IFormFactorPolyhedron() = default; +IReParticlePolyhedron::~IReParticlePolyhedron() = default; //! Called by child classes to set faces and other internal variables. -void IFormFactorPolyhedron::setPolyhedron(const ff::PolyhedralTopology& topology, double z_bottom, +void IReParticlePolyhedron::setPolyhedron(const ff::PolyhedralTopology& topology, double z_bottom, const std::vector<R3>& vertices) { pimpl = std::make_unique<ff::Polyhedron>(topology, z_bottom, vertices); } -double IFormFactorPolyhedron::bottomZ(const IRotation* rotation) const +double IReParticlePolyhedron::bottomZ(const IRotation* rotation) const { return BottomZ(pimpl->vertices(), rotation); } -double IFormFactorPolyhedron::topZ(const IRotation* rotation) const +double IReParticlePolyhedron::topZ(const IRotation* rotation) const { return TopZ(pimpl->vertices(), rotation); } -complex_t IFormFactorPolyhedron::formfactor(C3 q) const +complex_t IReParticlePolyhedron::formfactor(C3 q) const { return pimpl->formfactor(q); } -double IFormFactorPolyhedron::volume() const +double IReParticlePolyhedron::volume() const { return pimpl->volume(); } -double IFormFactorPolyhedron::radialExtension() const +double IReParticlePolyhedron::radialExtension() const { return pimpl->radius(); } //! Assertions for Platonic solid. -void IFormFactorPolyhedron::assert_platonic() const +void IReParticlePolyhedron::assert_platonic() const { pimpl->assert_platonic(); } diff --git a/Sample/HardParticle/IFormFactorPolyhedron.h b/Sample/HardParticle/IFormFactorPolyhedron.h index 3ab3e01ef52..ec62272f963 100644 --- a/Sample/HardParticle/IFormFactorPolyhedron.h +++ b/Sample/HardParticle/IFormFactorPolyhedron.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/HardParticle/IFormFactorPolyhedron.h -//! @brief Defines interface IFormFactorPolyhedron. +//! @file Sample/HardParticle/IReParticlePolyhedron.h +//! @brief Defines interface IReParticlePolyhedron. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -27,14 +27,14 @@ class Polyhedron; //! A polyhedron, for form factor computation. -class IFormFactorPolyhedron : public IBornFF { +class IReParticlePolyhedron : public IBornFF { public: // #ifdef ALGORITHM_DIAGNOSTIC // static void setLimits(double _q, int _n); // #endif - IFormFactorPolyhedron(const NodeMeta& meta, const std::vector<double>& PValues); - ~IFormFactorPolyhedron() override; + IReParticlePolyhedron(const NodeMeta& meta, const std::vector<double>& PValues); + ~IReParticlePolyhedron() override; double bottomZ(const IRotation* rotation) const override; double topZ(const IRotation* rotation) const override; diff --git a/Sample/HardParticle/IFormFactorPrism.cpp b/Sample/HardParticle/IFormFactorPrism.cpp index ea6bfd32afd..20540f1a217 100644 --- a/Sample/HardParticle/IFormFactorPrism.cpp +++ b/Sample/HardParticle/IFormFactorPrism.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/HardParticle/IFormFactorPrism.cpp -//! @brief Implements interface IFormFactorPrism. +//! @file Sample/HardParticle/IReParticlePrism.cpp +//! @brief Implements interface IReParticlePrism. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,49 +12,49 @@ // // ************************************************************************************************ -#include "Sample/HardParticle/IFormFactorPrism.h" +#include "Sample/HardParticle/IReParticlePrism.h" #include "Sample/ff/Prism.h" -IFormFactorPrism::IFormFactorPrism(const NodeMeta& meta, const std::vector<double>& PValues) +IReParticlePrism::IReParticlePrism(const NodeMeta& meta, const std::vector<double>& PValues) : IBornFF(meta, PValues) { } -IFormFactorPrism::~IFormFactorPrism() = default; +IReParticlePrism::~IReParticlePrism() = default; -void IFormFactorPrism::setPrism(bool symmetry_Ci, const std::vector<R3>& vertices) +void IReParticlePrism::setPrism(bool symmetry_Ci, const std::vector<R3>& vertices) { pimpl = std::make_unique<ff::Prism>(symmetry_Ci, height(), vertices); } -double IFormFactorPrism::bottomZ(const IRotation* rotation) const +double IReParticlePrism::bottomZ(const IRotation* rotation) const { return BottomZ(pimpl->vertices(), rotation); } -double IFormFactorPrism::topZ(const IRotation* rotation) const +double IReParticlePrism::topZ(const IRotation* rotation) const { return TopZ(pimpl->vertices(), rotation); } //! Returns the volume of this prism. -double IFormFactorPrism::volume() const +double IReParticlePrism::volume() const { return height() * pimpl->area(); } -double IFormFactorPrism::height() const +double IReParticlePrism::height() const { return height(); } -double IFormFactorPrism::radialExtension() const +double IReParticlePrism::radialExtension() const { return std::sqrt(pimpl->area()); } //! Returns the form factor F(q) of this polyhedron, respecting the offset height/2. -complex_t IFormFactorPrism::formfactor(C3 q) const +complex_t IReParticlePrism::formfactor(C3 q) const { return pimpl->formfactor(q); } diff --git a/Sample/HardParticle/IFormFactorPrism.h b/Sample/HardParticle/IFormFactorPrism.h index 330fe2cc8a9..577f2268f42 100644 --- a/Sample/HardParticle/IFormFactorPrism.h +++ b/Sample/HardParticle/IFormFactorPrism.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/HardParticle/IFormFactorPrism.h -//! @brief Defines interface IFormFactorPrism. +//! @file Sample/HardParticle/IReParticlePrism.h +//! @brief Defines interface IReParticlePrism. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -28,10 +28,10 @@ class Prism; //! A prism with a polygonal base, for form factor computation. -class IFormFactorPrism : public IBornFF { +class IReParticlePrism : public IBornFF { public: - IFormFactorPrism(const NodeMeta& meta, const std::vector<double>& PValues); - ~IFormFactorPrism() override; + IReParticlePrism(const NodeMeta& meta, const std::vector<double>& PValues); + ~IReParticlePrism() override; double bottomZ(const IRotation* rotation) const override; double topZ(const IRotation* rotation) const override; diff --git a/Sample/Particle/Crystal.cpp b/Sample/Particle/Crystal.cpp index 67fa4e3ed46..d77ee179ca0 100644 --- a/Sample/Particle/Crystal.cpp +++ b/Sample/Particle/Crystal.cpp @@ -17,7 +17,7 @@ #include "Sample/Lattice/Lattice3D.h" #include "Sample/Particle/Particle.h" #include "Sample/Particle/ParticleComposition.h" -#include "Sample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ParticleInSlice.h" #include "Sample/Scattering/Rotations.h" Crystal::Crystal(const IParticle& basis, const Lattice3D& lattice, double position_variance) diff --git a/Sample/Particle/Crystal.h b/Sample/Particle/Crystal.h index e7431fd4b4d..748237b5cb4 100644 --- a/Sample/Particle/Crystal.h +++ b/Sample/Particle/Crystal.h @@ -25,7 +25,7 @@ class Lattice3D; //! A crystal structure, defined by a Bravais lattice, a basis, and a position variance. //! -//! Computations are delegated to class FormFactorCrystal. +//! Computations are delegated to class ReMesocrystal. //! //! Used in MesoCrystal, where it is given an outer shape. //! diff --git a/Sample/Particle/IParticle.cpp b/Sample/Particle/IParticle.cpp index dccf11e5ea1..c4774207557 100644 --- a/Sample/Particle/IParticle.cpp +++ b/Sample/Particle/IParticle.cpp @@ -13,12 +13,12 @@ // ************************************************************************************************ #include "Sample/Particle/IParticle.h" -#include "Sample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ParticleInSlice.h" #include "Sample/Scattering/Rotations.h" IParticle::~IParticle() = default; -IFormFactor* IParticle::createFormFactor() const +IReParticle* IParticle::createFormFactor() const { return createParticleInSlice(ZLimits{}).sliced_ff.release(); } @@ -65,7 +65,7 @@ std::vector<std::unique_ptr<IParticle>> IParticle::decompose() const ZLimits IParticle::zSpan() const { - std::unique_ptr<IFormFactor> ff(createFormFactor()); + std::unique_ptr<IReParticle> ff(createFormFactor()); double bot = ff->bottomZ(nullptr); double top = ff->topZ(nullptr); return {bot, top}; diff --git a/Sample/Particle/IParticle.h b/Sample/Particle/IParticle.h index 6c10df9e571..b8525dd62b4 100644 --- a/Sample/Particle/IParticle.h +++ b/Sample/Particle/IParticle.h @@ -24,7 +24,7 @@ struct ParticleInSlice; class Rotations; class ZLimits; -class IFormFactor; +class IReParticle; class IRotation; //! Abstract base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal. @@ -40,7 +40,7 @@ public: std::vector<const INode*> nodeChildren() const override; //! Creates a form factor for this particle - virtual IFormFactor* createFormFactor() const; + virtual IReParticle* createFormFactor() const; //! Creates a sliced form factor for this particle virtual ParticleInSlice createParticleInSlice(const ZLimits& limits) const = 0; diff --git a/Sample/Particle/MesoCrystal.cpp b/Sample/Particle/MesoCrystal.cpp index 0951d785d11..4822ab3cf13 100644 --- a/Sample/Particle/MesoCrystal.cpp +++ b/Sample/Particle/MesoCrystal.cpp @@ -15,8 +15,8 @@ #include "Sample/Particle/MesoCrystal.h" #include "Base/Util/Assert.h" #include "Sample/Particle/Crystal.h" -#include "Sample/Particle/FormFactorCrystal.h" -#include "Sample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ReMesocrystal.h" +#include "Resample/Particle/ParticleInSlice.h" #include "Sample/Scattering/IBornFF.h" #include "Sample/Scattering/Rotations.h" @@ -58,14 +58,14 @@ ParticleInSlice MesoCrystal::createParticleInSlice(const ZLimits& limits) const ParticleInSlice result; - std::unique_ptr<DecoratedFF> tem_ff( + std::unique_ptr<ReParticle> tem_ff( m_meso_formfactor->createSlicedFormFactor(limits, m_rotation.get(), m_position)); const std::unique_ptr<Crystal> new_crystal( m_crystal->transformed(m_rotation.get(), m_position)); - const std::unique_ptr<IFormFactor> new_basis_ff(new_crystal->basis()->createFormFactor()); + const std::unique_ptr<IReParticle> new_basis_ff(new_crystal->basis()->createFormFactor()); - result.sliced_ff.reset(new FormFactorCrystal(*new_crystal->lattice(), *new_basis_ff, *tem_ff, + result.sliced_ff.reset(new ReMesocrystal(*new_crystal->lattice(), *new_basis_ff, *tem_ff, new_crystal->position_variance())); Admixtures& regions = result.admixtures; diff --git a/Sample/Particle/Particle.cpp b/Sample/Particle/Particle.cpp index d86a4e3eff5..8bd159a3c5c 100644 --- a/Sample/Particle/Particle.cpp +++ b/Sample/Particle/Particle.cpp @@ -16,8 +16,8 @@ #include "Base/Util/Assert.h" #include "Base/Vector/RotMatrix.h" #include "Sample/Material/MaterialFactoryFuncs.h" -#include "Sample/Particle/ParticleInSlice.h" -#include "Sample/Scattering/DecoratedFF.h" +#include "Resample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ReParticle.h" #include "Sample/Scattering/Rotations.h" Particle::Particle(Material material, const IBornFF& formfactor) @@ -53,7 +53,7 @@ std::vector<const INode*> Particle::nodeChildren() const ParticleInSlice Particle::createParticleInSlice(const ZLimits& limits) const { ASSERT(m_formfactor); - std::unique_ptr<DecoratedFF> sliced_ff( + std::unique_ptr<ReParticle> sliced_ff( m_formfactor->createSlicedFormFactor(limits, m_rotation.get(), m_position)); if (!sliced_ff) return {}; diff --git a/Sample/Particle/ParticleComposition.cpp b/Sample/Particle/ParticleComposition.cpp index 6fdce5f9303..05cb4fc153e 100644 --- a/Sample/Particle/ParticleComposition.cpp +++ b/Sample/Particle/ParticleComposition.cpp @@ -14,8 +14,8 @@ #include "Sample/Particle/ParticleComposition.h" #include "Base/Util/Assert.h" -#include "Sample/Particle/FormFactorComposition.h" -#include "Sample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ReCompound.h" +#include "Resample/Particle/ParticleInSlice.h" #include "Sample/Scattering/Rotations.h" ParticleComposition::ParticleComposition() {} @@ -72,14 +72,14 @@ ZLimits ParticleComposition::zSpan() const return result; } -IFormFactor* ParticleComposition::createFormFactor() const +IReParticle* ParticleComposition::createFormFactor() const { if (m_particles.empty()) return {}; - auto* result = new FormFactorComposition; + auto* result = new ReCompound; auto particles = decompose(); for (const auto& particle : particles) { - std::unique_ptr<IFormFactor> particle_ff(particle->createFormFactor()); + std::unique_ptr<IReParticle> particle_ff(particle->createFormFactor()); result->addFormFactor(*particle_ff); } return result; diff --git a/Sample/Particle/ParticleComposition.h b/Sample/Particle/ParticleComposition.h index a451028576b..d53e0211e68 100644 --- a/Sample/Particle/ParticleComposition.h +++ b/Sample/Particle/ParticleComposition.h @@ -35,7 +35,7 @@ public: #endif ZLimits zSpan() const override; - IFormFactor* createFormFactor() const override; + IReParticle* createFormFactor() const override; ParticleInSlice createParticleInSlice(const ZLimits& limits) const override; diff --git a/Sample/Particle/ParticleCoreShell.cpp b/Sample/Particle/ParticleCoreShell.cpp index 7417324696a..ac8a2fcb995 100644 --- a/Sample/Particle/ParticleCoreShell.cpp +++ b/Sample/Particle/ParticleCoreShell.cpp @@ -15,9 +15,9 @@ #include "Sample/Particle/ParticleCoreShell.h" #include "Base/Util/Assert.h" -#include "Sample/Particle/FormFactorCoreShell.h" +#include "Resample/Particle/ReCoreShell.h" #include "Sample/Particle/Particle.h" -#include "Sample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ParticleInSlice.h" #include "Sample/Scattering/Rotations.h" #include <memory> @@ -82,7 +82,7 @@ ParticleInSlice ParticleCoreShell::createParticleInSlice(const ZLimits& limits) // construct sliced particle sliced_shell.admixtures.back().fraction -= sliced_core.admixtures.back().fraction; - result.sliced_ff = std::make_unique<FormFactorCoreShell>(sliced_core.sliced_ff.release(), + result.sliced_ff = std::make_unique<ReCoreShell>(sliced_core.sliced_ff.release(), sliced_shell.sliced_ff.release()); result.admixtures.push_back(sliced_core.admixtures.back()); result.admixtures.push_back(sliced_shell.admixtures.back()); diff --git a/Sample/Scattering/IBornFF.cpp b/Sample/Scattering/IBornFF.cpp index 6d3e3f81b0f..47f0e3c79f0 100644 --- a/Sample/Scattering/IBornFF.cpp +++ b/Sample/Scattering/IBornFF.cpp @@ -20,32 +20,10 @@ #include "Base/Vector/WavevectorInfo.h" #include "Sample/Scattering/Rotations.h" #include "Sample/Shapes/IShape3D.h" +#include "Resample/Processed/Slicer.h" #include <stdexcept> #include <utility> -namespace { - -bool shapeIsContainedInLimits(const IBornFF& formfactor, ZLimits limits, const IRotation* rotation, - R3 translation) -{ - double zbottom = formfactor.bottomZ(rotation) + translation.z(); - double ztop = formfactor.topZ(rotation) + translation.z(); - - return limits.zBottom() <= zbottom && ztop <= limits.zTop(); -} - -bool shapeOutsideLimits(const IBornFF& formfactor, ZLimits limits, const IRotation* rotation, - R3 translation) -{ - double zbottom = formfactor.bottomZ(rotation) + translation.z(); - double ztop = formfactor.topZ(rotation) + translation.z(); - - return ztop <= limits.zBottom() || zbottom >= limits.zTop(); -} - -} // namespace - - IBornFF::IBornFF() = default; IBornFF::IBornFF(const NodeMeta& meta, const std::vector<double>& PValues) @@ -105,43 +83,6 @@ Eigen::Matrix2cd IBornFF::formfactor_pol(C3 q) const return formfactor(q) * Eigen::Matrix2cd::Identity(); } -DecoratedFF* IBornFF::createSlicedFormFactor(ZLimits limits, const IRotation* rot, - R3 translation) const -{ - if (shapeIsContainedInLimits(*this, limits, rot, translation)) - return DecoratedFF::createTransformedFormFactor(*this, rot, translation); - if (shapeOutsideLimits(*this, limits, rot, translation)) - return nullptr; - if (canSliceAnalytically(rot)) - return sliceFormFactor(limits, rot, translation); - throw std::runtime_error("Slicing of " + className() - + " not supported for the given rotation!"); -} - -DecoratedFF* IBornFF::sliceFormFactor(ZLimits, const IRotation*, R3) const -{ - throw std::runtime_error(className() + "::sliceFormFactor error: not implemented!"); -} - -SlicingEffects IBornFF::computeSlicingEffects(ZLimits limits, const R3& position, double height) -{ - R3 new_position(position); - double z_bottom = position.z(); - double z_top = position.z() + height; - double dz_top = std::isinf(limits.zTop()) ? -1 : z_top - limits.zTop(); - double dz_bottom = std::isinf(limits.zBottom()) ? -1 : limits.zBottom() - z_bottom; - ASSERT(dz_top >= 0 || dz_bottom >= 0); - ASSERT(dz_bottom <= height); - ASSERT(dz_top <= height); - if (dz_bottom < 0) - dz_bottom = 0; - if (dz_top < 0) - dz_top = 0; - if (dz_bottom > 0) - new_position.setZ(limits.zBottom()); - return {new_position, dz_bottom, dz_top}; -} - double IBornFF::volume() const { return std::abs(formfactor(C3())); diff --git a/Sample/Scattering/IBornFF.h b/Sample/Scattering/IBornFF.h index 2ae890895bf..cdeead6636d 100644 --- a/Sample/Scattering/IBornFF.h +++ b/Sample/Scattering/IBornFF.h @@ -18,22 +18,11 @@ #include "Sample/Scattering/ISampleNode.h" -#include "Sample/Scattering/DecoratedFF.h" // TODO circular, temporary -// class DecoratedFF; - class IShape3D; -//! Nested structure that holds slicing effects on position and removed parts. - -struct SlicingEffects { - R3 position; - double dz_bottom; - double dz_top; -}; - //! Abstract base class for Born form factors. //! -//! In contrast to the generic IFormFactor, a Born form factor does not depend +//! In contrast to the generic IReParticle, a Born form factor does not depend //! on the incoming and outgoing wave vectors ki and kf, except through their //! difference, the scattering vector q=ki-kf. @@ -63,8 +52,6 @@ public: virtual complex_t formfactor(C3 q) const = 0; - DecoratedFF* createSlicedFormFactor(ZLimits limits, const IRotation* rot, R3 translation) const; - //! Creates the Python constructor of this class (or derived classes) virtual std::string pythonConstructor() const; @@ -72,10 +59,6 @@ protected: //! Default implementation only allows rotations along z-axis virtual bool canSliceAnalytically(const IRotation* rot) const; - //! Actually slices the form factor or throws an exception - virtual DecoratedFF* sliceFormFactor(ZLimits limits, const IRotation* rot, - R3 translation) const; - #ifndef SWIG //! Returns scattering amplitude for complex scattering wavevector q=k_i-k_f in case //! of matrix interactions. Default implementation calls formfactor(q) and @@ -87,9 +70,6 @@ protected: //! of round shapes). For soft particles, this will be a hard mean shape. std::unique_ptr<IShape3D> m_shape3D; - //! Helper method for slicing - static SlicingEffects computeSlicingEffects(ZLimits limits, const R3& position, double height); - //! Calculates the z-coordinate of the lowest vertex after rotation static double BottomZ(const std::vector<R3>& vertices, const IRotation* rotation); diff --git a/Sample/ff/PolyhedralTopology.h b/Sample/ff/PolyhedralTopology.h index a8ee357eb10..64c2688b714 100644 --- a/Sample/ff/PolyhedralTopology.h +++ b/Sample/ff/PolyhedralTopology.h @@ -31,7 +31,7 @@ public: bool symmetry_S2; }; -//! For internal use in IFormFactorPolyhedron. +//! For internal use in IReParticlePolyhedron. class PolyhedralTopology { public: std::vector<PolygonalTopology> faces; diff --git a/Sample/ff/Polyhedron.h b/Sample/ff/Polyhedron.h index cfb85196515..843c0aefb39 100644 --- a/Sample/ff/Polyhedron.h +++ b/Sample/ff/Polyhedron.h @@ -32,7 +32,7 @@ namespace ff { class PolyhedralFace; class PolyhedralTopology; -//! A polyhedron, implementation class for use in IFormFactorPolyhedron +//! A polyhedron, implementation class for use in IReParticlePolyhedron class Polyhedron { public: diff --git a/Tests/Unit/Core/PythonFormattingTest.cpp b/Tests/Unit/Core/PythonFormattingTest.cpp index 2a3a81a3e9c..165bc05e890 100644 --- a/Tests/Unit/Core/PythonFormattingTest.cpp +++ b/Tests/Unit/Core/PythonFormattingTest.cpp @@ -190,8 +190,8 @@ TEST_F(PythonFormattingTest, printLayerRoughness) TEST_F(PythonFormattingTest, printFormFactors) { - // #baPool missing: class FormFactorCoreShell; - // #baPool missing: class FormFactorCrystal; + // #baPool missing: class ReCoreShell; + // #baPool missing: class ReMesocrystal; EXPECT_EQ(FormFactorAnisoPyramid(12.0, 14.0, 5.0, 55 * Units::deg).pythonConstructor(), "FormFactorAnisoPyramid(12*nm, 14*nm, 5*nm, 55*deg)"); diff --git a/Wrap/Swig/ignoreSample.i b/Wrap/Swig/ignoreSample.i index 15ba43e28c7..d00f3c82715 100644 --- a/Wrap/Swig/ignoreSample.i +++ b/Wrap/Swig/ignoreSample.i @@ -1,8 +1,8 @@ // fix SWIG warning 509, certain C++ overloads create ambiguities in Python %ignore ParticleLayout::setInterference(IInterference*); %ignore ParticleLayout::setInterference(const IInterference*); -%ignore MesoCrystal::MesoCrystal(IClusteredParticles*, IFormFactor*); -%ignore MesoCrystal::MesoCrystal(const IClusteredParticles*, const IFormFactor*); +%ignore MesoCrystal::MesoCrystal(IClusteredParticles*, IReParticle*); +%ignore MesoCrystal::MesoCrystal(const IClusteredParticles*, const IReParticle*); %ignore Instrument::setDetectorResolutionFunction(IResolutionFunction2D*); %ignore Instrument::setDetectorResolutionFunction(const IResolutionFunction2D*); diff --git a/Wrap/Swig/libBornAgainCore.i b/Wrap/Swig/libBornAgainCore.i index cb36cb22bcf..88ce410bd0a 100644 --- a/Wrap/Swig/libBornAgainCore.i +++ b/Wrap/Swig/libBornAgainCore.i @@ -58,7 +58,7 @@ #include "BAVersion.h" #include "Fit/Minimizer/MinimizerResult.h" #include "Sample/Scattering/ISampleNode.h" -#include "Sample/Scattering/IFormFactor.h" +#include "Resample/Particle/IReParticle.h" #include "Core/Background/ConstantBackground.h" #include "Core/Background/PoissonNoiseBackground.h" @@ -90,7 +90,7 @@ %include "fromParam.i" %import(module="libBornAgainSample") "Sample/Scattering/ISampleNode.h" -%import(module="libBornAgainSample") "Sample/Scattering/IFormFactor.h" +%import(module="libBornAgainSample") "Sample/Scattering/IReParticle.h" %template(swig_dummy_type_axisinfo_vector) std::vector<AxisInfo>; diff --git a/Wrap/Swig/libBornAgainResample.i b/Wrap/Swig/libBornAgainResample.i index eee2d9d0be7..73b814c8b63 100644 --- a/Wrap/Swig/libBornAgainResample.i +++ b/Wrap/Swig/libBornAgainResample.i @@ -57,7 +57,7 @@ %include "fromParam.i" %import(module="libBornAgainSample") "Sample/Scattering/ISampleNode.h" -%import(module="libBornAgainSample") "Sample/Scattering/IFormFactor.h" +%import(module="libBornAgainSample") "Sample/Scattering/IReParticle.h" %include "BAVersion.h" %include "Resample/Swig/MultiLayerFuncs.h" diff --git a/Wrap/Swig/libBornAgainSample.i b/Wrap/Swig/libBornAgainSample.i index 2508327e0ac..77c5bd7bc0a 100644 --- a/Wrap/Swig/libBornAgainSample.i +++ b/Wrap/Swig/libBornAgainSample.i @@ -29,8 +29,8 @@ $result = SWIG_NewPointerObj(new $1_ltype(std::move($1)), $&1_descriptor, SWIG_POINTER_OWN); %} -%feature("director") ISampleNode; // needed by IFormFactor -%feature("director") IFormFactor; // needed by DecoratedFF etc ? +%feature("director") ISampleNode; // needed by IReParticle +%feature("director") IReParticle; // needed by ReParticle etc ? %feature("director") IBornFF; // used in CustomFormFactor.py %{ @@ -81,14 +81,14 @@ #include "Sample/Multilayer/Layer.h" #include "Sample/Multilayer/MultiLayer.h" #include "Sample/Particle/Crystal.h" -#include "Sample/Particle/FormFactorCrystal.h" -#include "Sample/Particle/FormFactorComposition.h" +#include "Resample/Particle/ReMesocrystal.h" +#include "Resample/Particle/ReCompound.h" #include "Sample/Particle/MesoCrystal.h" #include "Sample/Particle/Particle.h" #include "Sample/Particle/ParticleComposition.h" #include "Sample/Particle/ParticleCoreShell.h" -#include "Sample/Particle/ParticleInSlice.h" -#include "Sample/Scattering/DecoratedFF.h" +#include "Resample/Particle/ParticleInSlice.h" +#include "Resample/Particle/ReParticle.h" #include "Sample/Interface/LayerInterface.h" #include "Sample/Interface/LayerRoughness.h" #include "Sample/SoftParticle/FormFactorGauss.h" @@ -117,19 +117,19 @@ %template(swig_dummy_type_inode_vector) std::vector<INode*>; %template(swig_dummy_type_const_inode_vector) std::vector<const INode*>; -%template(vector_IFormFactorPtr_t) std::vector<IFormFactor*>; +%template(vector_IReParticlePtr_t) std::vector<IReParticle*>; %include "Sample/Material/Material.h" %include "Sample/Material/MaterialFactoryFuncs.h" %include "Sample/Scattering/ISampleNode.h" -%include "Sample/Scattering/IFormFactor.h" +%include "Resample/Particle/IReParticle.h" %include "Sample/Scattering/IBornFF.h" -%include "Sample/Scattering/DecoratedFF.h" +%include "Resample/Particle/ReParticle.h" %include "Sample/Scattering/Rotations.h" -%include "Sample/Particle/FormFactorCrystal.h" -%include "Sample/Particle/FormFactorComposition.h" +%include "Resample/Particle/ReMesocrystal.h" +%include "Resample/Particle/ReCompound.h" %include "Sample/Particle/Crystal.h" %include "Sample/Particle/IParticle.h" %include "Sample/Particle/MesoCrystal.h" @@ -168,8 +168,8 @@ %rename(RoughnessModel) RoughnessModelWrap; %include "Sample/Multilayer/RoughnessModels.h" -%include "Sample/HardParticle/IFormFactorPolyhedron.h" -%include "Sample/HardParticle/IFormFactorPrism.h" +%include "Sample/HardParticle/IReParticlePolyhedron.h" +%include "Sample/HardParticle/IReParticlePrism.h" %include "Sample/HardParticle/IProfileRipple.h" %include "Sample/HardParticle/FormFactorAnisoPyramid.h" diff --git a/auto/Wrap/doxygenResample.i b/auto/Wrap/doxygenResample.i index a706ddd35dc..bd431854121 100644 --- a/auto/Wrap/doxygenResample.i +++ b/auto/Wrap/doxygenResample.i @@ -737,7 +737,7 @@ Returns the coherent sum of the four DWBA terms for polarized scattering. // File: namespace_0d29.xml -// File: namespace_0d35.xml +// File: namespace_0d31.xml // File: namespace_0d37.xml @@ -749,6 +749,9 @@ Returns the coherent sum of the four DWBA terms for polarized scattering. // File: namespace_0d41.xml +// File: namespace_0d43.xml + + // File: namespace_0d9.xml @@ -820,6 +823,11 @@ Computes the Fresnel R coefficient for the top layer only. Introduced in order t "; +// File: namespacepreprocessor.xml +%feature("docstring") preprocessor::sliceFormFactor "DecoratedFF * preprocessor::sliceFormFactor(const IBornFF &ff, ZLimits limits, const IRotation *rot, R3 translation) +"; + + // File: namespacestd.xml @@ -919,6 +927,12 @@ Get default z limits for generating a material profile. // File: ProcessedSample_8h.xml +// File: Slicer_8cpp.xml + + +// File: Slicer_8h.xml + + // File: KzComputation_8cpp.xml diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i index 16669d61eba..233f051a211 100644 --- a/auto/Wrap/doxygenSample.i +++ b/auto/Wrap/doxygenSample.i @@ -5010,15 +5010,6 @@ C++ includes: ISelectionRule.h "; -// File: structSlicingEffects.xml -%feature("docstring") SlicingEffects " - -Nested structure that holds slicing effects on position and removed parts. - -C++ includes: IBornFF.h -"; - - // File: classSquareLattice2D.xml %feature("docstring") SquareLattice2D " diff --git a/auto/Wrap/libBornAgainSample.py b/auto/Wrap/libBornAgainSample.py index eef2307e593..899d488fdcc 100644 --- a/auto/Wrap/libBornAgainSample.py +++ b/auto/Wrap/libBornAgainSample.py @@ -3310,38 +3310,6 @@ class IFormFactor(libBornAgainBase.ICloneable, libBornAgainParam.INode): # Register IFormFactor in _libBornAgainSample: _libBornAgainSample.IFormFactor_swigregister(IFormFactor) -class SlicingEffects(object): - r""" - - - Nested structure that holds slicing effects on position and removed parts. - - C++ includes: IBornFF.h - - """ - - thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") - __repr__ = _swig_repr - position = property(_libBornAgainSample.SlicingEffects_position_get, _libBornAgainSample.SlicingEffects_position_set, doc=r"""position : R3""") - dz_bottom = property(_libBornAgainSample.SlicingEffects_dz_bottom_get, _libBornAgainSample.SlicingEffects_dz_bottom_set, doc=r"""dz_bottom : double""") - dz_top = property(_libBornAgainSample.SlicingEffects_dz_top_get, _libBornAgainSample.SlicingEffects_dz_top_set, doc=r"""dz_top : double""") - - def __init__(self): - r""" - __init__(SlicingEffects self) -> SlicingEffects - - - Nested structure that holds slicing effects on position and removed parts. - - C++ includes: IBornFF.h - - """ - _libBornAgainSample.SlicingEffects_swiginit(self, _libBornAgainSample.new_SlicingEffects()) - __swig_destroy__ = _libBornAgainSample.delete_SlicingEffects - -# Register SlicingEffects in _libBornAgainSample: -_libBornAgainSample.SlicingEffects_swigregister(SlicingEffects) - class IBornFF(ISampleNode): r""" @@ -3460,10 +3428,6 @@ class IBornFF(ISampleNode): def canSliceAnalytically(self, rot): r"""canSliceAnalytically(IBornFF self, IRotation rot) -> bool""" return _libBornAgainSample.IBornFF_canSliceAnalytically(self, rot) - - def sliceFormFactor(self, limits, rot, translation): - r"""sliceFormFactor(IBornFF self, ZLimits limits, IRotation rot, R3 translation) -> DecoratedFF""" - return _libBornAgainSample.IBornFF_sliceFormFactor(self, limits, rot, translation) def __disown__(self): self.this.disown() _libBornAgainSample.disown_IBornFF(self) diff --git a/auto/Wrap/libBornAgainSample_wrap.cpp b/auto/Wrap/libBornAgainSample_wrap.cpp index b4e0d1d524c..e6f90718e2d 100644 --- a/auto/Wrap/libBornAgainSample_wrap.cpp +++ b/auto/Wrap/libBornAgainSample_wrap.cpp @@ -3214,72 +3214,71 @@ namespace Swig { #define SWIGTYPE_p_RoughnessModelWrap swig_types[114] #define SWIGTYPE_p_RoughnessModelWrap__RoughnessModel swig_types[115] #define SWIGTYPE_p_SimpleSelectionRule swig_types[116] -#define SWIGTYPE_p_SlicingEffects swig_types[117] -#define SWIGTYPE_p_SquareLattice2D swig_types[118] -#define SWIGTYPE_p_Vec3T_double_t swig_types[119] -#define SWIGTYPE_p_Vec3T_int_t swig_types[120] -#define SWIGTYPE_p_Vec3T_std__complexT_double_t_t swig_types[121] -#define SWIGTYPE_p_WavevectorInfo swig_types[122] -#define SWIGTYPE_p_ZLimits swig_types[123] -#define SWIGTYPE_p_allocator_type swig_types[124] -#define SWIGTYPE_p_char swig_types[125] -#define SWIGTYPE_p_difference_type swig_types[126] -#define SWIGTYPE_p_first_type swig_types[127] -#define SWIGTYPE_p_int swig_types[128] -#define SWIGTYPE_p_key_type swig_types[129] -#define SWIGTYPE_p_long_long swig_types[130] -#define SWIGTYPE_p_mapped_type swig_types[131] -#define SWIGTYPE_p_p_PyObject swig_types[132] -#define SWIGTYPE_p_second_type swig_types[133] -#define SWIGTYPE_p_short swig_types[134] -#define SWIGTYPE_p_signed_char swig_types[135] -#define SWIGTYPE_p_size_type swig_types[136] -#define SWIGTYPE_p_std__allocatorT_IFormFactor_p_t swig_types[137] -#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[138] -#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[139] -#define SWIGTYPE_p_std__allocatorT_Vec3T_double_t_t swig_types[140] -#define SWIGTYPE_p_std__allocatorT_Vec3T_std__complexT_double_t_t_t swig_types[141] -#define SWIGTYPE_p_std__allocatorT_double_t swig_types[142] -#define SWIGTYPE_p_std__allocatorT_int_t swig_types[143] -#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[144] -#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[145] -#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[146] -#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[147] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[148] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[149] -#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[150] -#define SWIGTYPE_p_std__arrayT_double_3_t swig_types[151] -#define SWIGTYPE_p_std__arrayT_std__complexT_double_t_3_t swig_types[152] -#define SWIGTYPE_p_std__complexT_double_t swig_types[153] -#define SWIGTYPE_p_std__invalid_argument swig_types[154] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[155] -#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[156] -#define SWIGTYPE_p_std__pairT_double_double_t swig_types[157] -#define SWIGTYPE_p_std__vectorT_IFormFactor_p_std__allocatorT_IFormFactor_p_t_t swig_types[158] -#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[159] -#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_t_t swig_types[160] -#define SWIGTYPE_p_std__vectorT_IParticle_const_p_std__allocatorT_IParticle_const_p_t_t swig_types[161] -#define SWIGTYPE_p_std__vectorT_Material_const_p_std__allocatorT_Material_const_p_t_t swig_types[162] -#define SWIGTYPE_p_std__vectorT_ParticleLayout_const_p_std__allocatorT_ParticleLayout_const_p_t_t swig_types[163] -#define SWIGTYPE_p_std__vectorT_Vec3T_double_t_std__allocatorT_Vec3T_double_t_t_t swig_types[164] -#define SWIGTYPE_p_std__vectorT_Vec3T_std__complexT_double_t_t_std__allocatorT_Vec3T_std__complexT_double_t_t_t_t swig_types[165] -#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[166] -#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[167] -#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[168] -#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[169] -#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[170] -#define SWIGTYPE_p_std__vectorT_std__unique_ptrT_IParticle_t_std__allocatorT_std__unique_ptrT_IParticle_t_t_t swig_types[171] -#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[172] -#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[173] -#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[174] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[175] -#define SWIGTYPE_p_unsigned_char swig_types[176] -#define SWIGTYPE_p_unsigned_int swig_types[177] -#define SWIGTYPE_p_unsigned_long_long swig_types[178] -#define SWIGTYPE_p_unsigned_short swig_types[179] -#define SWIGTYPE_p_value_type swig_types[180] -static swig_type_info *swig_types[182]; -static swig_module_info swig_module = {swig_types, 181, 0, 0, 0, 0}; +#define SWIGTYPE_p_SquareLattice2D swig_types[117] +#define SWIGTYPE_p_Vec3T_double_t swig_types[118] +#define SWIGTYPE_p_Vec3T_int_t swig_types[119] +#define SWIGTYPE_p_Vec3T_std__complexT_double_t_t swig_types[120] +#define SWIGTYPE_p_WavevectorInfo swig_types[121] +#define SWIGTYPE_p_ZLimits swig_types[122] +#define SWIGTYPE_p_allocator_type swig_types[123] +#define SWIGTYPE_p_char swig_types[124] +#define SWIGTYPE_p_difference_type swig_types[125] +#define SWIGTYPE_p_first_type swig_types[126] +#define SWIGTYPE_p_int swig_types[127] +#define SWIGTYPE_p_key_type swig_types[128] +#define SWIGTYPE_p_long_long swig_types[129] +#define SWIGTYPE_p_mapped_type swig_types[130] +#define SWIGTYPE_p_p_PyObject swig_types[131] +#define SWIGTYPE_p_second_type swig_types[132] +#define SWIGTYPE_p_short swig_types[133] +#define SWIGTYPE_p_signed_char swig_types[134] +#define SWIGTYPE_p_size_type swig_types[135] +#define SWIGTYPE_p_std__allocatorT_IFormFactor_p_t swig_types[136] +#define SWIGTYPE_p_std__allocatorT_INode_const_p_t swig_types[137] +#define SWIGTYPE_p_std__allocatorT_INode_p_t swig_types[138] +#define SWIGTYPE_p_std__allocatorT_Vec3T_double_t_t swig_types[139] +#define SWIGTYPE_p_std__allocatorT_Vec3T_std__complexT_double_t_t_t swig_types[140] +#define SWIGTYPE_p_std__allocatorT_double_t swig_types[141] +#define SWIGTYPE_p_std__allocatorT_int_t swig_types[142] +#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[143] +#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[144] +#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[145] +#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[146] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[147] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[148] +#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[149] +#define SWIGTYPE_p_std__arrayT_double_3_t swig_types[150] +#define SWIGTYPE_p_std__arrayT_std__complexT_double_t_3_t swig_types[151] +#define SWIGTYPE_p_std__complexT_double_t swig_types[152] +#define SWIGTYPE_p_std__invalid_argument swig_types[153] +#define SWIGTYPE_p_std__lessT_std__string_t swig_types[154] +#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[155] +#define SWIGTYPE_p_std__pairT_double_double_t swig_types[156] +#define SWIGTYPE_p_std__vectorT_IFormFactor_p_std__allocatorT_IFormFactor_p_t_t swig_types[157] +#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[158] +#define SWIGTYPE_p_std__vectorT_INode_p_std__allocatorT_INode_p_t_t swig_types[159] +#define SWIGTYPE_p_std__vectorT_IParticle_const_p_std__allocatorT_IParticle_const_p_t_t swig_types[160] +#define SWIGTYPE_p_std__vectorT_Material_const_p_std__allocatorT_Material_const_p_t_t swig_types[161] +#define SWIGTYPE_p_std__vectorT_ParticleLayout_const_p_std__allocatorT_ParticleLayout_const_p_t_t swig_types[162] +#define SWIGTYPE_p_std__vectorT_Vec3T_double_t_std__allocatorT_Vec3T_double_t_t_t swig_types[163] +#define SWIGTYPE_p_std__vectorT_Vec3T_std__complexT_double_t_t_std__allocatorT_Vec3T_std__complexT_double_t_t_t_t swig_types[164] +#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[165] +#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[166] +#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[167] +#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[168] +#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[169] +#define SWIGTYPE_p_std__vectorT_std__unique_ptrT_IParticle_t_std__allocatorT_std__unique_ptrT_IParticle_t_t_t swig_types[170] +#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[171] +#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[172] +#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[173] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[174] +#define SWIGTYPE_p_unsigned_char swig_types[175] +#define SWIGTYPE_p_unsigned_int swig_types[176] +#define SWIGTYPE_p_unsigned_long_long swig_types[177] +#define SWIGTYPE_p_unsigned_short swig_types[178] +#define SWIGTYPE_p_value_type swig_types[179] +static swig_type_info *swig_types[181]; +static swig_module_info swig_module = {swig_types, 180, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -8582,48 +8581,6 @@ bool SwigDirector_IBornFF::canSliceAnalytically(IRotation const *rot) const { } -DecoratedFF *SwigDirector_IBornFF::sliceFormFactor(ZLimits limits, IRotation const *rot, R3 translation) const { - DecoratedFF *c_result = 0 ; - void *swig_argp ; - int swig_res ; - swig_owntype own ; - - swig::SwigVar_PyObject obj0; - obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(new ZLimits((const ZLimits &)limits)), SWIGTYPE_p_ZLimits, SWIG_POINTER_OWN | 0 ); - swig::SwigVar_PyObject obj1; - obj1 = SWIG_NewPointerObj(SWIG_as_voidptr(rot), SWIGTYPE_p_IRotation, 0 ); - swig::SwigVar_PyObject obj2; - obj2 = SWIG_NewPointerObj(SWIG_as_voidptr(new R3((const R3 &)translation)), SWIGTYPE_p_Vec3T_double_t, SWIG_POINTER_OWN | 0 ); - swig_set_inner("sliceFormFactor", true); - if (!swig_get_self()) { - Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call IBornFF.__init__."); - } -#if defined(SWIG_PYTHON_DIRECTOR_VTABLE) - const size_t swig_method_index = 13; - const char *const swig_method_name = "sliceFormFactor"; - PyObject *method = swig_get_method(swig_method_index, swig_method_name); - swig::SwigVar_PyObject result = PyObject_CallFunctionObjArgs(method ,(PyObject *)obj0,(PyObject *)obj1,(PyObject *)obj2, NULL); -#else - swig::SwigVar_PyObject swig_method_name = SWIG_Python_str_FromChar("sliceFormFactor"); - swig::SwigVar_PyObject result = PyObject_CallMethodObjArgs(swig_get_self(), (PyObject *) swig_method_name ,(PyObject *)obj0,(PyObject *)obj1,(PyObject *)obj2, NULL); -#endif - swig_set_inner("sliceFormFactor", false); - if (!result) { - PyObject *error = PyErr_Occurred(); - if (error) { - Swig::DirectorMethodException::raise("Error detected when calling 'IBornFF.sliceFormFactor'"); - } - } - swig_res = SWIG_ConvertPtrAndOwn(result, &swig_argp, SWIGTYPE_p_DecoratedFF, 0 | SWIG_POINTER_DISOWN, &own); - if (!SWIG_IsOK(swig_res)) { - Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""DecoratedFF *""'"); - } - c_result = reinterpret_cast< DecoratedFF * >(swig_argp); - swig_acquire_ownership_obj(SWIG_as_voidptr(c_result), own /* & TODO: SWIG_POINTER_OWN */); - return (DecoratedFF *) c_result; -} - - #ifdef __cplusplus extern "C" { #endif @@ -39964,208 +39921,6 @@ SWIGINTERN PyObject *IFormFactor_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObje return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_SlicingEffects_position_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - R3 *arg2 = (R3 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "SlicingEffects_position_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlicingEffects_position_set" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_Vec3T_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlicingEffects_position_set" "', argument " "2"" of type '" "R3 *""'"); - } - arg2 = reinterpret_cast< R3 * >(argp2); - if (arg1) (arg1)->position = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlicingEffects_position_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - R3 *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlicingEffects_position_get" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - result = (R3 *)& ((arg1)->position); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Vec3T_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlicingEffects_dz_bottom_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "SlicingEffects_dz_bottom_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlicingEffects_dz_bottom_set" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SlicingEffects_dz_bottom_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->dz_bottom = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlicingEffects_dz_bottom_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlicingEffects_dz_bottom_get" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - result = (double) ((arg1)->dz_bottom); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlicingEffects_dz_top_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - - if (!SWIG_Python_UnpackTuple(args, "SlicingEffects_dz_top_set", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlicingEffects_dz_top_set" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SlicingEffects_dz_top_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->dz_top = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlicingEffects_dz_top_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - double result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlicingEffects_dz_top_get" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - result = (double) ((arg1)->dz_top); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SlicingEffects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "new_SlicingEffects", 0, 0, 0)) SWIG_fail; - result = (SlicingEffects *)new SlicingEffects(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SlicingEffects, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SlicingEffects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SlicingEffects *arg1 = (SlicingEffects *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SlicingEffects, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SlicingEffects" "', argument " "1"" of type '" "SlicingEffects *""'"); - } - arg1 = reinterpret_cast< SlicingEffects * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SlicingEffects_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_SlicingEffects, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *SlicingEffects_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - SWIGINTERN PyObject *_wrap_new_IBornFF__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; @@ -40759,89 +40514,6 @@ fail: } -SWIGINTERN PyObject *_wrap_IBornFF_sliceFormFactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - IBornFF *arg1 = (IBornFF *) 0 ; - ZLimits arg2 ; - IRotation *arg3 = (IRotation *) 0 ; - R3 arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 ; - int res4 = 0 ; - PyObject *swig_obj[4] ; - Swig::Director *director = 0; - bool upcall = false; - SwigDirector_IBornFF *darg = 0; - DecoratedFF *result = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "IBornFF_sliceFormFactor", 4, 4, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IBornFF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IBornFF_sliceFormFactor" "', argument " "1"" of type '" "IBornFF const *""'"); - } - arg1 = reinterpret_cast< IBornFF * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_ZLimits, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IBornFF_sliceFormFactor" "', argument " "2"" of type '" "ZLimits""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IBornFF_sliceFormFactor" "', argument " "2"" of type '" "ZLimits""'"); - } else { - ZLimits * temp = reinterpret_cast< ZLimits * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_IRotation, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IBornFF_sliceFormFactor" "', argument " "3"" of type '" "IRotation const *""'"); - } - arg3 = reinterpret_cast< IRotation * >(argp3); - { - res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_Vec3T_double_t, 0 | 0); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IBornFF_sliceFormFactor" "', argument " "4"" of type '" "R3""'"); - } - if (!argp4) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IBornFF_sliceFormFactor" "', argument " "4"" of type '" "R3""'"); - } else { - R3 * temp = reinterpret_cast< R3 * >(argp4); - arg4 = *temp; - if (SWIG_IsNewObj(res4)) delete temp; - } - } - director = SWIG_DIRECTOR_CAST(arg1); - if (!director || !(director->swig_get_inner("sliceFormFactor"))) { - SWIG_SetErrorMsg(PyExc_RuntimeError,"accessing protected member sliceFormFactor"); - SWIG_fail; - } - upcall = (director && (director->swig_get_self()==swig_obj[0])); - try { - darg = dynamic_cast<SwigDirector_IBornFF *>(arg1); - if (upcall) { - result = (DecoratedFF *)((SwigDirector_IBornFF const *)darg)->sliceFormFactorSwigPublic(arg2,(IRotation const *)arg3,arg4); - } else { - result = (DecoratedFF *)((SwigDirector_IBornFF const *)darg)->sliceFormFactor(arg2,(IRotation const *)arg3,arg4); - } - } catch (Swig::DirectorException&) { - SWIG_fail; - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DecoratedFF, 0 | 0 ); - if (director) { - SWIG_AcquirePtr(resultobj, director->swig_release_ownership(SWIG_as_voidptr(result))); - } - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_disown_IBornFF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IBornFF *arg1 = (IBornFF *) 0 ; @@ -69189,24 +68861,6 @@ static PyMethodDef SwigMethods[] = { { "disown_IFormFactor", _wrap_disown_IFormFactor, METH_O, NULL}, { "IFormFactor_swigregister", IFormFactor_swigregister, METH_O, NULL}, { "IFormFactor_swiginit", IFormFactor_swiginit, METH_VARARGS, NULL}, - { "SlicingEffects_position_set", _wrap_SlicingEffects_position_set, METH_VARARGS, "SlicingEffects_position_set(SlicingEffects self, R3 position)"}, - { "SlicingEffects_position_get", _wrap_SlicingEffects_position_get, METH_O, "SlicingEffects_position_get(SlicingEffects self) -> R3"}, - { "SlicingEffects_dz_bottom_set", _wrap_SlicingEffects_dz_bottom_set, METH_VARARGS, "SlicingEffects_dz_bottom_set(SlicingEffects self, double dz_bottom)"}, - { "SlicingEffects_dz_bottom_get", _wrap_SlicingEffects_dz_bottom_get, METH_O, "SlicingEffects_dz_bottom_get(SlicingEffects self) -> double"}, - { "SlicingEffects_dz_top_set", _wrap_SlicingEffects_dz_top_set, METH_VARARGS, "SlicingEffects_dz_top_set(SlicingEffects self, double dz_top)"}, - { "SlicingEffects_dz_top_get", _wrap_SlicingEffects_dz_top_get, METH_O, "SlicingEffects_dz_top_get(SlicingEffects self) -> double"}, - { "new_SlicingEffects", _wrap_new_SlicingEffects, METH_NOARGS, "\n" - "new_SlicingEffects() -> SlicingEffects\n" - "\n" - "\n" - "Nested structure that holds slicing effects on position and removed parts.\n" - "\n" - "C++ includes: IBornFF.h\n" - "\n" - ""}, - { "delete_SlicingEffects", _wrap_delete_SlicingEffects, METH_O, "delete_SlicingEffects(SlicingEffects self)"}, - { "SlicingEffects_swigregister", SlicingEffects_swigregister, METH_O, NULL}, - { "SlicingEffects_swiginit", SlicingEffects_swiginit, METH_VARARGS, NULL}, { "new_IBornFF", _wrap_new_IBornFF, METH_VARARGS, "\n" "IBornFF()\n" "new_IBornFF(PyObject * _self, NodeMeta meta, vdouble1d_t PValues) -> IBornFF\n" @@ -69275,7 +68929,6 @@ static PyMethodDef SwigMethods[] = { "\n" ""}, { "IBornFF_canSliceAnalytically", _wrap_IBornFF_canSliceAnalytically, METH_VARARGS, "IBornFF_canSliceAnalytically(IBornFF self, IRotation rot) -> bool"}, - { "IBornFF_sliceFormFactor", _wrap_IBornFF_sliceFormFactor, METH_VARARGS, "IBornFF_sliceFormFactor(IBornFF self, ZLimits limits, IRotation rot, R3 translation) -> DecoratedFF"}, { "disown_IBornFF", _wrap_disown_IBornFF, METH_O, NULL}, { "IBornFF_swigregister", IBornFF_swigregister, METH_O, NULL}, { "IBornFF_swiginit", IBornFF_swiginit, METH_VARARGS, NULL}, @@ -74981,7 +74634,6 @@ static swig_type_info _swigt__p_RotationZ = {"_p_RotationZ", "RotationZ *", 0, 0 static swig_type_info _swigt__p_RoughnessModelWrap = {"_p_RoughnessModelWrap", "RoughnessModelWrap *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_RoughnessModelWrap__RoughnessModel = {"_p_RoughnessModelWrap__RoughnessModel", "enum RoughnessModelWrap::RoughnessModel *|RoughnessModel *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SimpleSelectionRule = {"_p_SimpleSelectionRule", "SimpleSelectionRule *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_SlicingEffects = {"_p_SlicingEffects", "SlicingEffects *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SquareLattice2D = {"_p_SquareLattice2D", "SquareLattice2D *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Vec3T_double_t = {"_p_Vec3T_double_t", "std::vector< Vec3< double > >::value_type *|R3 *|Vec3< double > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Vec3T_int_t = {"_p_Vec3T_int_t", "I3 *|Vec3< int > *", 0, 0, (void*)0, 0}; @@ -75164,7 +74816,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_RoughnessModelWrap, &_swigt__p_RoughnessModelWrap__RoughnessModel, &_swigt__p_SimpleSelectionRule, - &_swigt__p_SlicingEffects, &_swigt__p_SquareLattice2D, &_swigt__p_Vec3T_double_t, &_swigt__p_Vec3T_int_t, @@ -75347,7 +74998,6 @@ static swig_cast_info _swigc__p_RotationZ[] = { {&_swigt__p_RotationZ, 0, 0, 0} static swig_cast_info _swigc__p_RoughnessModelWrap[] = { {&_swigt__p_RoughnessModelWrap, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_RoughnessModelWrap__RoughnessModel[] = { {&_swigt__p_RoughnessModelWrap__RoughnessModel, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SimpleSelectionRule[] = { {&_swigt__p_SimpleSelectionRule, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_SlicingEffects[] = { {&_swigt__p_SlicingEffects, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SquareLattice2D[] = { {&_swigt__p_SquareLattice2D, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Vec3T_double_t[] = { {&_swigt__p_Vec3T_double_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Vec3T_int_t[] = { {&_swigt__p_Vec3T_int_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -75530,7 +75180,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_RoughnessModelWrap, _swigc__p_RoughnessModelWrap__RoughnessModel, _swigc__p_SimpleSelectionRule, - _swigc__p_SlicingEffects, _swigc__p_SquareLattice2D, _swigc__p_Vec3T_double_t, _swigc__p_Vec3T_int_t, diff --git a/auto/Wrap/libBornAgainSample_wrap.h b/auto/Wrap/libBornAgainSample_wrap.h index 07dd24e5083..1cff021c46c 100644 --- a/auto/Wrap/libBornAgainSample_wrap.h +++ b/auto/Wrap/libBornAgainSample_wrap.h @@ -135,10 +135,6 @@ public: virtual bool canSliceAnalyticallySwigPublic(IRotation const *rot) const { return IBornFF::canSliceAnalytically(rot); } - virtual DecoratedFF *sliceFormFactor(ZLimits limits, IRotation const *rot, R3 translation) const; - virtual DecoratedFF *sliceFormFactorSwigPublic(ZLimits limits, IRotation const *rot, R3 translation) const { - return IBornFF::sliceFormFactor(limits,rot,translation); - } /* Internal director utilities */ public: @@ -169,7 +165,7 @@ private: return method; } private: - mutable swig::SwigVar_PyObject vtable[14]; + mutable swig::SwigVar_PyObject vtable[13]; #endif }; -- GitLab