BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Main class to run a Grazing-Incidence Small-Angle Scattering simulation. More...
Public Member Functions | |
GISASSimulation () | |
GISASSimulation (const Beam &beam, const IDetector &detector) | |
GISASSimulation (const Beam &beam, const MultiLayer &sample, const IDetector &detector) | |
~GISASSimulation () | |
void | accept (INodeVisitor *visitor) const override |
Calls the INodeVisitor's visit method. More... | |
void | addMask (const IShape2D &shape, bool mask_value=true) |
Adds mask of given shape to the stack of detector masks. More... | |
void | addParameterDistribution (const ParameterDistribution &par_distr) |
void | addParameterDistribution (const std::string ¶m_name, const IDistribution1D &distribution, size_t nbr_samples, double sigma_factor=0.0, const RealLimits &limits=RealLimits()) |
const IBackground * | background () const |
Beam & | beam () |
const Beam & | beam () const |
GISASSimulation * | clone () const override |
SimulationResult | convertData (const OutputData< double > &data, bool put_masked_areas_to_zero=true) |
Convert user data to SimulationResult object for later drawing in various axes units. More... | |
int | copyNumber (const INode *node) const |
Returns copyNumber of child, which takes into account existence of children with same name. More... | |
ParameterPool * | createParameterTree () const |
Creates new parameter pool, with all local parameters and those of its children. More... | |
IDetector & | detector () |
const IDetector & | detector () const |
IDetector2D & | detector2D () |
const IDetector2D & | detector2D () const |
std::string | displayName () const |
Returns display name, composed from the name of node and it's copy number. More... | |
std::vector< const INode * > | getChildren () const |
Returns a vector of children. More... | |
IDetector * | getDetector () |
const IDetector * | getDetector () const |
const DistributionHandler & | getDistributionHandler () const |
const std::string & | getName () const |
SimulationOptions & | getOptions () |
const SimulationOptions & | getOptions () const |
Instrument & | instrument () |
const Instrument & | instrument () const |
size_t | intensityMapSize () const override |
Returns the total number of the intensity values in the simulation result. More... | |
void | maskAll () |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis) More... | |
virtual void | onChange () |
Action to be taken in inherited class when a parameter has changed. More... | |
RealParameter * | parameter (const std::string &name) const |
Returns parameter with given 'name'. More... | |
ParameterPool * | parameterPool () const |
Returns pointer to the parameter pool. More... | |
std::string | parametersToString () const |
Returns multiline string representing available parameters. More... | |
INode * | parent () |
const INode * | parent () const |
void | prepareSimulation () override |
Put into a clean state for running a simulation. More... | |
std::vector< const INode * > | progeny () const |
Returns a vector of all descendants. More... | |
void | registerChild (INode *node) |
RealParameter & | registerParameter (const std::string &name, double *parpointer) |
void | registerVector (const std::string &base_name, kvector_t *p_vec, const std::string &units="nm") |
void | removeParameter (const std::string &name) |
void | removeVector (const std::string &base_name) |
SimulationResult | result () const override |
Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays. More... | |
void | runMPISimulation () |
Run a simulation in a MPI environment. More... | |
void | runSimulation () |
Run a simulation, possibly averaged over parameter distributions. More... | |
const MultiLayer * | sample () const |
void | setBackground (const IBackground &bg) |
void | setBeamParameters (double wavelength, double alpha_i, double phi_i) |
Sets beam parameters from here (forwarded to Instrument) More... | |
void | setDetector (const IDetector2D &detector) |
Sets the detector (axes can be overwritten later) More... | |
void | setDetectorParameters (size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) |
Sets spherical detector parameters using angle ranges. More... | |
void | setDetectorResolutionFunction (const IResolutionFunction2D &resolution_function) |
void | setInstrument (const Instrument &instrument_) |
void | setName (const std::string &name) |
void | setOptions (const SimulationOptions &options) |
void | setParameterValue (const std::string &name, double value) |
virtual void | setParent (const INode *newParent) |
void | setRegionOfInterest (double xlow, double ylow, double xup, double yup) |
Sets rectangular region of interest with lower left and upper right corners defined. More... | |
void | setSample (const MultiLayer &sample) |
The MultiLayer object will not be owned by the ISimulation object. More... | |
void | setSampleBuilder (const std::shared_ptr< ISampleBuilder > &sample_builder) |
void | setTerminalProgressMonitor () |
Initializes a progress monitor that prints to stdout. More... | |
void | setVectorValue (const std::string &base_name, kvector_t value) |
void | subscribe (ProgressHandler::Callback_t inform) |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
virtual std::string | treeToString () const |
Returns multiline string representing tree structure below the node. More... | |
Static Public Member Functions | |
static std::string | XComponentName (const std::string &base_name) |
static std::string | YComponentName (const std::string &base_name) |
static std::string | ZComponentName (const std::string &base_name) |
Protected Member Functions | |
void | addBackgroundIntensity (size_t start_ind, size_t n_elements) override |
void | addDataToCache (double weight) override |
std::vector< SimulationElement > | generateSimulationElements (const Beam &beam) |
Generate simulation elements for given beam. More... | |
std::unique_ptr< IComputation > | generateSingleThreadedComputation (size_t start, size_t n_elements) override |
Generate a single threaded computation for a given range of simulation elements. More... | |
virtual void | initUnitConverter () |
void | moveDataFromCache () override |
void | normalize (size_t start_ind, size_t n_elements) override |
Normalize the detector counts to beam intensity, to solid angle, and to exposure angle. More... | |
size_t | numberOfSimulationElements () const override |
Gets the number of elements this simulation needs to calculate. More... | |
const SimulationOptions & | options () const |
ProgressHandler & | progress () |
virtual void | transferResultsToIntensityMap () |
Creates the appropriate data structure (e.g. More... | |
virtual void | updateIntensityMap () |
Protected Attributes | |
std::vector< double > | m_cache |
const size_t | m_NP |
std::vector< double > | m_P |
std::vector< SimulationElement > | m_sim_elements |
Private Member Functions | |
GISASSimulation (const GISASSimulation &other) | |
void | initialize () |
void | initSimulationElementVector () override |
Initializes the vector of ISimulation elements. More... | |
std::vector< double > | rawResults () const override |
void | runSingleSimulation (size_t batch_start, size_t batch_size, double weight=1.0) |
Runs a single simulation with fixed parameter values. More... | |
void | setRawResults (const std::vector< double > &raw_data) override |
virtual void | validateParametrization (const ParameterDistribution &) const |
Checks the distribution validity for simulation. More... | |
Private Attributes | |
std::unique_ptr< IBackground > | m_background |
std::unique_ptr< DetectorContext > | m_detector_context |
DistributionHandler | m_distribution_handler |
Instrument | m_instrument |
std::string | m_name |
SimulationOptions | m_options |
const INode * | m_parent {nullptr} |
std::unique_ptr< ParameterPool > | m_pool |
parameter pool (kind of pointer-to-implementation) More... | |
ProgressHandler | m_progress |
SampleProvider | m_sample_provider |
Main class to run a Grazing-Incidence Small-Angle Scattering simulation.
Definition at line 27 of file GISASSimulation.h.
GISASSimulation::GISASSimulation | ( | const Beam & | beam, |
const MultiLayer & | sample, | ||
const IDetector & | detector | ||
) |
Definition at line 19 of file GISASSimulation.cpp.
References initialize().
Definition at line 27 of file GISASSimulation.cpp.
References initialize().
GISASSimulation::GISASSimulation | ( | ) |
Definition at line 34 of file GISASSimulation.cpp.
References initialize().
Referenced by clone().
|
inline |
Definition at line 34 of file GISASSimulation.h.
|
private |
Definition at line 39 of file GISASSimulation.cpp.
References initialize().
|
inlineoverridevirtual |
Calls the INodeVisitor's visit method.
Implements INode.
Definition at line 38 of file GISASSimulation.h.
References INodeVisitor::visit().
|
overrideprotectedvirtualinherited |
Implements ISimulation.
Definition at line 151 of file ISimulation2D.cpp.
References ISimulation::background(), SimulationElement::intensity(), ISimulation2D::m_sim_elements, and SimulationElement::setIntensity().
|
overrideprotectedvirtualinherited |
Implements ISimulation.
Definition at line 161 of file ISimulation2D.cpp.
References ISimulation2D::m_cache, and ISimulation2D::m_sim_elements.
|
inherited |
Adds mask of given shape to the stack of detector masks.
The mask value 'true' means that the channel will be excluded from the simulation. The mask which is added last has priority.
Definition at line 60 of file ISimulation2D.cpp.
References IDetector2D::addMask(), and ISimulation2D::detector2D().
Referenced by StandardSimulations::GISASWithMasks(), StandardSimulations::RectDetWithRoi(), and StandardSimulations::SphericalDetWithRoi().
|
inherited |
Definition at line 272 of file ISimulation.cpp.
References DistributionHandler::addParameterDistribution(), ISimulation::m_distribution_handler, and ISimulation::validateParametrization().
|
inherited |
Definition at line 264 of file ISimulation.cpp.
Referenced by StandardSimulations::MiniGISASBeamDivergence(), and TransformToDomain::setBeamDistribution().
|
inlineinherited |
Definition at line 74 of file ISimulation.h.
References ISimulation::m_background.
Referenced by DepthProbeSimulation::addBackgroundIntensity(), ISimulation2D::addBackgroundIntensity(), SpecularSimulation::addBackgroundIntensity(), and TransformFromDomain::setBackground().
|
inlineinherited |
Definition at line 58 of file ISimulation.h.
References Instrument::beam(), and ISimulation::m_instrument.
Referenced by StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), DepthProbeSimulation::createUnitConverter(), OffSpecularSimulation::createUnitConverter(), DepthProbeSimulation::generateSimulationElements(), ISimulation2D::generateSimulationElements(), DepthProbeSimulation::initialize(), DepthProbeSimulation::initSimulationElementVector(), initSimulationElementVector(), OffSpecularSimulation::initSimulationElementVector(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), DepthProbeSimulation::normalize(), ISimulation2D::normalize(), SpecularSimulation::normalize(), OffSpecularSimulation::result(), DepthProbeSimulation::setBeamParameters(), TransformFromDomain::setGISASBeamItem(), TransformFromDomain::setOffSpecularBeamItem(), and TransformFromDomain::setSpecularBeamItem().
|
inlineinherited |
Definition at line 59 of file ISimulation.h.
References Instrument::beam(), and ISimulation::m_instrument.
|
inlineoverridevirtual |
Implements ISimulation2D.
Definition at line 36 of file GISASSimulation.h.
References GISASSimulation().
|
inherited |
Convert user data to SimulationResult object for later drawing in various axes units.
User data will be cropped to the ROI defined in the simulation, amplitudes in areas corresponding to the masked areas of the detector will be set to zero.
Definition at line 308 of file ISimulation.cpp.
References UnitConverterUtils::createConverter(), UnitConverterUtils::createOutputData(), ISimulation::detector(), SimulationAreaIterator::detectorIndex(), OutputData< T >::getRawDataVector(), IDetector::iterate(), and SimulationAreaIterator::roiIndex().
|
inherited |
Returns copyNumber of child, which takes into account existence of children with same name.
Definition at line 94 of file INode.cpp.
References INode::getChildren(), IParametricComponent::getName(), and INode::parent().
Referenced by INode::displayName().
|
virtualinherited |
Creates new parameter pool, with all local parameters and those of its children.
Reimplemented from IParametricComponent.
Definition at line 126 of file INode.cpp.
References NodeUtils::nodePath(), INode::parent(), and INode::progeny().
Referenced by ISimulation::runSimulation(), DepthProbeSimulation::validateParametrization(), OffSpecularSimulation::validateParametrization(), and SpecularSimulation::validateParametrization().
|
inlineinherited |
Definition at line 63 of file ISimulation.h.
References Instrument::detector(), and ISimulation::m_instrument.
Referenced by SpecularSimulation::SpecularSimulation(), StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), OffSpecularSimulation::checkInitialization(), ISimulation::convertData(), ISimulation2D::generateSimulationElements(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), intensityMapSize(), OffSpecularSimulation::intensityMapSize(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), prepareSimulation(), SpecularSimulation::prepareSimulation(), result(), DepthProbeSimulation::setBeamParameters(), ISimulation2D::setDetector(), ISimulation::setDetectorResolutionFunction(), SpecularSimulation::setScan(), OffSpecularSimulation::transferDetectorImage(), OffSpecularSimulation::transferResultsToIntensityMap(), and OffSpecularSimulation::updateIntensityMap().
|
inlineinherited |
Definition at line 64 of file ISimulation.h.
References Instrument::detector(), and ISimulation::m_instrument.
|
inherited |
Definition at line 38 of file ISimulation2D.cpp.
References ASSERT, and ISimulation::getDetector().
Referenced by ISimulation2D::addMask(), OffSpecularSimulation::createUnitConverter(), ISimulation2D::generateSimulationElements(), ISimulation2D::maskAll(), ISimulation2D::prepareSimulation(), OffSpecularSimulation::result(), ISimulation2D::setDetectorParameters(), and ISimulation2D::setRegionOfInterest().
|
inherited |
Definition at line 46 of file ISimulation2D.cpp.
References ASSERT, and ISimulation::getDetector().
|
inherited |
Returns display name, composed from the name of node and it's copy number.
Definition at line 115 of file INode.cpp.
References INode::copyNumber(), IParametricComponent::getName(), and INode::m_parent.
Referenced by NodeUtils::nodePath().
|
protectedinherited |
Generate simulation elements for given beam.
Definition at line 111 of file ISimulation2D.cpp.
References Direction::alpha(), DetectionProperties::analyzerOperator(), ISimulation::beam(), IDetector::detectionProperties(), ISimulation::detector(), ISimulation2D::detector2D(), Beam::direction(), Beam::getPolarization(), ISimulation2D::m_detector_context, Direction::phi(), ISimulation::result(), and Beam::wavelength().
Referenced by initSimulationElementVector(), and OffSpecularSimulation::initSimulationElementVector().
|
overrideprotectedvirtualinherited |
Generate a single threaded computation for a given range of simulation elements.
start | Index of the first element to include into computation |
n_elements | Number of elements to process |
Implements ISimulation.
Definition at line 100 of file ISimulation2D.cpp.
References DetectionProperties::analyzerDirection(), ASSERT, IDetector::detectionProperties(), ISimulation::detector(), ISimulation2D::m_sim_elements, ISimulation::options(), FormFactorPrecompute::polarized(), ISimulation::progress(), and ISimulation::sample().
|
virtualinherited |
Returns a vector of children.
Reimplemented from INode.
Definition at line 254 of file ISimulation.cpp.
References SampleProvider::getChildren(), ISimulation::instrument(), ISimulation::m_background, ISimulation::m_sample_provider, and ISimulation::result().
|
inlineinherited |
Definition at line 61 of file ISimulation.h.
References Instrument::getDetector(), and ISimulation::m_instrument.
Referenced by ISimulation2D::detector2D(), TransformFromDomain::setDetector(), and TransformFromDomain::setDetectorMasks().
|
inlineinherited |
Definition at line 62 of file ISimulation.h.
References Instrument::getDetector(), and ISimulation::m_instrument.
|
inlineinherited |
Definition at line 88 of file ISimulation.h.
References ISimulation::m_distribution_handler.
Referenced by TransformFromDomain::setGISASBeamItem().
|
inlineinherited |
Definition at line 70 of file IParametricComponent.h.
References IParametricComponent::m_name.
Referenced by Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), IDetector::IDetector(), Instrument::Instrument(), IParametricComponent::IParametricComponent(), SampleBuilderNode::SampleBuilderNode(), Layer::clone(), INode::copyNumber(), IParametricComponent::createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), Beam::operator=(), SampleBuilderNode::operator=(), GUIObjectBuilder::populateInstrumentModel(), PyImportAssistant::populateModels(), GUIDomainSampleVisitor::populateSampleModel(), IParametricComponent::registerParameter(), IFormFactor::sliceFormFactor(), and GUIDomainSampleVisitor::visit().
|
inlineinherited |
|
inlineinherited |
Definition at line 91 of file ISimulation.h.
References ISimulation::m_options.
Referenced by StandardSimulations::MiniGISASMonteCarlo(), StandardSimulations::MiniGISASSpecularPeak(), GUIObjectBuilder::populateDocumentModel(), and TransformToDomain::setSimulationOptions().
|
private |
Definition at line 44 of file GISASSimulation.cpp.
References IParametricComponent::setName().
Referenced by GISASSimulation().
|
overrideprivatevirtual |
Initializes the vector of ISimulation elements.
Implements ISimulation.
Definition at line 81 of file GISASSimulation.cpp.
References ISimulation::beam(), ISimulation2D::generateSimulationElements(), ISimulation2D::m_cache, and ISimulation2D::m_sim_elements.
|
inlineprotectedvirtualinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 55 of file ISimulation.h.
References ISimulation::m_instrument.
Referenced by SpecularSimulation::SpecularSimulation(), ISimulation::getChildren(), SpecularSimulation::initialize(), SpecularSimulation::initSimulationElementVector(), GUIObjectBuilder::populateInstrumentModel(), prepareSimulation(), SpecularSimulation::prepareSimulation(), result(), DepthProbeSimulation::setBeamParameters(), OffSpecularSimulation::setBeamParameters(), setBeamParameters(), ISimulation2D::setDetector(), and SpecularSimulation::setScan().
|
overridevirtual |
Returns the total number of the intensity values in the simulation result.
Implements ISimulation.
Definition at line 74 of file GISASSimulation.cpp.
References ISimulation::detector(), IDetector::iterate(), and result().
|
inherited |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
Definition at line 65 of file ISimulation2D.cpp.
References ISimulation2D::detector2D(), and IDetector2D::maskAll().
Referenced by StandardSimulations::GISASWithMasks().
|
overrideprotectedvirtualinherited |
Implements ISimulation.
Definition at line 170 of file ISimulation2D.cpp.
References ASSERT, ISimulation2D::m_cache, and ISimulation2D::m_sim_elements.
|
overrideprotectedvirtualinherited |
Normalize the detector counts to beam intensity, to solid angle, and to exposure angle.
start_ind | Index of the first element to operate on |
n_elements | Number of elements to process |
Implements ISimulation.
Definition at line 136 of file ISimulation2D.cpp.
References ISimulation::beam(), SimulationElement::getAlphaI(), SimulationElement::intensity(), Beam::intensity(), ISimulation2D::m_sim_elements, SimulationElement::setIntensity(), and SimulationElement::solidAngle().
|
overrideprotectedvirtualinherited |
Gets the number of elements this simulation needs to calculate.
Implements ISimulation.
Reimplemented in OffSpecularSimulation.
Definition at line 80 of file ISimulation2D.cpp.
References ISimulation2D::m_detector_context.
Referenced by OffSpecularSimulation::numberOfSimulationElements().
|
inlinevirtualinherited |
Action to be taken in inherited class when a parameter has changed.
Reimplemented in IProfileRipple, Lattice3D, InterferenceFunction3DLattice, InterferenceFunction2DLattice, FormFactorSphereLogNormalRadius, FormFactorSphereGaussianRadius, FormFactorGaussSphere, ISawtoothRipple, ICosineRipple, IProfileRectangularRipple, FormFactorTruncatedSpheroid, FormFactorTruncatedSphere, FormFactorTruncatedCube, FormFactorTetrahedron, FormFactorPyramid, FormFactorPrism6, FormFactorPrism3, FormFactorLongBoxLorentz, FormFactorLongBoxGauss, FormFactorIcosahedron, FormFactorHollowSphere, FormFactorHemiEllipsoid, FormFactorFullSpheroid, FormFactorFullSphere, FormFactorEllipsoidalCylinder, FormFactorDodecahedron, FormFactorCylinder, FormFactorCuboctahedron, FormFactorCone6, FormFactorCone, FormFactorCantellatedCube, FormFactorBox, FormFactorAnisoPyramid, and Lattice2D.
Definition at line 59 of file IParametricComponent.h.
Referenced by Lattice2D::onChange(), and IParametricComponent::registerParameter().
|
inlineprotectedinherited |
Definition at line 124 of file ISimulation.h.
References ISimulation::m_options.
Referenced by DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), and ISimulation::setOptions().
|
inherited |
Returns parameter with given 'name'.
Definition at line 86 of file IParametricComponent.cpp.
References IParametricComponent::m_pool, and RealSpace::Particles::name().
Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), Lattice3D::initialize(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and DistributionLogNormal::setUnits().
|
inlineinherited |
Returns pointer to the parameter pool.
Definition at line 39 of file IParametricComponent.h.
References IParametricComponent::m_pool.
Referenced by INode::INode(), IParametricComponent::IParametricComponent(), pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().
|
inherited |
Returns multiline string representing available parameters.
Definition at line 43 of file IParametricComponent.cpp.
References IParametricComponent::createParameterTree().
|
inherited |
Definition at line 89 of file INode.cpp.
References INode::m_parent.
|
inherited |
Definition at line 84 of file INode.cpp.
References INode::m_parent.
Referenced by INode::copyNumber(), INode::createParameterTree(), ParticleDistribution::generateParticles(), NodeUtils::nodePath(), Lattice2D::onChange(), SampleProvider::setBuilder(), SampleProvider::setParent(), and SampleProvider::setSample().
|
overridevirtual |
Put into a clean state for running a simulation.
Reimplemented from ISimulation.
Definition at line 49 of file GISASSimulation.cpp.
References ISimulation::detector(), Instrument::initDetector(), ISimulation::instrument(), and ISimulation2D::prepareSimulation().
|
inherited |
Returns a vector of all descendants.
Definition at line 68 of file INode.cpp.
References INode::getChildren().
Referenced by INode::createParameterTree(), and ParticleDistribution::generateParticles().
|
inlineprotectedinherited |
Definition at line 125 of file ISimulation.h.
References ISimulation::m_progress.
Referenced by DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), and SpecularSimulation::generateSingleThreadedComputation().
|
overrideprivatevirtualinherited |
Implements ISimulation.
Definition at line 180 of file ISimulation2D.cpp.
References ISimulation2D::m_sim_elements, and ISimulation::result().
|
inherited |
Definition at line 57 of file INode.cpp.
References ASSERT, and INode::setParent().
Referenced by Beam::Beam(), Crystal::Crystal(), IDetector::IDetector(), Instrument::Instrument(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), Particle::Particle(), ParticleDistribution::ParticleDistribution(), ParticleLayout::addAndRegisterAbstractParticle(), ParticleCoreShell::addAndRegisterCore(), MultiLayer::addAndRegisterInterface(), MultiLayer::addAndRegisterLayer(), ParticleCoreShell::addAndRegisterShell(), Layer::addLayout(), ParticleComposition::addParticlePointer(), ISimulation::initialize(), MesoCrystal::initialize(), Beam::operator=(), Instrument::operator=(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), ISimulation::setBackground(), InterferenceFunction1DLattice::setDecayFunction(), InterferenceFunction2DLattice::setDecayFunction(), Instrument::setDetector(), IDetector::setDetectorResolution(), Beam::setFootprintFactor(), Particle::setFormFactor(), InterferenceFunctionFinite3DLattice::setLattice(), InterferenceFunctionRadialParaCrystal::setProbabilityDistribution(), InterferenceFunction2DParaCrystal::setProbabilityDistributions(), ConvolutionDetectorResolution::setResolutionFunction(), IParticle::setRotation(), LayerInterface::setRoughness(), and InterferenceFunction2DSuperLattice::setSubstructureIFF().
|
inherited |
Definition at line 51 of file IParametricComponent.cpp.
References IParametricComponent::getName(), IParametricComponent::m_pool, RealSpace::Particles::name(), and IParametricComponent::onChange().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice2D::HexagonalLattice2D(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), SquareLattice2D::SquareLattice2D(), TriangularRippleBuilder::TriangularRippleBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::registerVector(), ParticleLayout::registerWeight(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 57 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::registerParameter(), RealParameter::setUnit(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().
Referenced by Beam::Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), Lattice3D::initialize(), and IParticle::registerPosition().
|
inherited |
Definition at line 91 of file IParametricComponent.cpp.
References IParametricComponent::m_pool, and RealSpace::Particles::name().
Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::removeVector(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 96 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::removeParameter(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().
Referenced by IParticle::registerPosition().
|
overridevirtual |
Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays.
Implements ISimulation.
Definition at line 58 of file GISASSimulation.cpp.
References UnitConverterUtils::createConverterForGISAS(), ISimulation::detector(), ISimulation::instrument(), and ISimulation2D::m_sim_elements.
Referenced by intensityMapSize().
|
inherited |
Run a simulation in a MPI environment.
Definition at line 226 of file ISimulation.cpp.
References MPISimulation::runSimulation().
|
inherited |
Run a simulation, possibly averaged over parameter distributions.
Run simulation with possible averaging over parameter distributions.
Definition at line 193 of file ISimulation.cpp.
References INode::createParameterTree(), SimulationOptions::getCurrentBatch(), SimulationOptions::getNumberOfBatches(), DistributionHandler::getTotalNumberOfSamples(), ISimulation::m_distribution_handler, ISimulation::m_options, ISimulation::m_progress, ISimulation::moveDataFromCache(), ISimulation::numberOfSimulationElements(), ISimulation::prepareSimulation(), ProgressHandler::reset(), ISimulation::runSingleSimulation(), ProgressHandler::setExpectedNTicks(), DistributionHandler::setParameterToMeans(), DistributionHandler::setParameterValues(), and ISimulation::transferResultsToIntensityMap().
Referenced by JobWorker::start().
|
privateinherited |
Runs a single simulation with fixed parameter values.
If desired, the simulation is run in several threads.
Definition at line 280 of file ISimulation.cpp.
References ISimulation::addBackgroundIntensity(), ISimulation::addDataToCache(), ASSERT, ISimulation::generateSingleThreadedComputation(), SimulationOptions::getNumberOfThreads(), ISimulation::initSimulationElementVector(), ISimulation::m_options, and ISimulation::normalize().
Referenced by ISimulation::runSimulation().
|
inherited |
Definition at line 238 of file ISimulation.cpp.
References ISimulation::m_sample_provider, and SampleProvider::sample().
Referenced by ISimulation::ISimulation(), DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), ISimulation::setSample(), and DepthProbeSimulation::validityCheck().
|
inherited |
Definition at line 248 of file ISimulation.cpp.
References IBackground::clone(), ISimulation::m_background, and INode::registerChild().
Referenced by ISimulation::ISimulation(), and StandardSimulations::ConstantBackgroundGISAS().
void GISASSimulation::setBeamParameters | ( | double | wavelength, |
double | alpha_i, | ||
double | phi_i | ||
) |
Sets beam parameters from here (forwarded to Instrument)
Definition at line 66 of file GISASSimulation.cpp.
References ISimulation::instrument(), and Instrument::setBeamParameters().
Referenced by StandardSimulations::MiniGISASSpecularPeak().
|
inherited |
Sets the detector (axes can be overwritten later)
Definition at line 94 of file ISimulation2D.cpp.
References ISimulation::detector(), ISimulation2D::initUnitConverter(), ISimulation::instrument(), and Instrument::setDetector().
|
inherited |
Sets spherical detector parameters using angle ranges.
n_phi | number of phi-axis bins |
phi_min | low edge of first phi-bin |
phi_max | upper edge of last phi-bin |
n_alpha | number of alpha-axis bins |
alpha_min | low edge of first alpha-bin |
alpha_max | upper edge of last alpha-bin |
Definition at line 87 of file ISimulation2D.cpp.
References ISimulation2D::detector2D(), IDetector2D::setDetectorParameters(), and ISimulation::updateIntensityMap().
Referenced by StandardSimulations::MiniGISASFit().
|
inherited |
Definition at line 177 of file ISimulation.cpp.
References ISimulation::detector(), and IDetector::setResolutionFunction().
Referenced by StandardSimulations::MiniGISASDetectorResolution().
|
inherited |
Definition at line 158 of file ISimulation.cpp.
References ISimulation::m_instrument, and ISimulation::updateIntensityMap().
|
inlineinherited |
Definition at line 69 of file IParametricComponent.h.
References IParametricComponent::m_name, and RealSpace::Particles::name().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice2D::HexagonalLattice2D(), IDetector::IDetector(), INode::INode(), Instrument::Instrument(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunction3DLattice::InterferenceFunction3DLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), InterferenceFunctionFinite3DLattice::InterferenceFunctionFinite3DLattice(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionNone::InterferenceFunctionNone(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), ISampleBuilder::ISampleBuilder(), IsGISAXSDetector::IsGISAXSDetector(), Lattice3D::Lattice3D(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SphericalDetector::SphericalDetector(), SquareLattice2D::SquareLattice2D(), Layer::clone(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), DepthProbeSimulation::initialize(), initialize(), OffSpecularSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), Beam::operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().
|
inlineinherited |
Definition at line 90 of file ISimulation.h.
References ISimulation::m_options, and ISimulation::options().
|
inherited |
Definition at line 65 of file IParametricComponent.cpp.
References IParametricComponent::createParameterTree(), IParametricComponent::m_pool, RealSpace::Particles::name(), and ParameterPool::setMatchedParametersValue().
Referenced by AsymRippleBuilder::buildSample(), and IParametricComponent::setVectorValue().
|
virtualinherited |
Reimplemented in SampleProvider.
Definition at line 79 of file INode.cpp.
References INode::m_parent.
Referenced by INode::registerChild(), SampleProvider::setBuilder(), and SampleProvider::setParent().
|
overrideprivatevirtualinherited |
Implements ISimulation.
Definition at line 189 of file ISimulation2D.cpp.
References ISimulation::initSimulationElementVector(), ISimulation2D::m_sim_elements, and ISimulation::transferResultsToIntensityMap().
|
inherited |
Sets rectangular region of interest with lower left and upper right corners defined.
Definition at line 70 of file ISimulation2D.cpp.
References ISimulation2D::detector2D(), and IDetector2D::setRegionOfInterest().
Referenced by StandardSimulations::RectDetWithRoi(), and StandardSimulations::SphericalDetWithRoi().
|
inherited |
The MultiLayer object will not be owned by the ISimulation object.
Definition at line 233 of file ISimulation.cpp.
References ISimulation::m_sample_provider, ISimulation::sample(), and SampleProvider::setSample().
Referenced by ISimulation::ISimulation().
|
inherited |
Definition at line 243 of file ISimulation.cpp.
References ISimulation::m_sample_provider, and SampleProvider::setBuilder().
|
inherited |
Initializes a progress monitor that prints to stdout.
Definition at line 166 of file ISimulation.cpp.
References ISimulation::m_progress, and ProgressHandler::subscribe().
|
inherited |
Definition at line 78 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::setParameterValue(), BasicVector3D< T >::x(), IParametricComponent::XComponentName(), BasicVector3D< T >::y(), IParametricComponent::YComponentName(), BasicVector3D< T >::z(), and IParametricComponent::ZComponentName().
|
inlineinherited |
Definition at line 94 of file ISimulation.h.
References ISimulation::m_progress, and ProgressHandler::subscribe().
Referenced by JobWorker::start().
|
inlineprotectedvirtualinherited |
Creates the appropriate data structure (e.g.
2D intensity map) from the calculated SimulationElement objects
Reimplemented in OffSpecularSimulation.
Definition at line 114 of file ISimulation.h.
Referenced by ISimulation::runSimulation(), ISimulation2D::setRawResults(), and SpecularSimulation::setRawResults().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 34 of file ICloneable.h.
|
virtualinherited |
Returns multiline string representing tree structure below the node.
Definition at line 52 of file INode.cpp.
References NodeUtils::nodeToString().
|
inlineprotectedvirtualinherited |
Reimplemented in OffSpecularSimulation.
Definition at line 119 of file ISimulation.h.
Referenced by ISimulation2D::setDetectorParameters(), and ISimulation::setInstrument().
|
inlineprivatevirtualinherited |
Checks the distribution validity for simulation.
Reimplemented in SpecularSimulation, OffSpecularSimulation, and DepthProbeSimulation.
Definition at line 139 of file ISimulation.h.
Referenced by ISimulation::addParameterDistribution().
|
staticinherited |
Definition at line 103 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by Lattice3D::initialize(), IParticle::registerPosition(), IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
staticinherited |
Definition at line 108 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
staticinherited |
Definition at line 113 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
privateinherited |
Definition at line 161 of file ISimulation.h.
Referenced by ISimulation::ISimulation(), ISimulation::background(), ISimulation::getChildren(), and ISimulation::setBackground().
|
protectedinherited |
Definition at line 99 of file ISimulation2D.h.
Referenced by ISimulation2D::addDataToCache(), initSimulationElementVector(), OffSpecularSimulation::initSimulationElementVector(), and ISimulation2D::moveDataFromCache().
|
privateinherited |
Definition at line 104 of file ISimulation2D.h.
Referenced by ISimulation2D::generateSimulationElements(), ISimulation2D::numberOfSimulationElements(), and ISimulation2D::prepareSimulation().
|
privateinherited |
Definition at line 159 of file ISimulation.h.
Referenced by ISimulation::addParameterDistribution(), ISimulation::getDistributionHandler(), and ISimulation::runSimulation().
|
privateinherited |
Definition at line 160 of file ISimulation.h.
Referenced by ISimulation::beam(), ISimulation::detector(), ISimulation::getDetector(), ISimulation::initialize(), ISimulation::instrument(), and ISimulation::setInstrument().
|
privateinherited |
Definition at line 73 of file IParametricComponent.h.
Referenced by IParametricComponent::getName(), and IParametricComponent::setName().
|
protectedinherited |
Definition at line 88 of file INode.h.
Referenced by INode::INode().
|
privateinherited |
Definition at line 156 of file ISimulation.h.
Referenced by ISimulation::getOptions(), ISimulation::options(), ISimulation::runSimulation(), ISimulation::runSingleSimulation(), and ISimulation::setOptions().
|
protectedinherited |
Definition at line 89 of file INode.h.
Referenced by INode::INode(), and IFootprintFactor::setWidthRatio().
|
privateinherited |
Definition at line 83 of file INode.h.
Referenced by INode::displayName(), INode::parent(), and INode::setParent().
|
privateinherited |
parameter pool (kind of pointer-to-implementation)
Definition at line 74 of file IParametricComponent.h.
Referenced by IParametricComponent::createParameterTree(), IParametricComponent::parameter(), IParametricComponent::parameterPool(), IParametricComponent::registerParameter(), IParametricComponent::removeParameter(), and IParametricComponent::setParameterValue().
|
privateinherited |
Definition at line 157 of file ISimulation.h.
Referenced by ISimulation::progress(), ISimulation::runSimulation(), ISimulation::setTerminalProgressMonitor(), and ISimulation::subscribe().
|
privateinherited |
Definition at line 158 of file ISimulation.h.
Referenced by ISimulation::getChildren(), ISimulation::initialize(), ISimulation::prepareSimulation(), ISimulation::sample(), ISimulation::setSample(), and ISimulation::setSampleBuilder().
|
protectedinherited |
Definition at line 98 of file ISimulation2D.h.
Referenced by ISimulation2D::addBackgroundIntensity(), ISimulation2D::addDataToCache(), ISimulation2D::generateSingleThreadedComputation(), initSimulationElementVector(), OffSpecularSimulation::initSimulationElementVector(), ISimulation2D::moveDataFromCache(), ISimulation2D::normalize(), ISimulation2D::rawResults(), result(), ISimulation2D::setRawResults(), OffSpecularSimulation::transferDetectorImage(), and OffSpecularSimulation::transferResultsToIntensityMap().