52 throw std::runtime_error(
"GISASSimulation::prepareSimulation() "
53 "-> Error. The detector was not properly configured.");
61 const std::unique_ptr<OutputData<double>> data(
68 if (wavelength <= 0.0)
69 throw std::runtime_error(
70 "ISimulation::setBeamParameters() -> Error. Incoming wavelength <= 0.");
Defines class GISASSimulation.
Defines interface ISampleBuilder.
Declares utilities for unit converters.
An incident neutron or x-ray beam.
Main class to run a Grazing-Incidence Small-Angle Scattering simulation.
void initSimulationElementVector() override
Initializes the vector of ISimulation elements.
void setBeamParameters(double wavelength, double alpha_i, double phi_i)
Sets beam parameters from here (forwarded to Instrument)
size_t intensityMapSize() const override
Returns the total number of the intensity values in the simulation result.
void prepareSimulation() override
Put into a clean state for running a simulation.
SimulationResult result() const override
Returns the results of the simulation in a format that supports unit conversion and export to numpy a...
Abstract detector interface.
void iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const
void setName(const std::string &name)
Abstract base class of OffSpecularSimulation and GISASSimulation.
std::vector< SimulationElement > generateSimulationElements(const Beam &beam)
Generate simulation elements for given beam.
std::vector< SimulationElement > m_sim_elements
void prepareSimulation() override
Put into a clean state for running a simulation.
std::vector< double > m_cache
const Instrument & instrument() const
void setBeamParameters(double wavelength, double alpha_i, double phi_i)
Sets the beam wavelength and incoming angles.
void initDetector()
init detector with beam settings
Our sample model: a stack of layers one below the other.
An iterator for SimulationArea.
Wrapper around OutputData<double> that also provides unit conversions.
std::unique_ptr< IUnitConverter > createConverterForGISAS(const Instrument &instrument)
Helper factory function to use in GISASSimulation.