diff --git a/Core/Algorithms/inc/MultiLayerRTCoefficients.h b/Core/Algorithms/inc/MultiLayerRTCoefficients.h new file mode 100644 index 0000000000000000000000000000000000000000..1da3966da51a68986f19e61c6d774b16119e278d --- /dev/null +++ b/Core/Algorithms/inc/MultiLayerRTCoefficients.h @@ -0,0 +1,38 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file Algorithms/inc/MultiLayerRTCoefficients.h +//! @brief Defines class MultiLayerRTCoefficients. +//! +//! @homepage http://apps.jcns.fz-juelich.de/BornAgain +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2013 +//! @authors Scientific Computing Group at MLZ Garching +//! @authors C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke +// +// ************************************************************************** // + +#ifndef MULTILAYERRTCOEFFICIENTS_H +#define MULTILAYERRTCOEFFICIENTS_H + +#include "ILayerRTCoefficients.h" + +//! @class MultiLayerRTCoefficients +//! @ingroup algorithms_internal +//! @brief Container to hold matrix or scalar RT coefficients for a multilayer. + +class BA_CORE_API_ MultiLayerRTCoefficients +{ +public: + ~MultiLayerRTCoefficients(); + ILayerRTCoefficients* operator[](size_t i) { return m_data[i]; } + const ILayerRTCoefficients* operator[](size_t i) const { return m_data[i]; } + size_t size() const { return m_data.size(); } + void clear() { m_data.clear(); } + void resize(size_t size) { m_data.resize(size); } +private: + std::vector<ILayerRTCoefficients *> m_data; +}; + +#endif diff --git a/Core/Algorithms/inc/SpecularSimulation.h b/Core/Algorithms/inc/SpecularSimulation.h new file mode 100644 index 0000000000000000000000000000000000000000..14fe1be10d5e86238db3a9923a44ccbe43226e8a --- /dev/null +++ b/Core/Algorithms/inc/SpecularSimulation.h @@ -0,0 +1,97 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file Algorithms/inc/SpecularSimulation.h +//! @brief Defines class SpecularSimulation. +//! +//! @homepage http://apps.jcns.fz-juelich.de/BornAgain +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2013 +//! @authors Scientific Computing Group at MLZ Garching +//! @authors C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke +// +// ************************************************************************** // + +#ifndef SPECULARSIMULATION_H +#define SPECULARSIMULATION_H + +#include "Simulation.h" +//#include "MultiLayerRTCoefficients.h" +#include "OutputData.h" + +#ifndef GCCXML_SKIP_THIS +#include "SpecularMatrix.h" +#endif +#include <vector> + + +//! @class SpecularSimulation +//! @ingroup simulation +//! @brief Main class to run a specular simulation. + +class BA_CORE_API_ SpecularSimulation : public ICloneable, public IParameterized +{ +public: + SpecularSimulation(); + SpecularSimulation(const ISample& sample); + SpecularSimulation(SampleBuilder_t sample_builder); + ~SpecularSimulation(); + + SpecularSimulation *clone() const; + + //! Put into a clean state for running a simulation + void prepareSimulation(); + + //! Run a simulation with the current parameter settings + void runSimulation(); + + //! Sets the sample to be tested + void setSample(const ISample& sample); + + //! Returns the sample + ISample *getSample() const; + + //! Sets the sample builder + void setSampleBuilder(SampleBuilder_t sample_builder); + + //! return sample builder + SampleBuilder_t getSampleBuilder() const; + + //! Sets beam parameters from + void setBeamParameters(double lambda, const IAxis &alpha_axis); + + //! returns alpha_i axis + const IAxis *getAlphaAxis() const; + + //! returns vector containing reflection coefficients for all alpha_i angles for given layer index + std::vector<complex_t > getScalarR(int i_layer = 0) const; + + //! returns vector containing reflection coefficients for all alpha_i angles for given layer index + std::vector<complex_t > getScalarT(int i_layer = 0) const; + +protected: + SpecularSimulation(const SpecularSimulation& other); + + //! Registers some class members for later access via parameter pool + void init_parameters(); + + //! Update the sample by calling the sample builder, if present + void updateSample(); + + //! calculates RT coefficients + void collectRTCoefficientsScalar(); + + ISample *m_sample; + SampleBuilder_t m_sample_builder; + IAxis *m_alpha_i_axis; + double m_lambda; + +// OutputData<MultiLayerRTCoefficients> m_data; +#ifndef GCCXML_SKIP_THIS + OutputData<SpecularMatrix::MultiLayerCoeff_t> *m_scalar_data; +#endif +}; + + +#endif diff --git a/Core/Algorithms/src/MultiLayerRTCoefficients.cpp b/Core/Algorithms/src/MultiLayerRTCoefficients.cpp new file mode 100644 index 0000000000000000000000000000000000000000..58ee9829ae2646625620a49531b853f22d50fb34 --- /dev/null +++ b/Core/Algorithms/src/MultiLayerRTCoefficients.cpp @@ -0,0 +1,10 @@ +#include "MultiLayerRTCoefficients.h" + + + +MultiLayerRTCoefficients::~MultiLayerRTCoefficients() +{ + for(std::vector<ILayerRTCoefficients *>::iterator it = m_data.begin(); it!= m_data.end(); ++it) { + delete (*it); + } +} diff --git a/Core/Algorithms/src/SpecularSimulation.cpp b/Core/Algorithms/src/SpecularSimulation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..482dabab6c58f78e5958405b21f66c8e9c10c591 --- /dev/null +++ b/Core/Algorithms/src/SpecularSimulation.cpp @@ -0,0 +1,260 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file Algorithms/src/OffSpecSimulation.cpp +//! @brief Implements class OffSpecSimulation. +//! +//! @homepage http://apps.jcns.fz-juelich.de/BornAgain +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2013 +//! @authors Scientific Computing Group at MLZ Garching +//! @authors C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke +// +// ************************************************************************** // + +#include "SpecularSimulation.h" +#include "MultiLayer.h" +#include "SpecularMatrix.h" + + +SpecularSimulation::SpecularSimulation() + : IParameterized("SpecularSimulation") + , m_sample(0) + , m_alpha_i_axis(0) + , m_lambda(0.0) + , m_scalar_data(0) +{ + init_parameters(); +} + + +SpecularSimulation::SpecularSimulation(const ISample& sample) + : IParameterized("SpecularSimulation") + , m_sample(sample.clone()) + , m_alpha_i_axis(0) + , m_lambda(0.0) + , m_scalar_data(0) +{ + init_parameters(); +} + + +SpecularSimulation::SpecularSimulation(SampleBuilder_t sample_builder) + : IParameterized("SpecularSimulation") + , m_sample(0) + , m_sample_builder(sample_builder) + , m_alpha_i_axis(0) + , m_lambda(0.0) + , m_scalar_data(0) +{ + init_parameters(); +} + + +SpecularSimulation::~SpecularSimulation() +{ + delete m_sample; + delete m_alpha_i_axis; + delete m_scalar_data; +} + + +SpecularSimulation* SpecularSimulation::clone() const +{ + return new SpecularSimulation(*this); +} + + +void SpecularSimulation::setSample(const ISample &sample) +{ + delete m_sample; + m_sample = sample.clone(); +} + + +ISample *SpecularSimulation::getSample() const +{ + return m_sample; +} + + +void SpecularSimulation::setSampleBuilder(SampleBuilder_t sample_builder) +{ + if( !sample_builder.get() ) + throw NullPointerException( + "SpecularSimulation::setSampleBuilder() -> " + "Error! Attempt to set null sample builder."); + + m_sample_builder = sample_builder; + delete m_sample; + m_sample = 0; +} + + +SampleBuilder_t SpecularSimulation::getSampleBuilder() const +{ + return m_sample_builder; +} + + +void SpecularSimulation::prepareSimulation() +{ + if (!m_alpha_i_axis || m_alpha_i_axis->getSize()<1) { + throw ClassInitializationException( + "SpecularSimulation::prepareSimulation() " + "-> Error. Incoming alpha range not configured."); + } + if (m_lambda<=0.0) { + throw ClassInitializationException( + "SpecularSimulation::prepareSimulation() " + "-> Error. Incoming wavelength < 0."); + } + updateSample(); + + std::cout << "xxx 1.1" << std::endl; + collectRTCoefficientsScalar(); +} + + +void SpecularSimulation::updateSample() +{ + if (m_sample_builder.get()) { + ISample *new_sample = m_sample_builder->buildSample(); + std::string builder_type = typeid(*m_sample_builder).name(); + if( builder_type.find("ISampleBuilder_wrapper") != std::string::npos ) { + setSample(*new_sample); + } else { + delete m_sample; + m_sample = new_sample; + } + } +} + + +void SpecularSimulation::collectRTCoefficientsScalar() +{ + if(!m_sample) + throw RuntimeErrorException("SpecularSimulation::collectRTCoefficientsScalar() -> Error. No sample defined"); + + std::cout << "xxx 1.2" << std::endl; + MultiLayer *multilayer = dynamic_cast<MultiLayer *>(m_sample); + if(!multilayer) + throw RuntimeErrorException("SpecularSimulation::collectRTCoefficientsScalar() -> Error. Not a multilayer"); + + std::cout << "xxx 1.3" << std::endl; + delete m_scalar_data; + m_scalar_data = new OutputData<SpecularMatrix::MultiLayerCoeff_t>(); + + m_scalar_data->addAxis(*m_alpha_i_axis); + + std::cout << "xxx 1.4" << std::endl; + + OutputData<SpecularMatrix::MultiLayerCoeff_t>::iterator it = m_scalar_data->begin(); +// OutputData<MultiLayerRTCoefficients>::iterator it = m_data.begin(); + while (it != m_scalar_data->end()) { + double alpha_i = m_scalar_data->getValueOfAxis(0,it.getIndex()); + kvector_t kvec; + kvec.setLambdaAlphaPhi(m_lambda, -alpha_i, 0.0); + + SpecularMatrix::MultiLayerCoeff_t coeffs; + SpecularMatrix matrixCalculator; + matrixCalculator.execute(*multilayer, kvec, coeffs); + + *it = coeffs; + ++it; + + } // alpha_i + + +// m_multilayer_specular_info.clear(); + +// MultiLayer *multilayer = dynamic_cast<MultiLayer *>(m_sample); + +// if(!multilayer) +// throw RuntimeErrorException("SpecularSimulation::collectRTCoefficientsScalar() -> Error. Not a multilayer"); + +// for(size_t i_layer=0; +// i_layer<multilayer->getNumberOfLayers(); ++i_layer) { +// LayerSpecularInfo *layer_coeff_map = new LayerSpecularInfo(); +// ScalarSpecularInfoMap *p_coeff_map = new ScalarSpecularInfoMap( +// multilayer, i_layer, m_lambda); +// layer_coeff_map->addOutCoefficients(p_coeff_map); + +// m_multilayer_specular_info.push_back(layer_coeff_map); +// } +} + + +void SpecularSimulation::runSimulation() +{ + prepareSimulation(); + +} + + +void SpecularSimulation::setBeamParameters(double lambda, const IAxis &alpha_axis) +{ + delete m_alpha_i_axis; + m_alpha_i_axis = alpha_axis.clone(); + if (alpha_axis.getSize()<1) { + throw ClassInitializationException( + "SpecularSimulation::prepareSimulation() " + "-> Error. Incoming alpha range size < 1."); + } + m_lambda = lambda; +} + +const IAxis *SpecularSimulation::getAlphaAxis() const +{ + return m_alpha_i_axis; +} + + +std::vector<complex_t > SpecularSimulation::getScalarR(int i_layer) const +{ + if(!m_scalar_data) + throw RuntimeErrorException("SpecularSimulation::getScalarR() -> Error. No scalar coefficients."); + + std::vector<complex_t > result; + result.resize(m_alpha_i_axis->getSize()); + for(size_t i=0; i<m_scalar_data->getAllocatedSize(); ++i) { + result[i] = (*m_scalar_data)[i][i_layer].getScalarR(); + } + return result; +} + + +std::vector<complex_t > SpecularSimulation::getScalarT(int i_layer) const +{ + if(!m_scalar_data) + throw RuntimeErrorException("SpecularSimulation::getScalarR() -> Error. No scalar coefficients."); + + std::vector<complex_t > result; + result.resize(m_alpha_i_axis->getSize()); + for(size_t i=0; i<m_scalar_data->getAllocatedSize(); ++i) { + result[i] = (*m_scalar_data)[i][i_layer].getScalarT(); + } + return result; +} + + +SpecularSimulation::SpecularSimulation(const SpecularSimulation& other) + : ICloneable(), IParameterized(other) + , m_sample(0) + , m_sample_builder(other.m_sample_builder) + , m_lambda(other.m_lambda) +{ + if(other.m_sample) m_sample = other.m_sample->clone(); + if(other.m_alpha_i_axis) m_alpha_i_axis = other.m_alpha_i_axis->clone(); + if(other.m_scalar_data) m_scalar_data = other.m_scalar_data->clone(); + + init_parameters(); +} + + +void SpecularSimulation::init_parameters() +{ + +} + diff --git a/Core/PythonAPI/inc/PythonCoreExposer.h b/Core/PythonAPI/inc/PythonCoreExposer.h index 8f5a01e649f78bced94b9a9a19f300bd332e7c23..2d1b58079aa759c51a2485388efc1802c9b28aee 100644 --- a/Core/PythonAPI/inc/PythonCoreExposer.h +++ b/Core/PythonAPI/inc/PythonCoreExposer.h @@ -37,6 +37,7 @@ namespace pyplusplus { typedef OutputData<double > IntensityData; typedef std::vector<int > vector_integer_t; typedef std::vector<unsigned long int > vector_longinteger_t; + typedef std::vector<complex_t> vector_complex_t; } } @@ -57,6 +58,7 @@ namespace pyplusplus { inline size_t pyplusplus_boost_vector_integer() { return sizeof(pyplusplus::aliases::vector_integer_t); } inline size_t pyplusplus_boost_vector_longinteger() { return sizeof(pyplusplus::aliases::vector_longinteger_t); } inline size_t pyplusplus_boost_intensity_data() { return sizeof(pyplusplus::aliases::IntensityData); } + inline size_t pyplusplus_boost_vector_complex() { return sizeof(pyplusplus::aliases::vector_complex_t); } } #endif // PYTHONCOREEXPOSER_H diff --git a/Core/PythonAPI/inc/PythonCoreList.h b/Core/PythonAPI/inc/PythonCoreList.h index be99aa4f10ba2fcf24e31d3a9dbe8b6d5a485f87..cb8e6c517b21c44e093c1a25d6017942b32574d7 100644 --- a/Core/PythonAPI/inc/PythonCoreList.h +++ b/Core/PythonAPI/inc/PythonCoreList.h @@ -95,6 +95,7 @@ #include "PythonOutputData.h" #include "RealParameterWrapper.h" #include "ResolutionFunction2DGaussian.h" +#include "SpecularSimulation.h" #include "Simulation.h" #include "SimulationParameters.h" #include "ThreadInfo.h" diff --git a/Core/PythonAPI/inc/SpecularSimulation.pypp.h b/Core/PythonAPI/inc/SpecularSimulation.pypp.h new file mode 100644 index 0000000000000000000000000000000000000000..db7d944b6e80c7d2a11e02577b884046b623ed3d --- /dev/null +++ b/Core/PythonAPI/inc/SpecularSimulation.pypp.h @@ -0,0 +1,11 @@ +// This file has been generated by Py++. + +// BornAgain: simulate and fit scattering at grazing incidence +//! @brief Automatically generated boost::python code for PythonCoreAPI + +#ifndef SpecularSimulation_hpp__pyplusplus_wrapper +#define SpecularSimulation_hpp__pyplusplus_wrapper + +void register_SpecularSimulation_class(); + +#endif//SpecularSimulation_hpp__pyplusplus_wrapper diff --git a/Core/PythonAPI/inc/vector_complex_t.pypp.h b/Core/PythonAPI/inc/vector_complex_t.pypp.h new file mode 100644 index 0000000000000000000000000000000000000000..05cc139373a5943559374a82e45bb5eeb73408c7 --- /dev/null +++ b/Core/PythonAPI/inc/vector_complex_t.pypp.h @@ -0,0 +1,11 @@ +// This file has been generated by Py++. + +// BornAgain: simulate and fit scattering at grazing incidence +//! @brief Automatically generated boost::python code for PythonCoreAPI + +#ifndef vector_complex_t_hpp__pyplusplus_wrapper +#define vector_complex_t_hpp__pyplusplus_wrapper + +void register_vector_complex_t_class(); + +#endif//vector_complex_t_hpp__pyplusplus_wrapper diff --git a/Core/PythonAPI/src/PythonModule.cpp b/Core/PythonAPI/src/PythonModule.cpp index 8ebc8fbd07a44d8e224b4d3d710970612411f5e9..3631eb0d83bd6f1f12fc1133bb7f37ceec98651b 100644 --- a/Core/PythonAPI/src/PythonModule.cpp +++ b/Core/PythonAPI/src/PythonModule.cpp @@ -10,127 +10,129 @@ GCC_DIAG_ON(missing-field-initializers) #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY #include "numpy/arrayobject.h" -#include "FormFactorFullSpheroid.pypp.h" -#include "DistributionGate.pypp.h" -#include "SimpleSelectionRule.pypp.h" -#include "RealParameterWrapper.pypp.h" -#include "vdouble1d_t.pypp.h" +#include "FormFactorFullSphere.pypp.h" +#include "Lattice.pypp.h" +#include "FormFactorInfLongBox.pypp.h" +#include "Layer.pypp.h" +#include "FormFactorHemiEllipsoid.pypp.h" +#include "FormFactorPrism3.pypp.h" #include "SimulationParameters.pypp.h" -#include "Transform3D.pypp.h" -#include "ThreadInfo.pypp.h" -#include "InterferenceFunction2DLattice.pypp.h" -#include "LayerInterface.pypp.h" -#include "ILayout.pypp.h" -#include "FormFactorCone6.pypp.h" -#include "FormFactorTetrahedron.pypp.h" -#include "FTDistribution1DCosine.pypp.h" -#include "FTDistribution1DTriangle.pypp.h" -#include "FormFactorWeighted.pypp.h" -#include "DistributionGaussian.pypp.h" -#include "IDetectorResolution.pypp.h" -#include "FormFactorCylinder.pypp.h" -#include "Crystal.pypp.h" -#include "FTDistribution1DCauchy.pypp.h" -#include "IFormFactorBorn.pypp.h" -#include "FormFactorEllipsoidalCylinder.pypp.h" -#include "InterferenceFunctionNone.pypp.h" -#include "FTDistribution2DGate.pypp.h" +#include "FormFactorInfLongRipple1.pypp.h" +#include "FTDistribution1DVoigt.pypp.h" +#include "FormFactorRipple1.pypp.h" +#include "ParticleInfo.pypp.h" +#include "ICompositeSample.pypp.h" +#include "OffSpecSimulation.pypp.h" +#include "IResolutionFunction2D.pypp.h" #include "vector_kvector_t.pypp.h" -#include "FormFactorTruncatedSpheroid.pypp.h" -#include "Particle.pypp.h" -#include "FormFactorTrivial.pypp.h" -#include "ConstKBinAxis.pypp.h" -#include "FTDistribution2DCauchy.pypp.h" -#include "FormFactorCrystal.pypp.h" -#include "vector_longinteger_t.pypp.h" -#include "ResolutionFunction2DGaussian.pypp.h" -#include "FTDistribution1DGauss.pypp.h" #include "FTDistribution1DGate.pypp.h" -#include "FormFactorAnisoPyramid.pypp.h" -#include "FixedBinAxis.pypp.h" -#include "MultiLayer.pypp.h" -#include "IFormFactor.pypp.h" -#include "kvector_t.pypp.h" -#include "FormFactorSphereUniformRadius.pypp.h" -#include "OffSpecSimulation.pypp.h" -#include "FormFactorRipple1.pypp.h" +#include "LatticeBasis.pypp.h" +#include "FormFactorRipple2.pypp.h" +#include "FTDistribution2DVoigt.pypp.h" +#include "IFormFactorBorn.pypp.h" +#include "FormFactorPyramid.pypp.h" +#include "ISample.pypp.h" +#include "ILayout.pypp.h" +#include "FormFactorTetrahedron.pypp.h" #include "InterferenceFunction1DParaCrystal.pypp.h" #include "Simulation.pypp.h" +#include "ParticleLayout.pypp.h" +#include "FTDistribution2DCone.pypp.h" +#include "FormFactorEllipsoidalCylinder.pypp.h" +#include "vector_IFormFactorPtr_t.pypp.h" +#include "FTDistribution1DGauss.pypp.h" +#include "HomogeneousMaterial.pypp.h" +#include "cvector_t.pypp.h" +#include "FTDistribution2DGauss.pypp.h" #include "IObservable.pypp.h" +#include "FormFactorBox.pypp.h" +#include "DistributionLogNormal.pypp.h" +#include "FormFactorCylinder.pypp.h" +#include "Detector.pypp.h" +#include "IObserver.pypp.h" +#include "ResolutionFunction2DGaussian.pypp.h" +#include "IParameterized.pypp.h" +#include "FormFactorGauss.pypp.h" +#include "FormFactorDecoratorDebyeWaller.pypp.h" +#include "IDetectorResolution.pypp.h" +#include "FormFactorWeighted.pypp.h" +#include "InterferenceFunction2DLattice.pypp.h" +#include "RealParameterWrapper.pypp.h" +#include "LayerInterface.pypp.h" +#include "ParticleCoreShell.pypp.h" +#include "InterferenceFunction1DLattice.pypp.h" +#include "FormFactorCrystal.pypp.h" +#include "Instrument.pypp.h" +#include "PythonInterface_global_variables.pypp.h" +#include "IFTDistribution1D.pypp.h" +#include "FormFactorTrivial.pypp.h" +#include "DistributionGaussian.pypp.h" +#include "Lattice1DIFParameters.pypp.h" +#include "DistributionCosine.pypp.h" +#include "IClusteredParticles.pypp.h" #include "FormFactorLorentz.pypp.h" -#include "ISelectionRule.pypp.h" -#include "FormFactorRipple2.pypp.h" -#include "LayerRoughness.pypp.h" #include "Bin1DCVector.pypp.h" -#include "FormFactorSphereGaussianRadius.pypp.h" -#include "ParameterPool.pypp.h" -#include "FormFactorPrism3.pypp.h" +#include "InterferenceFunctionNone.pypp.h" +#include "IFormFactorDecorator.pypp.h" +#include "Bin1D.pypp.h" +#include "ISampleBuilder.pypp.h" +#include "IntensityDataIOFactory.pypp.h" +#include "FTDistribution2DGate.pypp.h" +#include "FormFactorInfLongRipple2.pypp.h" #include "IMaterial.pypp.h" -#include "FTDistribution1DVoigt.pypp.h" -#include "IntensityDataFunctions.pypp.h" -#include "FormFactorPrism6.pypp.h" -#include "IClusteredParticles.pypp.h" -#include "VariableBinAxis.pypp.h" +#include "InterferenceFunction2DParaCrystal.pypp.h" +#include "Particle.pypp.h" +#include "FormFactorTruncatedSpheroid.pypp.h" +#include "MesoCrystal.pypp.h" +#include "ParticleCollection.pypp.h" +#include "FTDistribution2DCauchy.pypp.h" +#include "IInterferenceFunction.pypp.h" +#include "FTDistribution1DCosine.pypp.h" #include "IParticle.pypp.h" -#include "DistributionCosine.pypp.h" -#include "FormFactorHemiEllipsoid.pypp.h" +#include "FTDistribution1DTriangle.pypp.h" +#include "FormFactorPrism6.pypp.h" +#include "HomogeneousMagneticMaterial.pypp.h" +#include "FormFactorFullSpheroid.pypp.h" +#include "Transform3D.pypp.h" +#include "IntensityData.pypp.h" +#include "DistributionGate.pypp.h" +#include "ThreadInfo.pypp.h" #include "IAxis.pypp.h" -#include "vector_integer_t.pypp.h" -#include "IntensityDataIOFactory.pypp.h" -#include "ParameterDistribution.pypp.h" -#include "Layer.pypp.h" -#include "FormFactorPyramid.pypp.h" #include "CustomBinAxis.pypp.h" -#include "FTDistribution2DCone.pypp.h" -#include "IFTDistribution1D.pypp.h" -#include "DistributionLorentz.pypp.h" -#include "IDistribution1D.pypp.h" -#include "HomogeneousMagneticMaterial.pypp.h" -#include "FormFactorCuboctahedron.pypp.h" -#include "cvector_t.pypp.h" +#include "FormFactorCone6.pypp.h" +#include "ICloneable.pypp.h" #include "PythonInterface_free_functions.pypp.h" +#include "vector_longinteger_t.pypp.h" #include "FormFactorSphereLogNormalRadius.pypp.h" -#include "FormFactorInfLongRipple1.pypp.h" -#include "IResolutionFunction2D.pypp.h" -#include "vector_IFormFactorPtr_t.pypp.h" -#include "FormFactorFullSphere.pypp.h" -#include "ParticleLayout.pypp.h" -#include "FormFactorBox.pypp.h" -#include "IParameterized.pypp.h" -#include "Lattice2DIFParameters.pypp.h" -#include "IFormFactorDecorator.pypp.h" -#include "InterferenceFunction1DLattice.pypp.h" -#include "ISample.pypp.h" -#include "ISampleBuilder.pypp.h" -#include "PythonInterface_global_variables.pypp.h" -#include "Beam.pypp.h" -#include "HomogeneousMaterial.pypp.h" -#include "ICloneable.pypp.h" -#include "ParticleCoreShell.pypp.h" -#include "FormFactorDecoratorDebyeWaller.pypp.h" -#include "MesoCrystal.pypp.h" -#include "Lattice1DIFParameters.pypp.h" -#include "IObserver.pypp.h" -#include "IntensityData.pypp.h" -#include "Lattice.pypp.h" -#include "IInterferenceFunction.pypp.h" -#include "ParticleInfo.pypp.h" -#include "Instrument.pypp.h" -#include "FormFactorInfLongBox.pypp.h" -#include "FormFactorCone.pypp.h" -#include "FTDistribution2DGauss.pypp.h" +#include "FormFactorSphereGaussianRadius.pypp.h" #include "FormFactorTruncatedSphere.pypp.h" -#include "FTDistribution2DVoigt.pypp.h" -#include "FormFactorGauss.pypp.h" -#include "InterferenceFunction2DParaCrystal.pypp.h" -#include "Detector.pypp.h" -#include "FormFactorInfLongRipple2.pypp.h" -#include "LatticeBasis.pypp.h" -#include "ICompositeSample.pypp.h" -#include "Bin1D.pypp.h" -#include "ParticleCollection.pypp.h" -#include "DistributionLogNormal.pypp.h" +#include "IntensityDataFunctions.pypp.h" +#include "DistributionLorentz.pypp.h" +#include "ConstKBinAxis.pypp.h" +#include "ParameterDistribution.pypp.h" +#include "ParameterPool.pypp.h" +#include "vector_complex_t.pypp.h" +#include "SpecularSimulation.pypp.h" +#include "FormFactorAnisoPyramid.pypp.h" +#include "FormFactorCuboctahedron.pypp.h" +#include "MultiLayer.pypp.h" +#include "FormFactorCone.pypp.h" +#include "IDistribution1D.pypp.h" +#include "LayerRoughness.pypp.h" +#include "VariableBinAxis.pypp.h" +#include "SimpleSelectionRule.pypp.h" +#include "FixedBinAxis.pypp.h" +#include "Lattice2DIFParameters.pypp.h" +#include "IFormFactor.pypp.h" +#include "vdouble1d_t.pypp.h" #include "IFTDistribution2D.pypp.h" +#include "Beam.pypp.h" +#include "FormFactorSphereUniformRadius.pypp.h" +#include "FTDistribution1DCauchy.pypp.h" +#include "kvector_t.pypp.h" +#include "Crystal.pypp.h" +#include "ISelectionRule.pypp.h" +#include "vector_integer_t.pypp.h" #include "__call_policies.pypp.hpp" #include "__convenience.pypp.hpp" #include "__call_policies.pypp.hpp" @@ -142,6 +144,7 @@ BOOST_PYTHON_MODULE(libBornAgainCore){ boost::python::docstring_options doc_options(true, true, false); register_vector_longinteger_t_class(); + register_vector_complex_t_class(); register_vector_integer_t_class(); register_vdouble1d_t_class(); register_vector_IFormFactorPtr_t_class(); @@ -259,6 +262,7 @@ BOOST_PYTHON_MODULE(libBornAgainCore){ register_SimpleSelectionRule_class(); register_Simulation_class(); register_SimulationParameters_class(); + register_SpecularSimulation_class(); register_ThreadInfo_class(); register_global_variables(); register_free_functions(); diff --git a/Core/PythonAPI/src/SpecularSimulation.pypp.cpp b/Core/PythonAPI/src/SpecularSimulation.pypp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..516bede0ec3cd122b3b9f59a2926f56ab3cc0e98 --- /dev/null +++ b/Core/PythonAPI/src/SpecularSimulation.pypp.cpp @@ -0,0 +1,381 @@ +// This file has been generated by Py++. + +// BornAgain: simulate and fit scattering at grazing incidence +//! @brief Automatically generated boost::python code for PythonCoreAPI + +#include "Macros.h" +GCC_DIAG_OFF(unused-parameter) +GCC_DIAG_OFF(missing-field-initializers) +#include "boost/python.hpp" +GCC_DIAG_ON(unused-parameter) +GCC_DIAG_ON(missing-field-initializers) +#include "__call_policies.pypp.hpp" +#include "__convenience.pypp.hpp" +#include "PythonCoreList.h" +#include "SpecularSimulation.pypp.h" + +namespace bp = boost::python; + +struct SpecularSimulation_wrapper : SpecularSimulation, bp::wrapper< SpecularSimulation > { + + SpecularSimulation_wrapper( ) + : SpecularSimulation( ) + , bp::wrapper< SpecularSimulation >(){ + // null constructor + m_pyobj = 0; + } + + SpecularSimulation_wrapper(::ISample const & sample ) + : SpecularSimulation( boost::ref(sample) ) + , bp::wrapper< SpecularSimulation >(){ + // constructor + m_pyobj = 0; + } + + SpecularSimulation_wrapper(::SampleBuilder_t sample_builder ) + : SpecularSimulation( sample_builder ) + , bp::wrapper< SpecularSimulation >(){ + // constructor + m_pyobj = 0; + } + + virtual ::SpecularSimulation * clone( ) const { + if( bp::override func_clone = this->get_override( "clone" ) ) + return func_clone( ); + else{ + return this->SpecularSimulation::clone( ); + } + } + + ::SpecularSimulation * default_clone( ) const { + return SpecularSimulation::clone( ); + } + + virtual bool areParametersChanged( ) { + if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) ) + return func_areParametersChanged( ); + else{ + return this->IParameterized::areParametersChanged( ); + } + } + + bool default_areParametersChanged( ) { + return IParameterized::areParametersChanged( ); + } + + virtual void clearParameterPool( ) { + if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) ) + func_clearParameterPool( ); + else{ + this->IParameterized::clearParameterPool( ); + } + } + + void default_clearParameterPool( ) { + IParameterized::clearParameterPool( ); + } + + virtual ::ParameterPool * createParameterTree( ) const { + if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) ) + return func_createParameterTree( ); + else{ + return this->IParameterized::createParameterTree( ); + } + } + + ::ParameterPool * default_createParameterTree( ) const { + return IParameterized::createParameterTree( ); + } + + virtual void printParameters( ) const { + if( bp::override func_printParameters = this->get_override( "printParameters" ) ) + func_printParameters( ); + else{ + this->IParameterized::printParameters( ); + } + } + + void default_printParameters( ) const { + IParameterized::printParameters( ); + } + + virtual void registerParameter( ::std::string const & name, double * parpointer ) { + namespace bpl = boost::python; + if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){ + bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer ); + } + else{ + IParameterized::registerParameter( name, parpointer ); + } + } + + static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){ + if( dynamic_cast< SpecularSimulation_wrapper * >( boost::addressof( inst ) ) ){ + inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer )); + } + else{ + inst.registerParameter(name, reinterpret_cast< double * >( parpointer )); + } + } + + virtual bool setParameterValue( ::std::string const & name, double value ) { + if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) ) + return func_setParameterValue( name, value ); + else{ + return this->IParameterized::setParameterValue( name, value ); + } + } + + bool default_setParameterValue( ::std::string const & name, double value ) { + return IParameterized::setParameterValue( name, value ); + } + + virtual void setParametersAreChanged( ) { + if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) ) + func_setParametersAreChanged( ); + else{ + this->IParameterized::setParametersAreChanged( ); + } + } + + void default_setParametersAreChanged( ) { + IParameterized::setParametersAreChanged( ); + } + + virtual void transferToCPP( ) { + + if( !this->m_pyobj) { + this->m_pyobj = boost::python::detail::wrapper_base_::get_owner(*this); + Py_INCREF(this->m_pyobj); + } + + if( bp::override func_transferToCPP = this->get_override( "transferToCPP" ) ) + func_transferToCPP( ); + else{ + this->ICloneable::transferToCPP( ); + } + } + + void default_transferToCPP( ) { + + if( !this->m_pyobj) { + this->m_pyobj = boost::python::detail::wrapper_base_::get_owner(*this); + Py_INCREF(this->m_pyobj); + } + + ICloneable::transferToCPP( ); + } + + PyObject* m_pyobj; + +}; + +void register_SpecularSimulation_class(){ + + { //::SpecularSimulation + typedef bp::class_< SpecularSimulation_wrapper, bp::bases< ICloneable, IParameterized >, std::auto_ptr< SpecularSimulation_wrapper >, boost::noncopyable > SpecularSimulation_exposer_t; + SpecularSimulation_exposer_t SpecularSimulation_exposer = SpecularSimulation_exposer_t( "SpecularSimulation", bp::init< >() ); + bp::scope SpecularSimulation_scope( SpecularSimulation_exposer ); + SpecularSimulation_exposer.def( bp::init< ISample const & >(( bp::arg("sample") )) ); + SpecularSimulation_exposer.def( bp::init< SampleBuilder_t >(( bp::arg("sample_builder") )) ); + { //::SpecularSimulation::clone + + typedef ::SpecularSimulation * ( ::SpecularSimulation::*clone_function_type)( ) const; + typedef ::SpecularSimulation * ( SpecularSimulation_wrapper::*default_clone_function_type)( ) const; + + SpecularSimulation_exposer.def( + "clone" + , clone_function_type(&::SpecularSimulation::clone) + , default_clone_function_type(&SpecularSimulation_wrapper::default_clone) + , bp::return_value_policy< bp::manage_new_object >() ); + + } + { //::SpecularSimulation::getAlphaAxis + + typedef ::IAxis const * ( ::SpecularSimulation::*getAlphaAxis_function_type)( ) const; + + SpecularSimulation_exposer.def( + "getAlphaAxis" + , getAlphaAxis_function_type( &::SpecularSimulation::getAlphaAxis ) + , bp::return_value_policy< bp::reference_existing_object >() ); + + } + { //::SpecularSimulation::getSample + + typedef ::ISample * ( ::SpecularSimulation::*getSample_function_type)( ) const; + + SpecularSimulation_exposer.def( + "getSample" + , getSample_function_type( &::SpecularSimulation::getSample ) + , bp::return_value_policy< bp::reference_existing_object >() ); + + } + { //::SpecularSimulation::getSampleBuilder + + typedef ::SampleBuilder_t ( ::SpecularSimulation::*getSampleBuilder_function_type)( ) const; + + SpecularSimulation_exposer.def( + "getSampleBuilder" + , getSampleBuilder_function_type( &::SpecularSimulation::getSampleBuilder ) ); + + } + { //::SpecularSimulation::getScalarR + + typedef ::std::vector< std::complex<double> > ( ::SpecularSimulation::*getScalarR_function_type)( int ) const; + + SpecularSimulation_exposer.def( + "getScalarR" + , getScalarR_function_type( &::SpecularSimulation::getScalarR ) + , ( bp::arg("i_layer")=(int)(0) ) ); + + } + { //::SpecularSimulation::getScalarT + + typedef ::std::vector< std::complex<double> > ( ::SpecularSimulation::*getScalarT_function_type)( int ) const; + + SpecularSimulation_exposer.def( + "getScalarT" + , getScalarT_function_type( &::SpecularSimulation::getScalarT ) + , ( bp::arg("i_layer")=(int)(0) ) ); + + } + { //::SpecularSimulation::prepareSimulation + + typedef void ( ::SpecularSimulation::*prepareSimulation_function_type)( ) ; + + SpecularSimulation_exposer.def( + "prepareSimulation" + , prepareSimulation_function_type( &::SpecularSimulation::prepareSimulation ) ); + + } + { //::SpecularSimulation::runSimulation + + typedef void ( ::SpecularSimulation::*runSimulation_function_type)( ) ; + + SpecularSimulation_exposer.def( + "runSimulation" + , runSimulation_function_type( &::SpecularSimulation::runSimulation ) ); + + } + { //::SpecularSimulation::setBeamParameters + + typedef void ( ::SpecularSimulation::*setBeamParameters_function_type)( double,::IAxis const & ) ; + + SpecularSimulation_exposer.def( + "setBeamParameters" + , setBeamParameters_function_type( &::SpecularSimulation::setBeamParameters ) + , ( bp::arg("lambda"), bp::arg("alpha_axis") ) ); + + } + { //::SpecularSimulation::setSample + + typedef void ( ::SpecularSimulation::*setSample_function_type)( ::ISample const & ) ; + + SpecularSimulation_exposer.def( + "setSample" + , setSample_function_type( &::SpecularSimulation::setSample ) + , ( bp::arg("sample") ) ); + + } + { //::SpecularSimulation::setSampleBuilder + + typedef void ( ::SpecularSimulation::*setSampleBuilder_function_type)( ::SampleBuilder_t ) ; + + SpecularSimulation_exposer.def( + "setSampleBuilder" + , setSampleBuilder_function_type( &::SpecularSimulation::setSampleBuilder ) + , ( bp::arg("sample_builder") ) ); + + } + { //::IParameterized::areParametersChanged + + typedef bool ( ::IParameterized::*areParametersChanged_function_type)( ) ; + typedef bool ( SpecularSimulation_wrapper::*default_areParametersChanged_function_type)( ) ; + + SpecularSimulation_exposer.def( + "areParametersChanged" + , areParametersChanged_function_type(&::IParameterized::areParametersChanged) + , default_areParametersChanged_function_type(&SpecularSimulation_wrapper::default_areParametersChanged) ); + + } + { //::IParameterized::clearParameterPool + + typedef void ( ::IParameterized::*clearParameterPool_function_type)( ) ; + typedef void ( SpecularSimulation_wrapper::*default_clearParameterPool_function_type)( ) ; + + SpecularSimulation_exposer.def( + "clearParameterPool" + , clearParameterPool_function_type(&::IParameterized::clearParameterPool) + , default_clearParameterPool_function_type(&SpecularSimulation_wrapper::default_clearParameterPool) ); + + } + { //::IParameterized::createParameterTree + + typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type)( ) const; + typedef ::ParameterPool * ( SpecularSimulation_wrapper::*default_createParameterTree_function_type)( ) const; + + SpecularSimulation_exposer.def( + "createParameterTree" + , createParameterTree_function_type(&::IParameterized::createParameterTree) + , default_createParameterTree_function_type(&SpecularSimulation_wrapper::default_createParameterTree) + , bp::return_value_policy< bp::manage_new_object >() ); + + } + { //::IParameterized::printParameters + + typedef void ( ::IParameterized::*printParameters_function_type)( ) const; + typedef void ( SpecularSimulation_wrapper::*default_printParameters_function_type)( ) const; + + SpecularSimulation_exposer.def( + "printParameters" + , printParameters_function_type(&::IParameterized::printParameters) + , default_printParameters_function_type(&SpecularSimulation_wrapper::default_printParameters) ); + + } + { //::IParameterized::registerParameter + + typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int ); + + SpecularSimulation_exposer.def( + "registerParameter" + , default_registerParameter_function_type( &SpecularSimulation_wrapper::default_registerParameter ) + , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) ); + + } + { //::IParameterized::setParameterValue + + typedef bool ( ::IParameterized::*setParameterValue_function_type)( ::std::string const &,double ) ; + typedef bool ( SpecularSimulation_wrapper::*default_setParameterValue_function_type)( ::std::string const &,double ) ; + + SpecularSimulation_exposer.def( + "setParameterValue" + , setParameterValue_function_type(&::IParameterized::setParameterValue) + , default_setParameterValue_function_type(&SpecularSimulation_wrapper::default_setParameterValue) + , ( bp::arg("name"), bp::arg("value") ) ); + + } + { //::IParameterized::setParametersAreChanged + + typedef void ( ::IParameterized::*setParametersAreChanged_function_type)( ) ; + typedef void ( SpecularSimulation_wrapper::*default_setParametersAreChanged_function_type)( ) ; + + SpecularSimulation_exposer.def( + "setParametersAreChanged" + , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged) + , default_setParametersAreChanged_function_type(&SpecularSimulation_wrapper::default_setParametersAreChanged) ); + + } + { //::ICloneable::transferToCPP + + typedef void ( ::ICloneable::*transferToCPP_function_type)( ) ; + typedef void ( SpecularSimulation_wrapper::*default_transferToCPP_function_type)( ) ; + + SpecularSimulation_exposer.def( + "transferToCPP" + , transferToCPP_function_type(&::ICloneable::transferToCPP) + , default_transferToCPP_function_type(&SpecularSimulation_wrapper::default_transferToCPP) ); + + } + } + +} diff --git a/Core/PythonAPI/src/vector_complex_t.pypp.cpp b/Core/PythonAPI/src/vector_complex_t.pypp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4cb8379bcbf8259b6fd626cab0023244e8013370 --- /dev/null +++ b/Core/PythonAPI/src/vector_complex_t.pypp.cpp @@ -0,0 +1,28 @@ +// This file has been generated by Py++. + +// BornAgain: simulate and fit scattering at grazing incidence +//! @brief Automatically generated boost::python code for PythonCoreAPI + +#include "Macros.h" +GCC_DIAG_OFF(unused-parameter) +GCC_DIAG_OFF(missing-field-initializers) +#include "boost/python.hpp" +#include "boost/python/suite/indexing/vector_indexing_suite.hpp" +GCC_DIAG_ON(unused-parameter) +GCC_DIAG_ON(missing-field-initializers) +#include "PythonCoreList.h" +#include "vector_complex_t.pypp.h" + +namespace bp = boost::python; + +void register_vector_complex_t_class(){ + + { //::std::vector< std::complex<double> > + typedef bp::class_< std::vector< std::complex<double> > > vector_complex_t_exposer_t; + vector_complex_t_exposer_t vector_complex_t_exposer = vector_complex_t_exposer_t( "vector_complex_t" ); + bp::scope vector_complex_t_scope( vector_complex_t_exposer ); + //WARNING: the next line of code will not compile, because "::std::complex<double>" does not have operator== ! + vector_complex_t_exposer.def( bp::vector_indexing_suite< ::std::vector< std::complex<double> > >() ); + } + +} diff --git a/Examples/python/simulation/ex05_BeamAndDetector/SpecularSimulation.py b/Examples/python/simulation/ex05_BeamAndDetector/SpecularSimulation.py new file mode 100644 index 0000000000000000000000000000000000000000..d7eb9a0b0d17ed8d251e610ef61c421fe468d79f --- /dev/null +++ b/Examples/python/simulation/ex05_BeamAndDetector/SpecularSimulation.py @@ -0,0 +1,102 @@ +""" +R and T coefficients in multilayer, Specular simulation +""" +import numpy +import matplotlib +import pylab +import cmath +from bornagain import * + + +alpha_i_min, alpha_i_max = 0.0, 2.0 # incoming beam + + +def get_sample(): + """ + Build and return the sample representing the layers with correlated roughness. + """ + m_ambience = HomogeneousMaterial("ambience", 0.0, 0.0) + m_part_a = HomogeneousMaterial("PartA", 5e-6, 0.0) + m_part_b = HomogeneousMaterial("PartB", 10e-6, 0.0) + m_substrate = HomogeneousMaterial("substrate", 15e-6, 0.0) + + l_ambience = Layer(m_ambience) + l_part_a = Layer(m_part_a, 5.0*nanometer) + l_part_b = Layer(m_part_b, 10.0*nanometer) + l_substrate = Layer(m_substrate) + + roughness = LayerRoughness() + roughness.setSigma(1.0*nanometer) + roughness.setHurstParameter(0.3) + roughness.setLatteralCorrLength(500.0*nanometer) + + my_sample = MultiLayer() + + # adding layers + my_sample.addLayer(l_ambience) + + n_repetitions = 10 + for i in range(n_repetitions): + my_sample.addLayerWithTopRoughness(l_part_a, roughness) + my_sample.addLayerWithTopRoughness(l_part_b, roughness) + + my_sample.addLayerWithTopRoughness(l_substrate, roughness) + # my_sample.setCrossCorrLength(1e-4) + + return my_sample + + +def get_simulation(): + """ + Create and return off-specular simulation with beam and detector defined + """ + simulation = SpecularSimulation() + # simulation.setDetectorParameters(20, phi_f_min*degree, phi_f_max*degree, 200, alpha_f_min*degree, alpha_f_max*degree) + # defining the beam with incidence alpha_i varied between alpha_i_min and alpha_i_max + alpha_i_axis = FixedBinAxis("alpha_i", 1000, alpha_i_min*degree, alpha_i_max*degree) + simulation.setBeamParameters(1.54*angstrom, alpha_i_axis) + # simulation.setBeamIntensity(1e9) + return simulation + + +def run_simulation(): + """ + Run simulation and plot results + """ + sample = get_sample() + simulation = get_simulation() + simulation.setSample(sample) + print "aaa" + simulation.runSimulation() + print "aaa2" + + coeff_r = [] + for r in simulation.getScalarR(0): + coeff_r.append(numpy.abs(r)) + + coeff_t = [] + for t in simulation.getScalarT(0): + coeff_t.append(numpy.abs(t)) + + alpha = simulation.getAlphaAxis().getBinCenters() + + + fig = pylab.figure() + pylab.ylim(ymax=10.0, ymin=1e-06) + pylab.semilogy(alpha, coeff_r) + pylab.semilogy(alpha, coeff_t) + pylab.legend(['|R|', '|T|'], loc='upper right') + + # result = simulation.getIntensityData().getArray() + 1 # for log scale + + # showing the result + # im = pylab.imshow(numpy.rot90(result, 1), norm=matplotlib.colors.LogNorm(), + # extent=[alpha_i_min, alpha_i_max, alpha_f_min, alpha_f_max], aspect='auto') + # pylab.colorbar(im) + # pylab.xlabel(r'$\alpha_i$', fontsize=16) + # pylab.ylabel(r'$\alpha_f$', fontsize=16) + pylab.show() + + +if __name__ == '__main__': + run_simulation() diff --git a/Fit/PythonAPI/src/PythonModule.cpp b/Fit/PythonAPI/src/PythonModule.cpp index ef8312b19c0e5f34a1dd036a15ac8689fdb68a4c..9e316599b4cf7992d66a9756e63a29a6c5020ac4 100644 --- a/Fit/PythonAPI/src/PythonModule.cpp +++ b/Fit/PythonAPI/src/PythonModule.cpp @@ -5,38 +5,38 @@ GCC_DIAG_OFF(missing-field-initializers) #include "boost/python.hpp" GCC_DIAG_ON(unused-parameter) GCC_DIAG_ON(missing-field-initializers) -#include "IntensityFunctionSqrt.pypp.h" -#include "MinimizerFactory.pypp.h" -#include "IMinimizer.pypp.h" -#include "vector_string_t.pypp.h" -#include "SquaredFunctionSystematicError.pypp.h" -#include "IntensityNormalizer.pypp.h" -#include "IIntensityFunction.pypp.h" -#include "INamed.pypp.h" +#include "FitObject.pypp.h" #include "IntensityFunctionLog.pypp.h" -#include "FitSuiteParameters.pypp.h" -#include "AttFitting.pypp.h" -#include "FitParameter.pypp.h" -#include "IntensityScaleAndShiftNormalizer.pypp.h" +#include "IntensityFunctionSqrt.pypp.h" +#include "FitStrategyDefault.pypp.h" #include "IChiSquaredModule.pypp.h" +#include "AttFitting.pypp.h" +#include "FitStrategyAdjustParameters.pypp.h" #include "FitStrategyAdjustMinimizer.pypp.h" -#include "IFitStrategy.pypp.h" -#include "FitStrategyFixParameters.pypp.h" +#include "ISquaredFunction.pypp.h" #include "SquaredFunctionGaussianError.pypp.h" +#include "IIntensityFunction.pypp.h" +#include "IntensityScaleAndShiftNormalizer.pypp.h" +#include "SquaredFunctionMeanSquaredError.pypp.h" +#include "FitSuiteParameters.pypp.h" +#include "IMinimizer.pypp.h" #include "IIntensityNormalizer.pypp.h" +#include "FitParameter.pypp.h" +#include "INamed.pypp.h" +#include "FitStrategyReleaseParameters.pypp.h" #include "FitSuite.pypp.h" -#include "FitStrategyAdjustParameters.pypp.h" +#include "IntensityNormalizer.pypp.h" +#include "FitStrategyFixParameters.pypp.h" +#include "FitSuiteObjects.pypp.h" +#include "SquaredFunctionSystematicError.pypp.h" +#include "MinimizerFactory.pypp.h" #include "ChiSquaredModule.pypp.h" +#include "SquaredFunctionSimError.pypp.h" #include "MinimizerOptions.pypp.h" -#include "SquaredFunctionDefault.pypp.h" -#include "SquaredFunctionMeanSquaredError.pypp.h" -#include "ISquaredFunction.pypp.h" -#include "FitStrategyDefault.pypp.h" #include "AttLimits.pypp.h" -#include "FitObject.pypp.h" -#include "FitSuiteObjects.pypp.h" -#include "SquaredFunctionSimError.pypp.h" -#include "FitStrategyReleaseParameters.pypp.h" +#include "SquaredFunctionDefault.pypp.h" +#include "vector_string_t.pypp.h" +#include "IFitStrategy.pypp.h" BOOST_PYTHON_MODULE(libBornAgainFit){ boost::python::docstring_options doc_options(true, true, false); diff --git a/dev-tools/python-bindings/settings_core.py b/dev-tools/python-bindings/settings_core.py index e28b75d895e7d4a41e89ce001dc7f6f48b264a6c..eb49ff65dbe6c26d36fa61f19b9a25d464903647 100644 --- a/dev-tools/python-bindings/settings_core.py +++ b/dev-tools/python-bindings/settings_core.py @@ -148,6 +148,7 @@ include_classes = [ "RealParameterWrapper", "ResolutionFunction2DGaussian", "Simulation", + "SpecularSimulation", "SimulationParameters", "SimpleSelectionRule", "ThreadInfo",