BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation. More...
Public Member Functions | |
ISimulation () | |
ISimulation (const Beam &beam, const IDetector &detector) | |
ISimulation (const Beam &beam, const MultiLayer &sample, const IDetector &detector) | |
virtual | ~ISimulation () |
virtual void | accept (INodeVisitor *visitor) const =0 |
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 |
virtual ISimulation * | clone () const =0 |
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 |
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 |
virtual size_t | intensityMapSize () const =0 |
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 |
virtual void | prepareSimulation () |
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) |
virtual SimulationResult | result () const =0 |
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 | 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 | |
ISimulation (const ISimulation &other) | |
virtual void | initSimulationElementVector ()=0 |
Initializes the vector of ISimulation elements. More... | |
virtual size_t | numberOfSimulationElements () const =0 |
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 | |
const size_t | m_NP |
std::vector< double > | m_P |
Private Member Functions | |
virtual void | addBackgroundIntensity (size_t start_ind, size_t n_elements)=0 |
virtual void | addDataToCache (double weight)=0 |
virtual std::unique_ptr< IComputation > | generateSingleThreadedComputation (size_t start, size_t n_elements)=0 |
Generate a single threaded computation for a given range of simulation elements. More... | |
void | initialize () |
virtual void | moveDataFromCache ()=0 |
virtual void | normalize (size_t start_ind, size_t n_elements)=0 |
Normalize the detector counts to beam intensity, to solid angle, and to exposure angle. More... | |
virtual std::vector< double > | rawResults () const =0 |
void | runSingleSimulation (size_t batch_start, size_t batch_size, double weight=1.0) |
Runs a single simulation with fixed parameter values. More... | |
virtual void | setRawResults (const std::vector< double > &raw_data)=0 |
virtual void | validateParametrization (const ParameterDistribution &) const |
Checks the distribution validity for simulation. More... | |
Private Attributes | |
std::unique_ptr< IBackground > | m_background |
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 |
Friends | |
class | MPISimulation |
Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.
Holds the common infrastructure to run a simulation: multithreading, batch processing, weighting over parameter distributions, ...
Definition at line 38 of file ISimulation.h.
ISimulation::ISimulation | ( | const Beam & | beam, |
const MultiLayer & | sample, | ||
const IDetector & | detector | ||
) |
Definition at line 116 of file ISimulation.cpp.
References initialize(), sample(), and setSample().
ISimulation::ISimulation | ( | ) |
Definition at line 130 of file ISimulation.cpp.
References initialize().
|
virtualdefault |
Definition at line 124 of file ISimulation.cpp.
References initialize().
|
protected |
Definition at line 135 of file ISimulation.cpp.
References initialize(), m_background, and setBackground().
|
pure virtualinherited |
Calls the INodeVisitor's visit method.
Implemented in FormFactorDecoratorMaterial, FormFactorWeighted, FormFactorCrystal, FormFactorCoreShell, Lattice3D, MisesGaussPeakShape, MisesFisherGaussPeakShape, LorentzFisherPeakShape, GaussFisherPeakShape, IsotropicLorentzPeakShape, IsotropicGaussPeakShape, ParticleLayout, InterferenceFunctionHardDisk, InterferenceFunctionFinite3DLattice, InterferenceFunctionFinite2DLattice, InterferenceFunction3DLattice, InterferenceFunction2DSuperLattice, InterferenceFunction2DParaCrystal, InterferenceFunction2DLattice, InterferenceFunction1DLattice, SphericalDetector, SpecularDetector1D, FootprintSquare, FootprintGauss, Beam, OffSpecularSimulation, GISASSimulation, PoissonNoiseBackground, ConstantBackground, FormFactorSphereLogNormalRadius, FormFactorSphereGaussianRadius, FormFactorGaussSphere, FormFactorDecoratorRotation, FormFactorDecoratorPositionFactor, SampleProvider, SampleBuilderNode, ParticleDistribution, ParticleCoreShell, ParticleComposition, Particle, MesoCrystal, Crystal, MultiLayer, Layer, HexagonalLattice2D, SquareLattice2D, BasicLattice2D, FormFactorTruncatedSpheroid, FormFactorTruncatedSphere, FormFactorTruncatedCube, FormFactorTetrahedron, FormFactorSawtoothRippleLorentz, FormFactorSawtoothRippleGauss, FormFactorSawtoothRippleBox, FormFactorPyramid, FormFactorPrism6, FormFactorPrism3, FormFactorLongBoxLorentz, FormFactorLongBoxGauss, FormFactorIcosahedron, FormFactorHollowSphere, FormFactorHemiEllipsoid, FormFactorFullSpheroid, FormFactorFullSphere, FormFactorEllipsoidalCylinder, FormFactorDot, FormFactorDodecahedron, FormFactorCylinder, FormFactorCuboctahedron, FormFactorCosineRippleLorentz, FormFactorCosineRippleGauss, FormFactorCosineRippleBox, FormFactorCone6, FormFactorCone, FormFactorCantellatedCube, FormFactorBox, FormFactorBarLorentz, FormFactorBarGauss, FormFactorAnisoPyramid, FTDistribution2DVoigt, FTDistribution2DCone, FTDistribution2DGate, FTDistribution2DGauss, FTDistribution2DCauchy, FTDistribution1DVoigt, FTDistribution1DCosine, FTDistribution1DTriangle, FTDistribution1DGate, FTDistribution1DGauss, FTDistribution1DCauchy, FTDecayFunction2DVoigt, FTDecayFunction2DGauss, FTDecayFunction2DCauchy, FTDecayFunction1DVoigt, FTDecayFunction1DTriangle, FTDecayFunction1DGauss, FTDecayFunction1DCauchy, InterferenceFunctionTwin, InterferenceFunctionRadialParaCrystal, InterferenceFunctionNone, DistributionTrapezoid, DistributionCosine, DistributionLogNormal, DistributionGaussian, DistributionLorentz, DistributionGate, ResolutionFunction2DGaussian, ConvolutionDetectorResolution, Instrument, RectangularDetector, IsGISAXSDetector, DetectionProperties, SpecularSimulation, DepthProbeSimulation, LayerRoughness, LayerInterface, RotationEuler, RotationZ, RotationY, RotationX, IdentityRotation, and IAbstractParticle.
|
privatepure virtual |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
Referenced by runSingleSimulation().
|
privatepure virtual |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
Referenced by runSingleSimulation().
void ISimulation::addParameterDistribution | ( | const ParameterDistribution & | par_distr | ) |
Definition at line 272 of file ISimulation.cpp.
References DistributionHandler::addParameterDistribution(), m_distribution_handler, and validateParametrization().
void ISimulation::addParameterDistribution | ( | const std::string & | param_name, |
const IDistribution1D & | distribution, | ||
size_t | nbr_samples, | ||
double | sigma_factor = 0.0 , |
||
const RealLimits & | limits = RealLimits() |
||
) |
Definition at line 264 of file ISimulation.cpp.
Referenced by StandardSimulations::MiniGISASBeamDivergence(), and TransformToDomain::setBeamDistribution().
|
inline |
Definition at line 74 of file ISimulation.h.
References m_background.
Referenced by DepthProbeSimulation::addBackgroundIntensity(), ISimulation2D::addBackgroundIntensity(), SpecularSimulation::addBackgroundIntensity(), and TransformFromDomain::setBackground().
|
inline |
Definition at line 58 of file ISimulation.h.
References Instrument::beam(), and 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(), SpecularSimulation::normalize(), OffSpecularSimulation::result(), DepthProbeSimulation::setBeamParameters(), TransformFromDomain::setGISASBeamItem(), TransformFromDomain::setOffSpecularBeamItem(), and TransformFromDomain::setSpecularBeamItem().
|
inline |
Definition at line 59 of file ISimulation.h.
References Instrument::beam(), and m_instrument.
|
pure virtual |
Implements ICloneable.
Implemented in ISimulation2D, SpecularSimulation, OffSpecularSimulation, GISASSimulation, and DepthProbeSimulation.
Referenced by GUIObjectBuilder::populateSampleModelFromSim().
SimulationResult ISimulation::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.
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(), 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 runSimulation(), DepthProbeSimulation::validateParametrization(), OffSpecularSimulation::validateParametrization(), and SpecularSimulation::validateParametrization().
|
inline |
Definition at line 63 of file ISimulation.h.
References Instrument::detector(), and m_instrument.
Referenced by SpecularSimulation::SpecularSimulation(), StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), OffSpecularSimulation::checkInitialization(), convertData(), ISimulation2D::generateSimulationElements(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), GISASSimulation::intensityMapSize(), OffSpecularSimulation::intensityMapSize(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), GISASSimulation::prepareSimulation(), SpecularSimulation::prepareSimulation(), GISASSimulation::result(), DepthProbeSimulation::setBeamParameters(), ISimulation2D::setDetector(), setDetectorResolutionFunction(), SpecularSimulation::setScan(), OffSpecularSimulation::transferDetectorImage(), OffSpecularSimulation::transferResultsToIntensityMap(), and OffSpecularSimulation::updateIntensityMap().
|
inline |
Definition at line 64 of file ISimulation.h.
References Instrument::detector(), and 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().
|
privatepure virtual |
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 |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
Referenced by runSingleSimulation().
|
virtual |
Returns a vector of children.
Reimplemented from INode.
Definition at line 254 of file ISimulation.cpp.
References SampleProvider::getChildren(), instrument(), m_background, m_sample_provider, and result().
|
inline |
Definition at line 61 of file ISimulation.h.
References Instrument::getDetector(), and m_instrument.
Referenced by ISimulation2D::detector2D(), TransformFromDomain::setDetector(), and TransformFromDomain::setDetectorMasks().
|
inline |
Definition at line 62 of file ISimulation.h.
References Instrument::getDetector(), and m_instrument.
|
inline |
Definition at line 88 of file ISimulation.h.
References 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().
|
inline |
|
inline |
Definition at line 91 of file ISimulation.h.
References m_options.
Referenced by StandardSimulations::MiniGISASMonteCarlo(), StandardSimulations::MiniGISASSpecularPeak(), GUIObjectBuilder::populateDocumentModel(), and TransformToDomain::setSimulationOptions().
|
private |
Definition at line 151 of file ISimulation.cpp.
References m_instrument, m_sample_provider, and INode::registerChild().
Referenced by ISimulation().
|
protectedpure virtual |
Initializes the vector of ISimulation elements.
Implemented in SpecularSimulation, OffSpecularSimulation, GISASSimulation, and DepthProbeSimulation.
Referenced by runSingleSimulation(), and ISimulation2D::setRawResults().
|
inline |
|
inline |
Definition at line 55 of file ISimulation.h.
References m_instrument.
Referenced by SpecularSimulation::SpecularSimulation(), getChildren(), SpecularSimulation::initialize(), SpecularSimulation::initSimulationElementVector(), GUIObjectBuilder::populateInstrumentModel(), GISASSimulation::prepareSimulation(), SpecularSimulation::prepareSimulation(), GISASSimulation::result(), DepthProbeSimulation::setBeamParameters(), OffSpecularSimulation::setBeamParameters(), GISASSimulation::setBeamParameters(), ISimulation2D::setDetector(), and SpecularSimulation::setScan().
|
pure virtual |
Returns the total number of the intensity values in the simulation result.
Implemented in SpecularSimulation, OffSpecularSimulation, GISASSimulation, and DepthProbeSimulation.
|
privatepure virtual |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
Referenced by runSimulation().
|
privatepure virtual |
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 |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
Referenced by runSingleSimulation().
|
protectedpure virtual |
Gets the number of elements this simulation needs to calculate.
Implemented in SpecularSimulation, OffSpecularSimulation, ISimulation2D, and DepthProbeSimulation.
Referenced by runSimulation().
|
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().
|
inlineprotected |
Definition at line 124 of file ISimulation.h.
References m_options.
Referenced by DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), and 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().
|
virtual |
Put into a clean state for running a simulation.
Reimplemented in SpecularSimulation, OffSpecularSimulation, ISimulation2D, and GISASSimulation.
Definition at line 182 of file ISimulation.cpp.
References MultiLayerUtils::ContainsCompatibleMaterials(), m_sample_provider, SampleProvider::sample(), and SampleProvider::updateSample().
Referenced by ISimulation2D::prepareSimulation(), SpecularSimulation::prepareSimulation(), and runSimulation().
|
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().
|
inlineprotected |
Definition at line 125 of file ISimulation.h.
References m_progress.
Referenced by DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), and SpecularSimulation::generateSingleThreadedComputation().
|
privatepure virtual |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
|
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(), initialize(), MesoCrystal::initialize(), Beam::operator=(), Instrument::operator=(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), 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().
|
pure virtual |
Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays.
Implemented in SpecularSimulation, OffSpecularSimulation, GISASSimulation, and DepthProbeSimulation.
Referenced by ISimulation2D::generateSimulationElements(), getChildren(), ISimulation2D::rawResults(), and JobItemUtils::setResults().
void ISimulation::runMPISimulation | ( | ) |
Run a simulation in a MPI environment.
Definition at line 226 of file ISimulation.cpp.
References MPISimulation::runSimulation().
void ISimulation::runSimulation | ( | ) |
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(), m_distribution_handler, m_options, m_progress, moveDataFromCache(), numberOfSimulationElements(), prepareSimulation(), ProgressHandler::reset(), runSingleSimulation(), ProgressHandler::setExpectedNTicks(), DistributionHandler::setParameterToMeans(), DistributionHandler::setParameterValues(), and transferResultsToIntensityMap().
Referenced by JobWorker::start().
|
private |
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 addBackgroundIntensity(), addDataToCache(), ASSERT, generateSingleThreadedComputation(), SimulationOptions::getNumberOfThreads(), initSimulationElementVector(), m_options, and normalize().
Referenced by runSimulation().
const MultiLayer * ISimulation::sample | ( | ) | const |
Definition at line 238 of file ISimulation.cpp.
References m_sample_provider, and SampleProvider::sample().
Referenced by ISimulation(), DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), setSample(), and DepthProbeSimulation::validityCheck().
void ISimulation::setBackground | ( | const IBackground & | bg | ) |
Definition at line 248 of file ISimulation.cpp.
References IBackground::clone(), m_background, and INode::registerChild().
Referenced by ISimulation(), and StandardSimulations::ConstantBackgroundGISAS().
void ISimulation::setDetectorResolutionFunction | ( | const IResolutionFunction2D & | resolution_function | ) |
Definition at line 177 of file ISimulation.cpp.
References detector(), and IDetector::setResolutionFunction().
Referenced by StandardSimulations::MiniGISASDetectorResolution().
void ISimulation::setInstrument | ( | const Instrument & | instrument_ | ) |
Definition at line 158 of file ISimulation.cpp.
References m_instrument, and 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(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), Beam::operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().
|
inline |
Definition at line 90 of file ISimulation.h.
References m_options, and 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().
|
privatepure virtual |
Implemented in SpecularSimulation, ISimulation2D, and DepthProbeSimulation.
void ISimulation::setSample | ( | const MultiLayer & | sample | ) |
The MultiLayer object will not be owned by the ISimulation object.
Definition at line 233 of file ISimulation.cpp.
References m_sample_provider, sample(), and SampleProvider::setSample().
Referenced by ISimulation().
void ISimulation::setSampleBuilder | ( | const std::shared_ptr< ISampleBuilder > & | sample_builder | ) |
Definition at line 243 of file ISimulation.cpp.
References m_sample_provider, and SampleProvider::setBuilder().
void ISimulation::setTerminalProgressMonitor | ( | ) |
Initializes a progress monitor that prints to stdout.
Definition at line 166 of file ISimulation.cpp.
References 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().
|
inline |
Definition at line 94 of file ISimulation.h.
References m_progress, and ProgressHandler::subscribe().
Referenced by JobWorker::start().
|
inlineprotectedvirtual |
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 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().
|
inlineprotectedvirtual |
Reimplemented in OffSpecularSimulation.
Definition at line 119 of file ISimulation.h.
Referenced by ISimulation2D::setDetectorParameters(), and setInstrument().
|
inlineprivatevirtual |
Checks the distribution validity for simulation.
Reimplemented in SpecularSimulation, OffSpecularSimulation, and DepthProbeSimulation.
Definition at line 139 of file ISimulation.h.
Referenced by 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().
|
friend |
Definition at line 102 of file ISimulation.h.
|
private |
Definition at line 161 of file ISimulation.h.
Referenced by ISimulation(), background(), getChildren(), and setBackground().
|
private |
Definition at line 159 of file ISimulation.h.
Referenced by addParameterDistribution(), getDistributionHandler(), and runSimulation().
|
private |
Definition at line 160 of file ISimulation.h.
Referenced by beam(), detector(), getDetector(), initialize(), instrument(), and 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().
|
private |
Definition at line 156 of file ISimulation.h.
Referenced by getOptions(), options(), runSimulation(), runSingleSimulation(), and 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().
|
private |
Definition at line 157 of file ISimulation.h.
Referenced by progress(), runSimulation(), setTerminalProgressMonitor(), and subscribe().
|
private |
Definition at line 158 of file ISimulation.h.
Referenced by getChildren(), initialize(), prepareSimulation(), sample(), setSample(), and setSampleBuilder().