BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Collect the different options for simulation.
Definition at line 27 of file SimulationOptions.h.
Public Member Functions | |
SimulationOptions () | |
unsigned | getCurrentBatch () const |
unsigned | getHardwareConcurrency () const |
size_t | getMcPoints () const |
unsigned | getNumberOfBatches () const |
unsigned | getNumberOfThreads () const |
bool | includeSpecular () const |
bool | isIntegrate () const |
void | setIncludeSpecular (bool include_specular) |
void | setMonteCarloIntegration (bool flag=true, size_t mc_points=50) |
Enables/disables MonetCarlo integration. More... | |
void | setNumberOfBatches (int nbatches) |
Sets number of batches to split. More... | |
void | setNumberOfThreads (int nthreads) |
Sets number of threads to use during the simulation (0 - take the default value from the hardware) More... | |
void | setThreadInfo (const ThreadInfo &thread_info) |
Sets the batch and thread information to be used. More... | |
void | setUseAvgMaterials (bool use_avg_materials) |
bool | useAvgMaterials () const |
Private Attributes | |
bool | m_include_specular |
bool | m_mc_integration |
size_t | m_mc_points |
ThreadInfo | m_thread_info |
bool | m_use_avg_materials |
SimulationOptions::SimulationOptions | ( | ) |
Definition at line 22 of file SimulationOptions.cpp.
References BaseUtils::System::getenv(), getHardwareConcurrency(), m_thread_info, and ThreadInfo::n_threads.
unsigned SimulationOptions::getCurrentBatch | ( | ) | const |
Definition at line 75 of file SimulationOptions.cpp.
References ASSERT, ThreadInfo::current_batch, m_thread_info, and ThreadInfo::n_batches.
unsigned SimulationOptions::getHardwareConcurrency | ( | ) | const |
Definition at line 82 of file SimulationOptions.cpp.
Referenced by SimulationOptions(), and setNumberOfThreads().
|
inline |
Definition at line 32 of file SimulationOptions.h.
References m_mc_points.
Referenced by IInterparticleStrategy::MCIntegratedEvaluate().
unsigned SimulationOptions::getNumberOfBatches | ( | ) | const |
Definition at line 69 of file SimulationOptions.cpp.
References ASSERT, m_thread_info, and ThreadInfo::n_batches.
unsigned SimulationOptions::getNumberOfThreads | ( | ) | const |
Definition at line 57 of file SimulationOptions.cpp.
References ASSERT, m_thread_info, and ThreadInfo::n_threads.
|
inline |
bool SimulationOptions::isIntegrate | ( | ) | const |
Definition at line 36 of file SimulationOptions.cpp.
References m_mc_integration, and m_mc_points.
Referenced by IInterparticleStrategy::evaluate().
|
inline |
void SimulationOptions::setMonteCarloIntegration | ( | bool | flag = true , |
size_t | mc_points = 50 |
||
) |
Enables/disables MonetCarlo integration.
flag | If true, MonteCarlo integration will be used, otherwise analytical calculations |
mc_points | Number of points for MonteCarlo integrator |
Definition at line 41 of file SimulationOptions.cpp.
References m_mc_integration, and m_mc_points.
void SimulationOptions::setNumberOfBatches | ( | int | nbatches | ) |
Sets number of batches to split.
Definition at line 63 of file SimulationOptions.cpp.
References ASSERT, m_thread_info, and ThreadInfo::n_batches.
void SimulationOptions::setNumberOfThreads | ( | int | nthreads | ) |
Sets number of threads to use during the simulation (0 - take the default value from the hardware)
Definition at line 47 of file SimulationOptions.cpp.
References ASSERT, getHardwareConcurrency(), m_thread_info, and ThreadInfo::n_threads.
|
inline |
Sets the batch and thread information to be used.
Definition at line 53 of file SimulationOptions.h.
References m_thread_info.
|
inline |
Definition at line 61 of file SimulationOptions.h.
References m_use_avg_materials.
Referenced by swigAPI::defaultMaterialProfileLimits(), and swigAPI::materialProfileSLD().
|
inline |
Definition at line 63 of file SimulationOptions.h.
References m_use_avg_materials.
Referenced by reSample::make().
|
private |
Definition at line 67 of file SimulationOptions.h.
Referenced by includeSpecular(), and setIncludeSpecular().
|
private |
Definition at line 66 of file SimulationOptions.h.
Referenced by isIntegrate(), and setMonteCarloIntegration().
|
private |
Definition at line 69 of file SimulationOptions.h.
Referenced by getMcPoints(), isIntegrate(), and setMonteCarloIntegration().
|
private |
Definition at line 70 of file SimulationOptions.h.
Referenced by SimulationOptions(), getCurrentBatch(), getNumberOfBatches(), getNumberOfThreads(), setNumberOfBatches(), setNumberOfThreads(), and setThreadInfo().
|
private |
Definition at line 68 of file SimulationOptions.h.
Referenced by setUseAvgMaterials(), and useAvgMaterials().