diff --git a/Core/Computation/DWBAComputation.cpp b/Core/Computation/DWBAComputation.cpp index fa4940e2a691a40c48d5b594e405161ab75cc6d2..70bd6d06702681b5b9b58837a5f80f28eeb4e548 100644 --- a/Core/Computation/DWBAComputation.cpp +++ b/Core/Computation/DWBAComputation.cpp @@ -21,18 +21,18 @@ #include "Resample/Element/DiffuseElement.h" #include "Resample/Flux/IFlux.h" #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedLayout.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReLayout.h" +#include "Resample/Processed/ReSample.h" namespace { std::vector<std::unique_ptr<const ParticleLayoutContribution>> -makeLayoutComputation(const std::vector<ProcessedLayout>& layouts, const SimulationOptions& options, +makeLayoutComputation(const std::vector<reLayout>& layouts, const SimulationOptions& options, bool polarized) { std::vector<std::unique_ptr<const ParticleLayoutContribution>> result; - for (const ProcessedLayout& layout : layouts) + for (const reLayout& layout : layouts) result.emplace_back(new ParticleLayoutContribution(layout, options, polarized)); return result; @@ -41,7 +41,7 @@ makeLayoutComputation(const std::vector<ProcessedLayout>& layouts, const Simulat } // namespace -DWBAComputation::DWBAComputation(const ProcessedSample& re_sample, const SimulationOptions& options, +DWBAComputation::DWBAComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress, std::vector<std::unique_ptr<DiffuseElement>>::iterator begin_it, std::vector<std::unique_ptr<DiffuseElement>>::iterator end_it) diff --git a/Core/Computation/DWBAComputation.h b/Core/Computation/DWBAComputation.h index 0f374c80142322ba270e940ae261b225ef13f775..4db9245579f34ccb77ec038d6e9a84ff24149254 100644 --- a/Core/Computation/DWBAComputation.h +++ b/Core/Computation/DWBAComputation.h @@ -26,7 +26,7 @@ class DiffuseElement; class GISASSpecularContribution; class ParticleLayoutContribution; -class ProcessedSample; +class reSample; class RoughMultiLayerContribution; class SimulationOptions; @@ -40,7 +40,7 @@ class SimulationOptions; class DWBAComputation : public IComputation { public: - DWBAComputation(const ProcessedSample& re_sample, const SimulationOptions& options, + DWBAComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress, std::vector<std::unique_ptr<DiffuseElement>>::iterator begin_it, std::vector<std::unique_ptr<DiffuseElement>>::iterator end_it); diff --git a/Core/Computation/DepthProbeComputation.cpp b/Core/Computation/DepthProbeComputation.cpp index 189bab9e223f661e240dfc3f62b625c76077160b..b2d73fb32b4bcaa8a1cfc0667d77148a4506e43e 100644 --- a/Core/Computation/DepthProbeComputation.cpp +++ b/Core/Computation/DepthProbeComputation.cpp @@ -18,9 +18,9 @@ #include "Base/Progress/ProgressHandler.h" #include "Base/Util/Assert.h" #include "Resample/Flux/ScalarFlux.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" -DepthProbeComputation::DepthProbeComputation(const ProcessedSample& re_sample, +DepthProbeComputation::DepthProbeComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress, DepthProbeElementIter begin_it, diff --git a/Core/Computation/DepthProbeComputation.h b/Core/Computation/DepthProbeComputation.h index f6e546056a06d0660a010ae2250c73ff8712990d..9d71caa5b14b7d6e362d380b1a093931bef5721e 100644 --- a/Core/Computation/DepthProbeComputation.h +++ b/Core/Computation/DepthProbeComputation.h @@ -24,7 +24,7 @@ #include <vector> class DepthProbeElement; -class ProcessedSample; +class reSample; //! Performs a single-threaded depth probe computation with given sample. //! @@ -34,7 +34,7 @@ class DepthProbeComputation : public IComputation { using DepthProbeElementIter = std::vector<DepthProbeElement>::iterator; public: - DepthProbeComputation(const ProcessedSample& re_sample, const SimulationOptions& options, + DepthProbeComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress, DepthProbeElementIter begin_it, DepthProbeElementIter end_it); ~DepthProbeComputation() override; diff --git a/Core/Computation/IComputation.cpp b/Core/Computation/IComputation.cpp index 5e2456d220b73522ad6099127f87843a9a8c76fc..028dcd3c09e078e758e1cc5140e28d230dd1fb41 100644 --- a/Core/Computation/IComputation.cpp +++ b/Core/Computation/IComputation.cpp @@ -15,9 +15,9 @@ #include "Core/Computation/IComputation.h" #include "Base/Progress/DelayedProgressCounter.h" #include "Base/Progress/ProgressHandler.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" -IComputation::IComputation(const ProcessedSample& re_sample, const SimulationOptions& options, +IComputation::IComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress) : m_re_sample(re_sample), m_options(options), m_progress(&progress) { diff --git a/Core/Computation/IComputation.h b/Core/Computation/IComputation.h index 6a1d154f2e2ddc3796769796bc1076607b2209f9..1863b96329e36091a6e3c1fa2011048be71ea03d 100644 --- a/Core/Computation/IComputation.h +++ b/Core/Computation/IComputation.h @@ -25,7 +25,7 @@ class DelayedProgressCounter; class MultiLayer; -class ProcessedSample; +class reSample; class ProgressHandler; class SimulationOptions; @@ -36,7 +36,7 @@ class SimulationOptions; class IComputation { public: - IComputation(const ProcessedSample& re_sample, const SimulationOptions& options, + IComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress); virtual ~IComputation(); @@ -50,7 +50,7 @@ protected: void setProgressHandler(ProgressHandler* progress) const; void stepProgress() const; - const ProcessedSample& m_re_sample; + const reSample& m_re_sample; const SimulationOptions& m_options; ProgressHandler* m_progress; ComputationStatus m_status; diff --git a/Core/Computation/SpecularComputation.cpp b/Core/Computation/SpecularComputation.cpp index d4a232dd87818803fa7d094fbe80058750757510..5bb6715f984ae0c75f401cc2ff427463e6b0a27b 100644 --- a/Core/Computation/SpecularComputation.cpp +++ b/Core/Computation/SpecularComputation.cpp @@ -16,11 +16,11 @@ #include "Base/Progress/ProgressHandler.h" #include "Resample/Element/SpecularElement.h" #include "Resample/Flux/IFlux.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Resample/Specular/ComputeFluxMagnetic.h" #include "Resample/Specular/ComputeFluxScalar.h" -SpecularComputation::SpecularComputation(const ProcessedSample& re_sample, +SpecularComputation::SpecularComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress, SpecularElementIter begin_it, SpecularElementIter end_it) diff --git a/Core/Computation/SpecularComputation.h b/Core/Computation/SpecularComputation.h index ef3b64139b86b74c03e053e7ddff2edee7703773..5a9d52e1d7969d48fd09af3eea69f0593e85b472 100644 --- a/Core/Computation/SpecularComputation.h +++ b/Core/Computation/SpecularComputation.h @@ -33,7 +33,7 @@ class SpecularComputation : public IComputation { using SpecularElementIter = std::vector<SpecularElement>::iterator; public: - SpecularComputation(const ProcessedSample& re_sample, const SimulationOptions& options, + SpecularComputation(const reSample& re_sample, const SimulationOptions& options, ProgressHandler& progress, SpecularElementIter begin_it, SpecularElementIter end_it); ~SpecularComputation() override; diff --git a/Core/Contrib/ParticleLayoutContribution.cpp b/Core/Contrib/ParticleLayoutContribution.cpp index ce52edf7fff462db6eee15ba22f8cbbeb315892e..6a4d37ec784fc4d88f38ce77f400fde474e9ea1c 100644 --- a/Core/Contrib/ParticleLayoutContribution.cpp +++ b/Core/Contrib/ParticleLayoutContribution.cpp @@ -16,12 +16,12 @@ #include "Resample/Element/DiffuseElement.h" #include "Resample/Interparticle/DecouplingApproximationStrategy.h" #include "Resample/Interparticle/SSCAStrategy.h" -#include "Resample/Processed/ProcessedLayout.h" +#include "Resample/Processed/ReLayout.h" #include "Sample/Aggregate/InterferenceRadialParaCrystal.h" namespace { -std::unique_ptr<IInterparticleStrategy> processedInterference(const ProcessedLayout& re_layout, +std::unique_ptr<IInterparticleStrategy> processedInterference(const reLayout& re_layout, const SimulationOptions& sim_params, bool polarized) { @@ -43,7 +43,7 @@ std::unique_ptr<IInterparticleStrategy> processedInterference(const ProcessedLay } // namespace -ParticleLayoutContribution::ParticleLayoutContribution(const ProcessedLayout& layout, +ParticleLayoutContribution::ParticleLayoutContribution(const reLayout& layout, const SimulationOptions& options, bool polarized) : m_layout(layout), m_interparticle_strategy(processedInterference(layout, options, polarized)) diff --git a/Core/Contrib/ParticleLayoutContribution.h b/Core/Contrib/ParticleLayoutContribution.h index ef94ff6b9f6f96d3d7e9db3e85de7f35c0db97e1..88b155840797dce4664b9bd7f34289447d7dea10 100644 --- a/Core/Contrib/ParticleLayoutContribution.h +++ b/Core/Contrib/ParticleLayoutContribution.h @@ -23,7 +23,7 @@ #include <memory> class IInterparticleStrategy; -class ProcessedLayout; +class reLayout; class DiffuseElement; class SimulationOptions; @@ -32,14 +32,14 @@ class SimulationOptions; class ParticleLayoutContribution final { public: - ParticleLayoutContribution(const ProcessedLayout& re_layout, const SimulationOptions& options, + ParticleLayoutContribution(const reLayout& re_layout, const SimulationOptions& options, bool polarized); ~ParticleLayoutContribution(); void compute(DiffuseElement& ele) const; private: - const ProcessedLayout& m_layout; + const reLayout& m_layout; const std::unique_ptr<const IInterparticleStrategy> m_interparticle_strategy; }; diff --git a/Core/Contrib/RoughMultiLayerContribution.cpp b/Core/Contrib/RoughMultiLayerContribution.cpp index eee1c99aff88758812de39d510ed2d242f74e748..fd0554be753cb2ca12b71292caaafc3b97ca87d8 100644 --- a/Core/Contrib/RoughMultiLayerContribution.cpp +++ b/Core/Contrib/RoughMultiLayerContribution.cpp @@ -17,7 +17,7 @@ #include "Base/Util/Assert.h" #include "Resample/Element/DiffuseElement.h" #include "Resample/Flux/ScalarFlux.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Sample/Interface/LayerInterface.h" #include "Sample/Interface/LayerRoughness.h" #include "Sample/Multilayer/Layer.h" @@ -42,7 +42,7 @@ complex_t h_min(complex_t z) } // namespace -RoughMultiLayerContribution::RoughMultiLayerContribution(const ProcessedSample& re_sample) +RoughMultiLayerContribution::RoughMultiLayerContribution(const reSample& re_sample) : m_re_sample{re_sample} { } diff --git a/Core/Contrib/RoughMultiLayerContribution.h b/Core/Contrib/RoughMultiLayerContribution.h index 809ccac4b756287e57883b4f1b472517f4896f53..3b9ff8911bd5d4e3d8b09b587e5ea25f7429267d 100644 --- a/Core/Contrib/RoughMultiLayerContribution.h +++ b/Core/Contrib/RoughMultiLayerContribution.h @@ -22,7 +22,7 @@ #include <heinz/Complex.h> -class ProcessedSample; +class reSample; class DiffuseElement; //! Computes the diffuse reflection from the rough interfaces of a multilayer. @@ -30,12 +30,12 @@ class DiffuseElement; class RoughMultiLayerContribution final { public: - RoughMultiLayerContribution(const ProcessedSample& re_sample); + RoughMultiLayerContribution(const reSample& re_sample); void compute(DiffuseElement& ele) const; private: - const ProcessedSample& m_re_sample; + const reSample& m_re_sample; complex_t get_refractive_term(size_t i_layer, double wavelength) const; complex_t get_sum8terms(size_t i_layer, const DiffuseElement& ele) const; diff --git a/Core/Simulation/DepthProbeSimulation.cpp b/Core/Simulation/DepthProbeSimulation.cpp index 94d5d1abe6e4ca586d29836ef03195425ef52b6e..941825ebd46293190aba5f16e384b0cdc25caca1 100644 --- a/Core/Simulation/DepthProbeSimulation.cpp +++ b/Core/Simulation/DepthProbeSimulation.cpp @@ -158,8 +158,7 @@ std::vector<DepthProbeElement> DepthProbeSimulation::generateElements(const Beam } std::unique_ptr<IComputation> -DepthProbeSimulation::createComputation(const ProcessedSample& re_sample, size_t start, - size_t n_elements) +DepthProbeSimulation::createComputation(const reSample& re_sample, size_t start, size_t n_elements) { ASSERT(start < m_eles.size() && start + n_elements <= m_eles.size()); const auto& begin = m_eles.begin() + static_cast<long>(start); diff --git a/Core/Simulation/DepthProbeSimulation.h b/Core/Simulation/DepthProbeSimulation.h index d0ad1e69624ba8c89cfcbe8fa46e1780a74a9ba9..57801e622120adb4f60841bf6d634308aca9ed75 100644 --- a/Core/Simulation/DepthProbeSimulation.h +++ b/Core/Simulation/DepthProbeSimulation.h @@ -76,7 +76,7 @@ private: //! @param re_sample Preprocessed version of our sample //! @param start Index of the first element to include into computation //! @param n_elements Number of elements to process - std::unique_ptr<IComputation> createComputation(const ProcessedSample& re_sample, size_t start, + std::unique_ptr<IComputation> createComputation(const reSample& re_sample, size_t start, size_t n_elements) override; //! Checks if simulation data is ready for retrieval. diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp index b453576941127b0340cad733ffbc0f0ff81e53bf..cb6e268af63c9f3d5ffc4169fa703f4726bbba84 100644 --- a/Core/Simulation/ISimulation.cpp +++ b/Core/Simulation/ISimulation.cpp @@ -22,7 +22,7 @@ #include "Device/Beam/Beam.h" #include "Device/Detector/IDetector.h" #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Sample/Multilayer/MultiLayer.h" #include "Sample/Multilayer/MultilayerUtils.h" #include <gsl/gsl_errno.h> @@ -185,7 +185,7 @@ void ISimulation::runSimulation() const bool force_polarized = detector().analyzer().polDirection() != R3{}; - const auto re_sample = ProcessedSample::make(*sample(), options(), force_polarized); + const auto re_sample = reSample::make(*sample(), options(), force_polarized); const size_t total_size = numberOfElements(); size_t param_combinations = m_distribution_handler.getTotalNumberOfSamples(); @@ -299,7 +299,7 @@ const std::vector<ParameterDistribution>& ISimulation::getDistributions() const //! Runs a single simulation with fixed parameter values. //! If desired, the simulation is run in several threads. -void ISimulation::runSingleSimulation(const ProcessedSample& re_sample, size_t batch_start, +void ISimulation::runSingleSimulation(const reSample& re_sample, size_t batch_start, size_t batch_size, double weight) { initElementVector(); diff --git a/Core/Simulation/ISimulation.h b/Core/Simulation/ISimulation.h index 31f1e501a4d3668e39badee0961000d0429b92f6..706e848c1598d63dd4b0b21f233ea197d7dc5363 100644 --- a/Core/Simulation/ISimulation.h +++ b/Core/Simulation/ISimulation.h @@ -24,7 +24,7 @@ class IBackground; class IComputation; class ICoordSystem; class MultiLayer; -class ProcessedSample; +class reSample; class ProgressHandler; class SimulationOptions; class SimulationResult; @@ -112,15 +112,15 @@ protected: private: void initialize(); - void runSingleSimulation(const ProcessedSample& re_sample, size_t batch_start, - size_t batch_size, double weight = 1.0); + void runSingleSimulation(const reSample& re_sample, size_t batch_start, size_t batch_size, + double weight = 1.0); //! Generate a single threaded computation for a given range of simulation elements //! @param re_sample Preprocessed version of our sample //! @param start Index of the first element to include into computation //! @param n_elements Number of elements to process - virtual std::unique_ptr<IComputation> createComputation(const ProcessedSample& re_sample, - size_t start, size_t n_elements) = 0; + virtual std::unique_ptr<IComputation> createComputation(const reSample& re_sample, size_t start, + size_t n_elements) = 0; //! Checks the distribution validity for simulation. virtual void validateParametrization(const ParameterDistribution&) const {} diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp index 9e3cf5c050da16c1a119d5e536763a21355571f6..d3ac81d4b5906d3a169f4c600ac4b031845a2645 100644 --- a/Core/Simulation/ISimulation2D.cpp +++ b/Core/Simulation/ISimulation2D.cpp @@ -85,7 +85,7 @@ void ISimulation2D::setDetector(const IDetector2D& detector) initCoordSystem(); } -std::unique_ptr<IComputation> ISimulation2D::createComputation(const ProcessedSample& re_sample, +std::unique_ptr<IComputation> ISimulation2D::createComputation(const reSample& re_sample, size_t start, size_t n_elements) { ASSERT(start < m_eles.size() && start + n_elements <= m_eles.size()); diff --git a/Core/Simulation/ISimulation2D.h b/Core/Simulation/ISimulation2D.h index 56fe9a464f7e4a7b4dd31002cc386e92a7db1ae6..fde26ce1fbee119e8aa5e182bf19a097d3c55b7c 100644 --- a/Core/Simulation/ISimulation2D.h +++ b/Core/Simulation/ISimulation2D.h @@ -76,7 +76,7 @@ protected: //! @param re_sample Preprocessed version of our sample //! @param start Index of the first element to include into computation //! @param n_elements Number of elements to process - std::unique_ptr<IComputation> createComputation(const ProcessedSample& re_sample, size_t start, + std::unique_ptr<IComputation> createComputation(const reSample& re_sample, size_t start, size_t n_elements) override; //! Generate simulation elements for given beam diff --git a/Core/Simulation/SpecularSimulation.cpp b/Core/Simulation/SpecularSimulation.cpp index 0bbe106c924c98bfbea3d459db4fe34cf6a4f9a1..7a9bc84e07fc25def44c2f069ba830d57f9c0942 100644 --- a/Core/Simulation/SpecularSimulation.cpp +++ b/Core/Simulation/SpecularSimulation.cpp @@ -26,7 +26,7 @@ #include "Device/Histo/SimulationResult.h" #include "Param/Distrib/Distributions.h" #include "Resample/Element/SpecularElement.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" namespace { @@ -146,9 +146,8 @@ void SpecularSimulation::initElementVector() m_cache.resize(m_eles.size(), 0); } -std::unique_ptr<IComputation> -SpecularSimulation::createComputation(const ProcessedSample& re_sample, size_t start, - size_t n_elements) +std::unique_ptr<IComputation> SpecularSimulation::createComputation(const reSample& re_sample, + size_t start, size_t n_elements) { ASSERT(start < m_eles.size() && start + n_elements <= m_eles.size()); const auto& begin = m_eles.begin() + static_cast<long>(start); diff --git a/Core/Simulation/SpecularSimulation.h b/Core/Simulation/SpecularSimulation.h index 80a652cc4ebcc728f180f6211510b4c889e03f4a..0d1fb7220ffd99aa21403b12963c422edaeae2c4 100644 --- a/Core/Simulation/SpecularSimulation.h +++ b/Core/Simulation/SpecularSimulation.h @@ -68,7 +68,7 @@ private: //! @param re_sample Preprocessed version of our sample //! @param start Index of the first element to include into computation //! @param n_elements Number of elements to process - std::unique_ptr<IComputation> createComputation(const ProcessedSample& re_sample, size_t start, + std::unique_ptr<IComputation> createComputation(const reSample& re_sample, size_t start, size_t n_elements) override; void checkCache() const; diff --git a/Resample/Processed/ProcessedLayout.cpp b/Resample/Processed/ReLayout.cpp similarity index 65% rename from Resample/Processed/ProcessedLayout.cpp rename to Resample/Processed/ReLayout.cpp index d7f76747144624df0845a9ebad543a99cfdd0460..07bd894069691947d828a908106dd9a33d04fe07 100644 --- a/Resample/Processed/ProcessedLayout.cpp +++ b/Resample/Processed/ReLayout.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Resample/Processed/ProcessedLayout.cpp -//! @brief Implements class ProcessedLayout. +//! @file Resample/Processed/ReLayout.cpp +//! @brief Implements class reLayout. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,7 +12,7 @@ // // ************************************************************************************************ -#include "Resample/Processed/ProcessedLayout.h" +#include "Resample/Processed/ReLayout.h" #include "Resample/Coherence/CoherentFFSum.h" #include "Sample/Aggregate/IInterference.h" #include "Sample/Material/Admixtures.h" @@ -25,10 +25,9 @@ namespace { // class implementation // ************************************************************************************************ -ProcessedLayout::ProcessedLayout(bool polarized, double surface_density, - std::vector<std::unique_ptr<const CoherentFFSum>>&& formfactors, - const IInterference* iff, - std::map<size_t, Admixtures>&& slice2admixtures) +reLayout::reLayout(bool polarized, double surface_density, + std::vector<std::unique_ptr<const CoherentFFSum>>&& formfactors, + const IInterference* iff, std::map<size_t, Admixtures>&& slice2admixtures) : m_polarized(polarized) , m_surface_density(surface_density) , m_formfactors(std::move(formfactors)) @@ -37,6 +36,6 @@ ProcessedLayout::ProcessedLayout(bool polarized, double surface_density, { } -ProcessedLayout::ProcessedLayout(ProcessedLayout&& other) noexcept = default; +reLayout::reLayout(reLayout&& other) noexcept = default; -ProcessedLayout::~ProcessedLayout() = default; +reLayout::~reLayout() = default; diff --git a/Resample/Processed/ProcessedLayout.h b/Resample/Processed/ReLayout.h similarity index 71% rename from Resample/Processed/ProcessedLayout.h rename to Resample/Processed/ReLayout.h index 0cbda19e023c68f6a23a9365dcbd45888c3ff25a..bca28c761c6e7518341108b98234c33e6579479a 100644 --- a/Resample/Processed/ProcessedLayout.h +++ b/Resample/Processed/ReLayout.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Resample/Processed/ProcessedLayout.h -//! @brief Defines class ProcessedLayout. +//! @file Resample/Processed/ReLayout.h +//! @brief Defines class reLayout. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -17,8 +17,8 @@ #endif #ifndef USER_API -#ifndef BORNAGAIN_RESAMPLE_PROCESSED_PROCESSEDLAYOUT_H -#define BORNAGAIN_RESAMPLE_PROCESSED_PROCESSEDLAYOUT_H +#ifndef BORNAGAIN_RESAMPLE_PROCESSED_RELAYOUT_H +#define BORNAGAIN_RESAMPLE_PROCESSED_RELAYOUT_H #include <map> #include <memory> @@ -33,14 +33,14 @@ class Admixtures; //! If particles in the layout crossed the limits of the layer slices, //! these particles will be sliced themselves. -class ProcessedLayout { +class reLayout { public: - ProcessedLayout(bool polarized, double surface_density, - std::vector<std::unique_ptr<const CoherentFFSum>>&& formfactors, - const IInterference* iff, std::map<size_t, Admixtures>&& slice2admixtures); - ProcessedLayout(ProcessedLayout&& other) noexcept; + reLayout(bool polarized, double surface_density, + std::vector<std::unique_ptr<const CoherentFFSum>>&& formfactors, + const IInterference* iff, std::map<size_t, Admixtures>&& slice2admixtures); + reLayout(reLayout&& other) noexcept; - ~ProcessedLayout(); + ~reLayout(); double surfaceDensity() const { return m_surface_density; } const std::vector<std::unique_ptr<const CoherentFFSum>>& formfactorList() const @@ -58,5 +58,5 @@ private: std::map<size_t, Admixtures> m_slice2admixtures; }; -#endif // BORNAGAIN_RESAMPLE_PROCESSED_PROCESSEDLAYOUT_H +#endif // BORNAGAIN_RESAMPLE_PROCESSED_RELAYOUT_H #endif // USER_API diff --git a/Resample/Processed/ProcessedSample.cpp b/Resample/Processed/ReSample.cpp similarity index 85% rename from Resample/Processed/ProcessedSample.cpp rename to Resample/Processed/ReSample.cpp index 463742f4b30ee7f2412780fbb8aacc0b4513c963..bce816f3b8817607979981de83bed086694c196b 100644 --- a/Resample/Processed/ProcessedSample.cpp +++ b/Resample/Processed/ReSample.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Resample/Processed/ProcessedSample.cpp -//! @brief Implements class ProcessedSample. +//! @file Resample/Processed/ReSample.cpp +//! @brief Implements class reSample. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,7 +12,7 @@ // // ************************************************************************************************ -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Base/Util/Assert.h" #include "Resample/Coherence/CoherentFFSum.h" #include "Resample/Coherence/SumDWBA.h" @@ -20,7 +20,7 @@ #include "Resample/Options/SimulationOptions.h" #include "Resample/Processed/ParticleInSlice.h" #include "Resample/Processed/ParticleRegions.h" -#include "Resample/Processed/ProcessedLayout.h" +#include "Resample/Processed/ReLayout.h" #include "Resample/Processed/Slicer.h" #include "Resample/Specular/ComputeFluxMagnetic.h" #include "Resample/Specular/ComputeFluxScalar.h" @@ -104,10 +104,10 @@ void checkVolumeFractions(const Admixtures& admixtures) "total volumetric fraction of particles exceeds 1!"); } -SliceStack refineStack(const SliceStack& stack, const std::vector<ProcessedLayout>& layouts) +SliceStack refineStack(const SliceStack& stack, const std::vector<reLayout>& layouts) { SliceStack result = stack; - for (const ProcessedLayout& layout : layouts) { + for (const reLayout& layout : layouts) { for (const auto& entry : layout.regionMap()) { const size_t i_slice = entry.first; if (i_slice == 0 || i_slice == result.size() - 1) @@ -124,7 +124,7 @@ SliceStack refineStack(const SliceStack& stack, const std::vector<ProcessedLayou //! Returns a SliceStack that refines the layer structure of sample, //! taking into account the average SLD of layer material and particle decoration. //! -//! For use in ProcessedSample constructor. +//! For use in reSample constructor. SliceStack slicify(const MultiLayer& sample, const SimulationOptions& options) { @@ -159,7 +159,7 @@ SliceStack slicify(const MultiLayer& sample, const SimulationOptions& options) // top layer if (i == 0) { if (top <= 0) - throw std::runtime_error("ProcessedSample::ProcessedSample: " + throw std::runtime_error("reSample::reSample: " "top limit for top layer must be > 0."); result.addTopSlice(top, *material); // semiinfinite top slice result.addNSlices(N, top - bottom, *material); @@ -219,8 +219,8 @@ std::pair<size_t, size_t> SliceIndexSpan(const IParticle& particle, const SliceS return {top_index, bottom_index}; } -ProcessedLayout makeProcessedLayout(const ParticleLayout& layout, const SliceStack& slices, - double z_ref, bool polarized) +reLayout makereLayout(const ParticleLayout& layout, const SliceStack& slices, double z_ref, + bool polarized) { const double layout_abundance = layout.totalAbundance(); ASSERT(layout_abundance > 0); @@ -277,16 +277,16 @@ ProcessedLayout makeProcessedLayout(const ParticleLayout& layout, const SliceSta const auto* iff = layout.interferenceFunction(); - return ProcessedLayout(polarized, surface_density, std::move(formfactors), - iff ? iff->clone() : nullptr, std::move(slice2admixtures)); + return reLayout(polarized, surface_density, std::move(formfactors), + iff ? iff->clone() : nullptr, std::move(slice2admixtures)); } -//! Returns collection of all ProcessedLayout%s, for use in ProcessedSample constructor. +//! Returns collection of all reLayout%s, for use in reSample constructor. -std::vector<ProcessedLayout> collectLayouts(const MultiLayer& sample, const SliceStack& slices, - bool polarized) +std::vector<reLayout> collectLayouts(const MultiLayer& sample, const SliceStack& slices, + bool polarized) { - std::vector<ProcessedLayout> result; + std::vector<reLayout> result; double z_ref = -slices.front().zBottom(); @@ -294,7 +294,7 @@ std::vector<ProcessedLayout> collectLayouts(const MultiLayer& sample, const Slic if (i > 1) z_ref -= sample.layer(i - 1)->thickness(); for (const auto* layout : sample.layer(i)->layouts()) - result.emplace_back(makeProcessedLayout(*layout, slices, z_ref, polarized)); + result.emplace_back(makereLayout(*layout, slices, z_ref, polarized)); } return result; } @@ -306,25 +306,24 @@ std::vector<ProcessedLayout> collectLayouts(const MultiLayer& sample, const Slic // class implementation // ************************************************************************************************ -ProcessedSample ProcessedSample::make(const MultiLayer& sample, const SimulationOptions& options, - bool forcePolarized) +reSample reSample::make(const MultiLayer& sample, const SimulationOptions& options, + bool forcePolarized) { const bool polarized = forcePolarized || sample.isMagnetic() || sample.externalField() != R3(); // slices1: accounting for roughness, but not yet for particles const SliceStack slices1 = slicify(sample, options).setBField(sample.externalField()); - std::vector<ProcessedLayout> layouts = collectLayouts(sample, slices1, polarized); + std::vector<reLayout> layouts = collectLayouts(sample, slices1, polarized); const SliceStack refined_stack = options.useAvgMaterials() ? refineStack(slices1, layouts) : slices1; - return ProcessedSample(sample, polarized, std::move(layouts), refined_stack); + return reSample(sample, polarized, std::move(layouts), refined_stack); } -ProcessedSample::ProcessedSample(const MultiLayer& sample, bool polarized, - std::vector<ProcessedLayout>&& layouts, - const SliceStack& refined_stack) +reSample::reSample(const MultiLayer& sample, bool polarized, std::vector<reLayout>&& layouts, + const SliceStack& refined_stack) : m_sample(sample) , m_polarized(polarized) , m_layouts(std::move(layouts)) @@ -332,49 +331,49 @@ ProcessedSample::ProcessedSample(const MultiLayer& sample, bool polarized, { } -ProcessedSample::~ProcessedSample() = default; +reSample::~reSample() = default; -size_t ProcessedSample::numberOfSlices() const +size_t reSample::numberOfSlices() const { return m_stack.size(); } -const SliceStack& ProcessedSample::averageSlices() const +const SliceStack& reSample::averageSlices() const { return m_stack; } -const Slice& ProcessedSample::avgeSlice(size_t i) const +const Slice& reSample::avgeSlice(size_t i) const { return m_stack.at(i); } -const std::vector<ProcessedLayout>& ProcessedSample::layouts() const +const std::vector<reLayout>& reSample::layouts() const { return m_layouts; } -double ProcessedSample::sliceTopZ(size_t i) const +double reSample::sliceTopZ(size_t i) const { return m_stack.at(i).zTop(); } -double ProcessedSample::sliceBottomZ(size_t i) const +double reSample::sliceBottomZ(size_t i) const { return m_stack.at(i).zBottom(); } -bool ProcessedSample::containsMagneticMaterial() const +bool reSample::containsMagneticMaterial() const { return m_polarized; } -bool ProcessedSample::polarizing() const +bool reSample::polarizing() const { return containsMagneticMaterial() || m_sample.externalField() != R3{}; } -bool ProcessedSample::hasRoughness() const +bool reSample::hasRoughness() const { for (const auto& slice : m_stack) if (slice.topRoughness()) @@ -382,21 +381,21 @@ bool ProcessedSample::hasRoughness() const return false; } -Fluxes ProcessedSample::fluxesIn(const R3& k) const +Fluxes reSample::fluxesIn(const R3& k) const { if (m_polarized) return Compute::SpecularMagnetic::fluxes(m_stack, k, true); return Compute::SpecularScalar::fluxes(m_stack, k); } -Fluxes ProcessedSample::fluxesOut(const R3& k) const +Fluxes reSample::fluxesOut(const R3& k) const { if (m_polarized) return Compute::SpecularMagnetic::fluxes(m_stack, -k, false); return Compute::SpecularScalar::fluxes(m_stack, -k); } -double ProcessedSample::crossCorrSpectralFun(const R3 kvec, size_t j, size_t k) const +double reSample::crossCorrSpectralFun(const R3 kvec, size_t j, size_t k) const { const double xCorrLength = m_sample.crossCorrLength(); if (xCorrLength <= 0.0) diff --git a/Resample/Processed/ProcessedSample.h b/Resample/Processed/ReSample.h similarity index 69% rename from Resample/Processed/ProcessedSample.h rename to Resample/Processed/ReSample.h index 45b94e66dec10806170ebaf1ddd1e54cf469bf39..a9596c5ede56aec42568e00f132dfb1e4f613b0f 100644 --- a/Resample/Processed/ProcessedSample.h +++ b/Resample/Processed/ReSample.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Resample/Processed/ProcessedSample.h -//! @brief Defines class ProcessedSample. +//! @file Resample/Processed/ReSample.h +//! @brief Defines class reSample. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -17,8 +17,8 @@ #endif #ifndef USER_API -#ifndef BORNAGAIN_RESAMPLE_PROCESSED_PROCESSEDSAMPLE_H -#define BORNAGAIN_RESAMPLE_PROCESSED_PROCESSEDSAMPLE_H +#ifndef BORNAGAIN_RESAMPLE_PROCESSED_RESAMPLE_H +#define BORNAGAIN_RESAMPLE_PROCESSED_RESAMPLE_H #include "Resample/Slice/SliceStack.h" #include <heinz/Vectors3D.h> @@ -28,7 +28,7 @@ class IFlux; class Material; class MultiLayer; -class ProcessedLayout; +class reLayout; class SimulationOptions; using Fluxes = std::vector<std::unique_ptr<const IFlux>>; @@ -38,18 +38,18 @@ using Fluxes = std::vector<std::unique_ptr<const IFlux>>; //! If the usage of average materials is requested, layers and particles are sliced into multiple //! slices and the average material is calculated for each slice. -class ProcessedSample { +class reSample { public: //! Factory method that wraps the private constructor. - static ProcessedSample make(const MultiLayer& sample, const SimulationOptions& options, - bool forcePolarized = false); - ProcessedSample(const ProcessedSample&) = delete; - ~ProcessedSample(); + static reSample make(const MultiLayer& sample, const SimulationOptions& options, + bool forcePolarized = false); + reSample(const reSample&) = delete; + ~reSample(); size_t numberOfSlices() const; const SliceStack& averageSlices() const; const Slice& avgeSlice(size_t i) const; - const std::vector<ProcessedLayout>& layouts() const; + const std::vector<reLayout>& layouts() const; double sliceTopZ(size_t i) const; double sliceBottomZ(size_t i) const; bool containsMagneticMaterial() const; @@ -64,13 +64,13 @@ public: double crossCorrSpectralFun(R3 kvec, size_t j, size_t k) const; private: - ProcessedSample(const MultiLayer& sample, bool polarized, - std::vector<ProcessedLayout>&& layouts, const SliceStack& refined_stack); + reSample(const MultiLayer& sample, bool polarized, std::vector<reLayout>&& layouts, + const SliceStack& refined_stack); const MultiLayer& m_sample; const bool m_polarized; - std::vector<ProcessedLayout> m_layouts; // const forbidden by &&-c'tor < needed by tests + std::vector<reLayout> m_layouts; // const forbidden by &&-c'tor < needed by tests const SliceStack m_stack; }; -#endif // BORNAGAIN_RESAMPLE_PROCESSED_PROCESSEDSAMPLE_H +#endif // BORNAGAIN_RESAMPLE_PROCESSED_RESAMPLE_H #endif // USER_API diff --git a/Resample/Processed/Slicer.cpp b/Resample/Processed/Slicer.cpp index bdf50c21ca39d462f6db9a87670d4602afdceff9..83c9eef9083b183a40914732efc9badeb3a637be 100644 --- a/Resample/Processed/Slicer.cpp +++ b/Resample/Processed/Slicer.cpp @@ -94,15 +94,15 @@ ReParticle* createParticleSlice(const IBornFF* ff, ZLimits limits, const IRotati if (const auto* f = dynamic_cast<const FormFactorAnisoPyramid*>(ff)) { const SlicingEffects effects = computeSlicingEffects(limits, translation, f->height()); double dbase_edge = 2 * effects.dz_bottom * Math::cot(f->alpha()); - FormFactorAnisoPyramid slicedff( - f->length() - dbase_edge, f->width() - dbase_edge, - f->height() - effects.dz_bottom - effects.dz_top, f->alpha()); + FormFactorAnisoPyramid slicedff(f->length() - dbase_edge, f->width() - dbase_edge, + f->height() - effects.dz_bottom - effects.dz_top, + f->alpha()); return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); } else if (const auto* f = dynamic_cast<const FormFactorBox*>(ff)) { const SlicingEffects effects = computeSlicingEffects(limits, translation, f->height()); - FormFactorBox slicedff( - f->length(), f->width(), f->height() - effects.dz_bottom - effects.dz_top); + FormFactorBox slicedff(f->length(), f->width(), + f->height() - effects.dz_bottom - effects.dz_top); return ReParticle::createTransformedFormFactor(slicedff, rot, effects.position); } else if (const auto* f = dynamic_cast<const FormFactorCone*>(ff)) { diff --git a/Resample/README.dox b/Resample/README.dox index e3957c0eedeca7c7c96b50e2987a09586da6fea1..03d55c956343783e46bbdfd90c5cbcac0e09e77b 100644 --- a/Resample/README.dox +++ b/Resample/README.dox @@ -9,4 +9,4 @@ //! with exception of those in the subdirectory Resample/Swig. //! //! The classes in this directory are used by ISimulation to build -//! a restructured model of the sample, held in class ProcessedSample. +//! a restructured model of the sample, held in class reSample. diff --git a/Resample/Swig/MultiLayerFuncs.cpp b/Resample/Swig/MultiLayerFuncs.cpp index 15cf5bfa00d5f97019d1d7a0a84a719d4b7fcdd8..907fec3ed49e6d73d04a6dd5fb17bfa164168f9d 100644 --- a/Resample/Swig/MultiLayerFuncs.cpp +++ b/Resample/Swig/MultiLayerFuncs.cpp @@ -14,7 +14,7 @@ #include "Resample/Swig/MultiLayerFuncs.h" #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Resample/Slice/ProfileHelper.h" std::vector<double> swigAPI::generateZValues(int n_points, double z_min, double z_max) @@ -33,7 +33,7 @@ std::vector<complex_t> swigAPI::materialProfileSLD(const MultiLayer& multilayer, { SimulationOptions options; options.setUseAvgMaterials(true); - const ProcessedSample sample = ProcessedSample::make(multilayer, options); + const reSample sample = reSample::make(multilayer, options); ProfileHelper helper(sample.averageSlices()); std::vector<double> z_values = generateZValues(n_points, z_min, z_max); return helper.calculateProfile(z_values); @@ -43,7 +43,7 @@ std::pair<double, double> swigAPI::defaultMaterialProfileLimits(const MultiLayer { SimulationOptions options; options.setUseAvgMaterials(true); - const ProcessedSample sample = ProcessedSample::make(multilayer, options); + const reSample sample = reSample::make(multilayer, options); ProfileHelper helper(sample.averageSlices()); return helper.defaultLimits(); } diff --git a/Tests/Unit/Resample/KzComputationTest.cpp b/Tests/Unit/Resample/KzComputationTest.cpp index 8f3b628b909a917e5c20e969e245de0f474b083e..86d685298d5830d5e2bdf041d191cd86f6b404de 100644 --- a/Tests/Unit/Resample/KzComputationTest.cpp +++ b/Tests/Unit/Resample/KzComputationTest.cpp @@ -2,7 +2,7 @@ #include "Base/Const/Units.h" #include "Base/Vector/Direction.h" #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Sample/Material/MaterialFactoryFuncs.h" #include "Sample/Multilayer/Layer.h" #include "Sample/Multilayer/MultiLayer.h" @@ -35,7 +35,7 @@ TEST_F(KzComputationTest, initial) R3 k = vecOfLambdaAlphaPhi(1.0, -1.0 * Units::deg, 0.0); - const auto re_sample = ProcessedSample::make(mLayer, {}); + const auto re_sample = reSample::make(mLayer, {}); const SliceStack& slices = re_sample.averageSlices(); auto res_ref = Compute::Kz::computeReducedKz(slices, k); @@ -76,7 +76,7 @@ TEST_F(KzComputationTest, negativeKz) R3 k = vecOfLambdaAlphaPhi(1.0, -1.0 * Units::deg, 0.0); SimulationOptions options; - ProcessedSample sample = ProcessedSample::make(mLayer, options); + reSample sample = reSample::make(mLayer, options); const SliceStack& slices = sample.averageSlices(); auto res_ref = Compute::Kz::computeReducedKz(slices, k); @@ -117,7 +117,7 @@ TEST_F(KzComputationTest, absorptiveAmbience) R3 k = vecOfLambdaAlphaPhi(1.0, 1.0 * Units::deg, 0.0); SimulationOptions options; - ProcessedSample sample(ProcessedSample::make(mLayer, options)); + reSample sample(reSample::make(mLayer, options)); const SliceStack& slices = sample.averageSlices(); auto res_ri = Compute::Kz::computeKzFromRefIndices(slices, k); @@ -137,7 +137,7 @@ TEST_F(KzComputationTest, TiNiSampleWithRoughness) R3 k = vecOfLambdaAlphaPhi(1.0, 0.0001 * Units::deg, 0.0); SimulationOptions options; - const auto re_sample = ProcessedSample::make(*sample, options); + const auto re_sample = reSample::make(*sample, options); const SliceStack& slices = re_sample.averageSlices(); auto res_ri = Compute::Kz::computeKzFromRefIndices(slices, k); diff --git a/Tests/Unit/Resample/MaterialTest.cpp b/Tests/Unit/Resample/MaterialTest.cpp index 15ddd62f0d59cdbe9c54ba506c23176dd32d3b34..841da0b8669526d835205419e67c370f33a5db2d 100644 --- a/Tests/Unit/Resample/MaterialTest.cpp +++ b/Tests/Unit/Resample/MaterialTest.cpp @@ -4,7 +4,7 @@ #include "Sample/Scattering/Rotations.h" #include "Tests/GTestWrapper/google_test.h" -#include "Resample/Processed/ProcessedSample.cpp" +#include "Resample/Processed/ReSample.cpp" class MaterialTest : public ::testing::Test { }; diff --git a/Tests/Unit/Resample/MultilayerAveragingTest.cpp b/Tests/Unit/Resample/MultilayerAveragingTest.cpp index be331119fd574815e4844f72f16a1b6b1df65a12..8667dd2106a0cbf3d32f944fb6cb1aa2d97b894b 100644 --- a/Tests/Unit/Resample/MultilayerAveragingTest.cpp +++ b/Tests/Unit/Resample/MultilayerAveragingTest.cpp @@ -1,5 +1,5 @@ #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Sample/Aggregate/Interference2DLattice.h" #include "Sample/Aggregate/ParticleLayout.h" #include "Sample/HardParticle/FormFactorCylinder.h" @@ -53,7 +53,7 @@ TEST_F(MultilayerAveragingTest, AverageMultilayer) SimulationOptions opts; opts.setUseAvgMaterials(false); // of course, this makes the test rather trivial - const auto sample_1 = ProcessedSample::make(m_layer, opts); + const auto sample_1 = reSample::make(m_layer, opts); layout_1.setWeight(0.5); EXPECT_DOUBLE_EQ(layout_1.weight(), 0.5); @@ -70,7 +70,7 @@ TEST_F(MultilayerAveragingTest, AverageMultilayer) m_layer2.addLayer(layer_21); m_layer2.addLayer(layer_22); - const auto sample_2 = ProcessedSample::make(m_layer2, opts); + const auto sample_2 = reSample::make(m_layer2, opts); EXPECT_EQ(sample_1.numberOfSlices(), sample_2.numberOfSlices()); diff --git a/Tests/Unit/Resample/RTTest.cpp b/Tests/Unit/Resample/RTTest.cpp index cacc092d511c43fdc550b0c4e82c61ca9c46ea2b..17c89d66f66c59b0b07a07589d0929273a93282f 100644 --- a/Tests/Unit/Resample/RTTest.cpp +++ b/Tests/Unit/Resample/RTTest.cpp @@ -1,7 +1,7 @@ #include "Base/Math/Constants.h" #include "Resample/Flux/ScalarFlux.h" #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Resample/Specular/ComputeFluxScalar.h" #include "Sample/Aggregate/ParticleLayout.h" #include "Sample/Interface/LayerInterface.h" @@ -62,8 +62,8 @@ TEST_F(RTTest, SplitLayer) sample2.addLayer(substrate); SimulationOptions options; - const ProcessedSample sample_1 = ProcessedSample::make(sample1, options); - const ProcessedSample sample_2 = ProcessedSample::make(sample2, options); + const reSample sample_1 = reSample::make(sample1, options); + const reSample sample_2 = reSample::make(sample2, options); coeffs1 = getCoeffs(Compute::SpecularScalar::fluxes(sample_1.averageSlices(), k)); coeffs2 = getCoeffs(Compute::SpecularScalar::fluxes(sample_2.averageSlices(), k)); @@ -98,8 +98,8 @@ TEST_F(RTTest, SplitBilayers) sample2.addLayer(substrate); SimulationOptions options; - ProcessedSample sample_1 = ProcessedSample::make(sample1, options); - ProcessedSample sample_2 = ProcessedSample::make(sample2, options); + reSample sample_1 = reSample::make(sample1, options); + reSample sample_2 = reSample::make(sample2, options); coeffs1 = getCoeffs(Compute::SpecularScalar::fluxes(sample_1.averageSlices(), k)); coeffs2 = getCoeffs(Compute::SpecularScalar::fluxes(sample_2.averageSlices(), k)); @@ -139,8 +139,8 @@ TEST_F(RTTest, Overflow) sample2.addLayer(substrate); SimulationOptions options; - ProcessedSample sample_1 = ProcessedSample::make(sample1, options); - ProcessedSample sample_2 = ProcessedSample::make(sample2, options); + reSample sample_1 = reSample::make(sample1, options); + reSample sample_2 = reSample::make(sample2, options); coeffs1 = getCoeffs(Compute::SpecularScalar::fluxes(sample_1.averageSlices(), k)); coeffs2 = getCoeffs(Compute::SpecularScalar::fluxes(sample_2.averageSlices(), k)); diff --git a/Tests/Unit/Resample/SpecularMagneticTest.cpp b/Tests/Unit/Resample/SpecularMagneticTest.cpp index f2200ab1528789ba980119c64a3f1e0e38a5de23..286f577f82052f95a07644504f617a6e18542a65 100644 --- a/Tests/Unit/Resample/SpecularMagneticTest.cpp +++ b/Tests/Unit/Resample/SpecularMagneticTest.cpp @@ -1,10 +1,10 @@ -/* disabled jul21 because ProcessedSample can no longer be copied around +/* disabled jul21 because reSample can no longer be copied around anyway, too complicated, needs to be radically simplified #include "Base/Const/Units.h" #include "Base/Vector/Direction.h" #include "Resample/Options/SimulationOptions.h" -#include "Resample/Processed/ProcessedSample.h" +#include "Resample/Processed/ReSample.h" #include "Resample/Slice/KzComputation.h" #include "Resample/Specular/SpecularScalarTanhStrategy.h" #include "Resample/Specular/TransitionMagneticTanh.h" @@ -18,12 +18,12 @@ class SpecularMagneticTest : public ::testing::Test { protected: auto static constexpr eps = 1.e-10; - std::unique_ptr<const ProcessedSample> sample_zerofield(bool slab); - std::unique_ptr<const ProcessedSample> sample_degenerate(); + std::unique_ptr<const reSample> sample_zerofield(bool slab); + std::unique_ptr<const reSample> sample_degenerate(); template <typename Strategy> void test_degenerate(); template <typename Strategy> - void testZeroField(const R3& k, const ProcessedSample& sample); + void testZeroField(const R3& k, const reSample& sample); template <typename Strategy> void testcase_zerofield(std::vector<double>&& angles, bool slab = false); }; @@ -58,7 +58,7 @@ template <> void SpecularMagneticTest::test_degenerate<SpecularMagneticTanhStrat //! Compares results with scalar case template <typename Strategy> -void SpecularMagneticTest::testZeroField(const R3& k, const ProcessedSample& sample) +void SpecularMagneticTest::testZeroField(const R3& k, const reSample& sample) { const SliceStack& slices = sample.averageSlices(); auto coeffs_scalar = std::make_unique<SpecularScalarTanhStrategy>()->Execute( @@ -86,12 +86,12 @@ void SpecularMagneticTest::testZeroField(const R3& k, const ProcessedSample& sam } } -std::unique_ptr<const ProcessedSample> SpecularMagneticTest::sample_degenerate() +std::unique_ptr<const reSample> SpecularMagneticTest::sample_degenerate() { MultiLayer mLayer; Material air = HomogeneousMaterial("Vacuum", 0, 1.0); mLayer.addLayer(Layer(air, 0 * Units::nm)); - return std::make_unique<ProcessedSample>(ProcessedSample::make(mLayer, {})); + return std::make_unique<reSample>(reSample::make(mLayer, {})); } TEST_F(SpecularMagneticTest, degenerate_) @@ -99,7 +99,7 @@ TEST_F(SpecularMagneticTest, degenerate_) test_degenerate<SpecularMagneticTanhStrategy>(); } -std::unique_ptr<const ProcessedSample> SpecularMagneticTest::sample_zerofield(bool slab) +std::unique_ptr<const reSample> SpecularMagneticTest::sample_zerofield(bool slab) { MultiLayer multi_layer_scalar; Material substr_material_scalar = HomogeneousMaterial("Substrate", 7e-6, 2e-8); @@ -115,7 +115,7 @@ std::unique_ptr<const ProcessedSample> SpecularMagneticTest::sample_zerofield(bo multi_layer_scalar.addLayer(substr_layer_scalar); - return std::make_unique<ProcessedSample>(ProcessedSample::make(multi_layer_scalar, {})); + return std::make_unique<reSample>(reSample::make(multi_layer_scalar, {})); } template <typename Strategy> diff --git a/auto/Wrap/doxygenCore.i b/auto/Wrap/doxygenCore.i index a60318c51f6b4caa72934d683c5a9127e26a6a14..4ed5cfa6570365790b1b87123b117757b467d348 100644 --- a/auto/Wrap/doxygenCore.i +++ b/auto/Wrap/doxygenCore.i @@ -289,7 +289,7 @@ Controlled by the multi-threading machinery in ISimulation::runSingleSimulation( C++ includes: DepthProbeComputation.h "; -%feature("docstring") DepthProbeComputation::DepthProbeComputation "DepthProbeComputation::DepthProbeComputation(const ProcessedSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, DepthProbeElementIter begin_it, DepthProbeElementIter end_it) +%feature("docstring") DepthProbeComputation::DepthProbeComputation "DepthProbeComputation::DepthProbeComputation(const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, DepthProbeElementIter begin_it, DepthProbeElementIter end_it) "; %feature("docstring") DepthProbeComputation::~DepthProbeComputation "DepthProbeComputation::~DepthProbeComputation() override @@ -354,7 +354,7 @@ Controlled by the multi-threading machinery in ISimulation::runSingleSimulation( C++ includes: DWBAComputation.h "; -%feature("docstring") DWBAComputation::DWBAComputation "DWBAComputation::DWBAComputation(const ProcessedSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, std::vector< std::unique_ptr< DiffuseElement >>::iterator begin_it, std::vector< std::unique_ptr< DiffuseElement >>::iterator end_it) +%feature("docstring") DWBAComputation::DWBAComputation "DWBAComputation::DWBAComputation(const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, std::vector< std::unique_ptr< DiffuseElement >>::iterator begin_it, std::vector< std::unique_ptr< DiffuseElement >>::iterator end_it) "; %feature("docstring") DWBAComputation::~DWBAComputation "DWBAComputation::~DWBAComputation() override @@ -799,7 +799,7 @@ Controlled by the multi-threading machinery in ISimulation::runSingleSimulation( C++ includes: IComputation.h "; -%feature("docstring") IComputation::IComputation "IComputation::IComputation(const ProcessedSample &re_sample, const SimulationOptions &options, ProgressHandler &progress) +%feature("docstring") IComputation::IComputation "IComputation::IComputation(const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress) "; %feature("docstring") IComputation::~IComputation "IComputation::~IComputation() @@ -1378,7 +1378,7 @@ Computes the scattering contribution from one particle layout. Instances are cre C++ includes: ParticleLayoutContribution.h "; -%feature("docstring") ParticleLayoutContribution::ParticleLayoutContribution "ParticleLayoutContribution::ParticleLayoutContribution(const ProcessedLayout &re_layout, const SimulationOptions &options, bool polarized) +%feature("docstring") ParticleLayoutContribution::ParticleLayoutContribution "ParticleLayoutContribution::ParticleLayoutContribution(const reLayout &re_layout, const SimulationOptions &options, bool polarized) "; %feature("docstring") ParticleLayoutContribution::~ParticleLayoutContribution "ParticleLayoutContribution::~ParticleLayoutContribution() @@ -1682,7 +1682,7 @@ Computes the diffuse reflection from the rough interfaces of a multilayer. Used C++ includes: RoughMultiLayerContribution.h "; -%feature("docstring") RoughMultiLayerContribution::RoughMultiLayerContribution "RoughMultiLayerContribution::RoughMultiLayerContribution(const ProcessedSample &re_sample) +%feature("docstring") RoughMultiLayerContribution::RoughMultiLayerContribution "RoughMultiLayerContribution::RoughMultiLayerContribution(const reSample &re_sample) "; %feature("docstring") RoughMultiLayerContribution::compute "void RoughMultiLayerContribution::compute(DiffuseElement &ele) const @@ -1886,7 +1886,7 @@ Controlled by the multi-threading machinery in ISimulation::runSingleSimulation( C++ includes: SpecularComputation.h "; -%feature("docstring") SpecularComputation::SpecularComputation "SpecularComputation::SpecularComputation(const ProcessedSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, SpecularElementIter begin_it, SpecularElementIter end_it) +%feature("docstring") SpecularComputation::SpecularComputation "SpecularComputation::SpecularComputation(const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, SpecularElementIter begin_it, SpecularElementIter end_it) "; %feature("docstring") SpecularComputation::~SpecularComputation "SpecularComputation::~SpecularComputation() override diff --git a/auto/Wrap/doxygenResample.i b/auto/Wrap/doxygenResample.i index 216cd1b5932f1afca01214a57190d5b1470a421a..df49a8090fe2ae0dbb9c5cf5f1f08c2f4b12dfb8 100644 --- a/auto/Wrap/doxygenResample.i +++ b/auto/Wrap/doxygenResample.i @@ -345,98 +345,6 @@ C++ includes: ParticleInSlice.h "; -// File: classProcessedLayout.xml -%feature("docstring") ProcessedLayout " - -Data structure that contains preprocessed data for a single layout. - -If particles in the layout crossed the limits of the layer slices, these particles will be sliced themselves. - -C++ includes: ProcessedLayout.h -"; - -%feature("docstring") ProcessedLayout::ProcessedLayout "ProcessedLayout::ProcessedLayout(bool polarized, double surface_density, std::vector< std::unique_ptr< const CoherentFFSum >> &&formfactors, const IInterference *iff, std::map< size_t, Admixtures > &&slice2admixtures) -"; - -%feature("docstring") ProcessedLayout::ProcessedLayout "ProcessedLayout::ProcessedLayout(ProcessedLayout &&other) noexcept -"; - -%feature("docstring") ProcessedLayout::~ProcessedLayout "ProcessedLayout::~ProcessedLayout() -"; - -%feature("docstring") ProcessedLayout::surfaceDensity "double ProcessedLayout::surfaceDensity() const -"; - -%feature("docstring") ProcessedLayout::formfactorList "const std::vector<std::unique_ptr<const CoherentFFSum> >& ProcessedLayout::formfactorList() const -"; - -%feature("docstring") ProcessedLayout::interferenceFunction "const IInterference* ProcessedLayout::interferenceFunction() const -"; - -%feature("docstring") ProcessedLayout::regionMap "const std::map<size_t, Admixtures>& ProcessedLayout::regionMap() const -"; - - -// File: classProcessedSample.xml -%feature("docstring") ProcessedSample " - -Data structure that contains all the necessary data for scattering calculations. - -If the usage of average materials is requested, layers and particles are sliced into multiple slices and the average material is calculated for each slice. - -C++ includes: ProcessedSample.h -"; - -%feature("docstring") ProcessedSample::ProcessedSample "ProcessedSample::ProcessedSample(const ProcessedSample &)=delete -"; - -%feature("docstring") ProcessedSample::~ProcessedSample "ProcessedSample::~ProcessedSample() -"; - -%feature("docstring") ProcessedSample::numberOfSlices "size_t ProcessedSample::numberOfSlices() const -"; - -%feature("docstring") ProcessedSample::averageSlices "const SliceStack & ProcessedSample::averageSlices() const -"; - -%feature("docstring") ProcessedSample::avgeSlice "const Slice & ProcessedSample::avgeSlice(size_t i) const -"; - -%feature("docstring") ProcessedSample::layouts "const std::vector< ProcessedLayout > & ProcessedSample::layouts() const -"; - -%feature("docstring") ProcessedSample::sliceTopZ "double ProcessedSample::sliceTopZ(size_t i) const -"; - -%feature("docstring") ProcessedSample::sliceBottomZ "double ProcessedSample::sliceBottomZ(size_t i) const -"; - -%feature("docstring") ProcessedSample::containsMagneticMaterial "bool ProcessedSample::containsMagneticMaterial() const -"; - -%feature("docstring") ProcessedSample::polarizing "bool ProcessedSample::polarizing() const - -Contains magnetic material, or nonzero magnetic field. -"; - -%feature("docstring") ProcessedSample::hasRoughness "bool ProcessedSample::hasRoughness() const -"; - -%feature("docstring") ProcessedSample::sample "const MultiLayer& ProcessedSample::sample() const -"; - -%feature("docstring") ProcessedSample::fluxesIn "Fluxes ProcessedSample::fluxesIn(const R3 &k) const -"; - -%feature("docstring") ProcessedSample::fluxesOut "Fluxes ProcessedSample::fluxesOut(const R3 &k) const -"; - -%feature("docstring") ProcessedSample::crossCorrSpectralFun "double ProcessedSample::crossCorrSpectralFun(R3 kvec, size_t j, size_t k) const - -Fourier transform of the correlation function of roughnesses between the interfaces. -"; - - // File: classProfileHelper.xml %feature("docstring") ProfileHelper " @@ -559,6 +467,38 @@ Calculates and returns a polarized form factor calculation in DWBA. "; +// File: classreLayout.xml +%feature("docstring") reLayout " + +Data structure that contains preprocessed data for a single layout. + +If particles in the layout crossed the limits of the layer slices, these particles will be sliced themselves. + +C++ includes: ReLayout.h +"; + +%feature("docstring") reLayout::reLayout "reLayout::reLayout(bool polarized, double surface_density, std::vector< std::unique_ptr< const CoherentFFSum >> &&formfactors, const IInterference *iff, std::map< size_t, Admixtures > &&slice2admixtures) +"; + +%feature("docstring") reLayout::reLayout "reLayout::reLayout(reLayout &&other) noexcept +"; + +%feature("docstring") reLayout::~reLayout "reLayout::~reLayout() +"; + +%feature("docstring") reLayout::surfaceDensity "double reLayout::surfaceDensity() const +"; + +%feature("docstring") reLayout::formfactorList "const std::vector<std::unique_ptr<const CoherentFFSum> >& reLayout::formfactorList() const +"; + +%feature("docstring") reLayout::interferenceFunction "const IInterference* reLayout::interferenceFunction() const +"; + +%feature("docstring") reLayout::regionMap "const std::map<size_t, Admixtures>& reLayout::regionMap() const +"; + + // File: classReMesocrystal.xml %feature("docstring") ReMesocrystal " @@ -682,6 +622,66 @@ Returns the z-coordinate of the lowest point in this shape after a given rotatio "; +// File: classreSample.xml +%feature("docstring") reSample " + +Data structure that contains all the necessary data for scattering calculations. + +If the usage of average materials is requested, layers and particles are sliced into multiple slices and the average material is calculated for each slice. + +C++ includes: ReSample.h +"; + +%feature("docstring") reSample::reSample "reSample::reSample(const reSample &)=delete +"; + +%feature("docstring") reSample::~reSample "reSample::~reSample() +"; + +%feature("docstring") reSample::numberOfSlices "size_t reSample::numberOfSlices() const +"; + +%feature("docstring") reSample::averageSlices "const SliceStack & reSample::averageSlices() const +"; + +%feature("docstring") reSample::avgeSlice "const Slice & reSample::avgeSlice(size_t i) const +"; + +%feature("docstring") reSample::layouts "const std::vector< reLayout > & reSample::layouts() const +"; + +%feature("docstring") reSample::sliceTopZ "double reSample::sliceTopZ(size_t i) const +"; + +%feature("docstring") reSample::sliceBottomZ "double reSample::sliceBottomZ(size_t i) const +"; + +%feature("docstring") reSample::containsMagneticMaterial "bool reSample::containsMagneticMaterial() const +"; + +%feature("docstring") reSample::polarizing "bool reSample::polarizing() const + +Contains magnetic material, or nonzero magnetic field. +"; + +%feature("docstring") reSample::hasRoughness "bool reSample::hasRoughness() const +"; + +%feature("docstring") reSample::sample "const MultiLayer& reSample::sample() const +"; + +%feature("docstring") reSample::fluxesIn "Fluxes reSample::fluxesIn(const R3 &k) const +"; + +%feature("docstring") reSample::fluxesOut "Fluxes reSample::fluxesOut(const R3 &k) const +"; + +%feature("docstring") reSample::crossCorrSpectralFun "double reSample::crossCorrSpectralFun(R3 kvec, size_t j, size_t k) const + +Fourier transform of the correlation function of roughnesses between the interfaces. +"; + + // File: classScalarFlux.xml %feature("docstring") ScalarFlux " @@ -1265,16 +1265,16 @@ Get default z limits for generating a material profile. // File: ParticleRegions_8h.xml -// File: ProcessedLayout_8cpp.xml +// File: ReLayout_8cpp.xml -// File: ProcessedLayout_8h.xml +// File: ReLayout_8h.xml -// File: ProcessedSample_8cpp.xml +// File: ReSample_8cpp.xml -// File: ProcessedSample_8h.xml +// File: ReSample_8h.xml // File: Slicer_8cpp.xml