BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Main class to run a specular simulation. More...
Public Member Functions | |
SpecularSimulation () | |
~SpecularSimulation () override | |
void | accept (INodeVisitor *visitor) const final |
Calls the INodeVisitor's visit method. 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 |
SpecularSimulation * | 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... | |
const IAxis * | coordinateAxis () const |
Returns a pointer to coordinate axis. 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... | |
const ISpecularScan * | dataHandler () const |
Returns internal data handler. More... | |
IDetector & | detector () |
const IDetector & | detector () const |
std::string | displayName () const |
Returns display name, composed from the name of node and it's copy number. More... | |
const IFootprintFactor * | footprintFactor () const |
Returns a pointer to footprint factor holder. 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... | |
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 | 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 | 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 | setScan (const ISpecularScan &scan) |
Sets chosen specular scan to the simulation. More... | |
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 | |
const SimulationOptions & | options () const |
ProgressHandler & | progress () |
virtual void | transferResultsToIntensityMap () |
Creates the appropriate data structure (e.g. More... | |
virtual void | updateIntensityMap () |
Protected Attributes | |
const size_t | m_NP |
std::vector< double > | m_P |
Private Member Functions | |
SpecularSimulation (const SpecularSimulation &other) | |
void | addBackgroundIntensity (size_t start_ind, size_t n_elements) override |
void | addDataToCache (double weight) override |
void | checkCache () const |
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... | |
void | initialize () |
Initializes simulation. More... | |
void | initSimulationElementVector () override |
Initializes the vector of ISimulation elements. More... | |
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... | |
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 |
void | validateParametrization (const ParameterDistribution &par_distr) const override |
Checks the distribution validity for simulation. More... | |
Private Attributes | |
std::unique_ptr< IBackground > | m_background |
std::vector< double > | m_cache |
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 |
std::unique_ptr< ISpecularScan > | m_scan |
std::vector< SpecularSimulationElement > | m_sim_elements |
Main class to run a specular simulation.
Definition at line 32 of file SpecularSimulation.h.
SpecularSimulation::SpecularSimulation | ( | ) |
Definition at line 61 of file SpecularSimulation.cpp.
References ISimulation::detector(), initialize(), ISimulation::instrument(), and Instrument::setDetector().
Referenced by clone().
|
overridedefault |
|
private |
Definition at line 68 of file SpecularSimulation.cpp.
References initialize().
|
inlinefinalvirtual |
Calls the INodeVisitor's visit method.
Implements INode.
Definition at line 42 of file SpecularSimulation.h.
|
overrideprivatevirtual |
Implements ISimulation.
Definition at line 225 of file SpecularSimulation.cpp.
References ISimulation::background(), and m_sim_elements.
|
overrideprivatevirtual |
Implements ISimulation.
Definition at line 235 of file SpecularSimulation.cpp.
References checkCache(), m_cache, and m_sim_elements.
|
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(), 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(), GISASSimulation::initSimulationElementVector(), OffSpecularSimulation::initSimulationElementVector(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), DepthProbeSimulation::normalize(), ISimulation2D::normalize(), 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.
|
private |
Definition at line 174 of file SpecularSimulation.cpp.
References m_cache, and m_sim_elements.
Referenced by addDataToCache(), and moveDataFromCache().
|
overridevirtual |
Implements ISimulation.
Definition at line 79 of file SpecularSimulation.cpp.
References SpecularSimulation().
|
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().
const IAxis * SpecularSimulation::coordinateAxis | ( | ) | const |
Returns a pointer to coordinate axis.
Definition at line 134 of file SpecularSimulation.cpp.
References m_scan.
Referenced by result(), and TransformFromDomain::setSpecularBeamItem().
|
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 validateParametrization().
|
inline |
Returns internal data handler.
Definition at line 63 of file SpecularSimulation.h.
References m_scan.
Referenced by TransformFromDomain::setSpecularBeamItem().
|
inlineinherited |
Definition at line 63 of file ISimulation.h.
References Instrument::detector(), and ISimulation::m_instrument.
Referenced by SpecularSimulation(), StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), OffSpecularSimulation::checkInitialization(), ISimulation::convertData(), ISimulation2D::generateSimulationElements(), ISimulation2D::generateSingleThreadedComputation(), generateSingleThreadedComputation(), GISASSimulation::intensityMapSize(), OffSpecularSimulation::intensityMapSize(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), GISASSimulation::prepareSimulation(), prepareSimulation(), GISASSimulation::result(), DepthProbeSimulation::setBeamParameters(), ISimulation2D::setDetector(), ISimulation::setDetectorResolutionFunction(), 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 |
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().
const IFootprintFactor * SpecularSimulation::footprintFactor | ( | ) | const |
Returns a pointer to footprint factor holder.
Definition at line 142 of file SpecularSimulation.cpp.
References m_scan.
Referenced by TransformFromDomain::setSpecularBeamItem().
|
overrideprivatevirtual |
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 164 of file SpecularSimulation.cpp.
References DetectionProperties::analyzerDirection(), ASSERT, IDetector::detectionProperties(), ISimulation::detector(), 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 |
Initializes simulation.
Definition at line 196 of file SpecularSimulation.cpp.
References Instrument::beam(), ISimulation::instrument(), RealLimits::limited(), M_PI_2, IParametricComponent::parameter(), RealParameter::setLimits(), and IParametricComponent::setName().
Referenced by SpecularSimulation().
|
overrideprivatevirtual |
Initializes the vector of ISimulation elements.
Implements ISimulation.
Definition at line 152 of file SpecularSimulation.cpp.
References ISimulation::instrument(), m_cache, m_scan, and m_sim_elements.
Referenced by setRawResults().
|
inlineinherited |
|
inlineinherited |
Definition at line 55 of file ISimulation.h.
References ISimulation::m_instrument.
Referenced by SpecularSimulation(), ISimulation::getChildren(), initialize(), initSimulationElementVector(), GUIObjectBuilder::populateInstrumentModel(), GISASSimulation::prepareSimulation(), prepareSimulation(), GISASSimulation::result(), DepthProbeSimulation::setBeamParameters(), OffSpecularSimulation::setBeamParameters(), GISASSimulation::setBeamParameters(), ISimulation2D::setDetector(), and setScan().
|
overridevirtual |
Returns the total number of the intensity values in the simulation result.
Implements ISimulation.
Definition at line 147 of file SpecularSimulation.cpp.
References m_scan.
|
overrideprivatevirtual |
Implements ISimulation.
Definition at line 242 of file SpecularSimulation.cpp.
References checkCache(), m_cache, and m_sim_elements.
|
overrideprivatevirtual |
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 208 of file SpecularSimulation.cpp.
References ISimulation::beam(), Beam::intensity(), m_scan, and m_sim_elements.
|
overrideprivatevirtual |
Gets the number of elements this simulation needs to calculate.
Implements ISimulation.
Definition at line 93 of file SpecularSimulation.cpp.
References m_scan.
|
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(), 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(), 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 84 of file SpecularSimulation.cpp.
References ISimulation::detector(), Instrument::initDetector(), ISimulation::instrument(), and ISimulation::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 generateSingleThreadedComputation().
|
overrideprivatevirtual |
Implements ISimulation.
Definition at line 251 of file SpecularSimulation.cpp.
References m_sim_elements, and 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.
If simulation was not run, returns an array of proper size filled with zeros.
Implements ISimulation.
Definition at line 98 of file SpecularSimulation.cpp.
References OutputData< T >::addAxis(), coordinateAxis(), UnitConverter1D::createUnitConverter(), m_scan, m_sim_elements, OutputData< T >::setAllTo(), and OutputData< T >::setRawDataVector().
Referenced by rawResults().
|
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(), 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().
|
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(), GISASSimulation::initialize(), OffSpecularSimulation::initialize(), 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().
|
overrideprivatevirtual |
Implements ISimulation.
Definition at line 260 of file SpecularSimulation.cpp.
References initSimulationElementVector(), m_sim_elements, and ISimulation::transferResultsToIntensityMap().
|
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().
void SpecularSimulation::setScan | ( | const ISpecularScan & | scan | ) |
Sets chosen specular scan to the simulation.
Definition at line 112 of file SpecularSimulation.cpp.
References IDetector::addAxis(), ISpecularScan::clone(), ISpecularScan::coordinateAxis(), ISimulation::detector(), Instrument::detector(), ISimulation::instrument(), IAxis::lowerBound(), m_scan, and Instrument::setBeamParameters().
Referenced by StandardSimulations::BasicSpecularQ(), StandardSimulations::SpecularDivergentBeam(), StandardSimulations::SpecularWithGaussianBeam(), StandardSimulations::SpecularWithSquareBeam(), StandardSimulations::TOFRWithPointwiseResolution(), and StandardSimulations::TOFRWithRelativeResolution().
|
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 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().
|
overrideprivatevirtual |
Checks the distribution validity for simulation.
Reimplemented from ISimulation.
Definition at line 181 of file SpecularSimulation.cpp.
References INode::createParameterTree(), ParameterDistribution::getDistribution(), ParameterDistribution::getMainParameterName(), and IDistribution1D::getMean().
|
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().
|
private |
Definition at line 105 of file SpecularSimulation.h.
Referenced by addDataToCache(), checkCache(), initSimulationElementVector(), and moveDataFromCache().
|
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().
|
private |
Definition at line 103 of file SpecularSimulation.h.
Referenced by coordinateAxis(), dataHandler(), footprintFactor(), initSimulationElementVector(), intensityMapSize(), normalize(), numberOfSimulationElements(), result(), and setScan().
|
private |
Definition at line 104 of file SpecularSimulation.h.
Referenced by addBackgroundIntensity(), addDataToCache(), checkCache(), generateSingleThreadedComputation(), initSimulationElementVector(), moveDataFromCache(), normalize(), rawResults(), result(), and setRawResults().