BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ExportToPython.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Export/ExportToPython.cpp
6 //! @brief Implements ExportToPython namespace.
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 
19 
20 std::string ExportToPython::sampleCode(const MultiLayer& multilayer)
21 {
22  return SampleToPython().sampleCode(multilayer);
23 }
24 
25 std::string ExportToPython::simulationPlotCode(const ISimulation& simulation)
26 {
27  return SimulationToPython().simulationPlotCode(simulation);
28 }
29 
30 std::string ExportToPython::simulationSaveCode(const ISimulation& simulation,
31  const std::string& fname)
32 {
33  return SimulationToPython().simulationSaveCode(simulation, fname);
34 }
Defines ExportToPython namespace.
Defines interface ISimulation.
Defines class SampleToPython.
Defines class SimulationToPython.
Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.
Definition: ISimulation.h:38
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:41
Generates Python code snippet from domain (C++) objects representing sample construction.
std::string sampleCode(const MultiLayer &multilayer)
Write a Python script that allows to run the current simulation.
std::string simulationSaveCode(const ISimulation &simulation, const std::string &fname)
Returns a Python script that runs a simulation and saves the result to a file.
std::string simulationPlotCode(const ISimulation &simulation)
Returns a Python script that runs a simulation and plots the result.
std::string sampleCode(const MultiLayer &multilayer)
std::string simulationSaveCode(const ISimulation &simulation, const std::string &fname)
std::string simulationPlotCode(const ISimulation &simulation)