BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IComputation.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Computation/IComputation.cpp
6 //! @brief Implements interface IComputation.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
20 
22  ProgressHandler& progress, bool forcePolarized)
23  : m_sim_options(options)
24  , m_progress(&progress)
25  , m_processed_sample(std::make_unique<ProcessedSample>(sample, options, forcePolarized))
26 {
27 }
28 
29 IComputation::~IComputation() = default;
30 
32 {
34  try {
35  runProtected();
37  } catch (const std::exception& ex) {
38  m_status.setFailed(ex.what());
39  }
40 }
Defines interface IComputation.
Defines class MultiLayer.
Defines class ProcessedSample.
Defines class ProgressHandler.
Defines class SimulationElement.
void setFailed(const std::string &message)
virtual ~IComputation()
virtual void runProtected()=0
IComputation(const MultiLayer &sample, const SimulationOptions &options, ProgressHandler &progress, bool forcePolarized=false)
ComputationStatus m_status
Definition: IComputation.h:53
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:41
Data structure that contains all the necessary data for scattering calculations.
Maintains information about progress of a computation.
Collect the different options for simulation.
Definition: filesystem.h:81