Dakota  Version 7.0
Explore and Predict with Confidence
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Study Class Reference

Owns runtime services and factories for a library-mode study. More...

Classes

class  MethodFactory
 Constructs methods using an owning Study's runtime services. More...
 
class  ModelFactory
 Constructs models using an owning Study's runtime services. More...
 

Public Member Functions

 Study (const StudyConfig &config=StudyConfig{})
 Construct a serial study context. More...
 
 Study (MPI_Comm dakota_mpi_comm, const StudyConfig &config=StudyConfig{})
 Construct a study on an application-supplied MPI communicator. More...
 
 ~Study ()
 Release the study context after all constructed components are finished.
 
std::shared_ptr< StudyServices > services () const
 Return the shared service bundle used by constructed components.
 
std::shared_ptr< ParallelLibrary > parallel_library () const
 Return the parallel runtime owned by this study.
 
std::shared_ptr< OutputManager > output_manager () const
 Return the output manager owned by this study.
 
std::shared_ptr< RunOptions > run_options () const
 Return the configured execution-phase options.
 
Variables variables (const IRStore &variables_store) const
 Construct variables from materialized input representation. More...
 
Variables variables (const nlohmann::json &variables_json) const
 Validate and construct variables from a JSON block fragment. More...
 
Response responses (const IRStore &responses_store, const Variables &variables) const
 Construct responses from materialized input representation. More...
 
Response responses (const nlohmann::json &responses_json, const Variables &variables) const
 Validate and construct responses from a JSON block fragment. More...
 
std::shared_ptr< Interface > interface (const IRStore &interface_store) const
 Construct an interface from materialized input representation. More...
 
std::shared_ptr< Interface > interface (const nlohmann::json &interface_json) const
 Validate and construct an interface from a JSON block fragment. More...
 
MethodFactory method () const
 Return a method factory tied to this study's runtime services.
 
ModelFactory model () const
 Return a model factory tied to this study's runtime services.
 
void run (Iterator &iterator) const
 Execute a top-level iterator. More...
 
void run (const std::shared_ptr< Iterator > &iterator) const
 Execute a shared top-level iterator. More...
 

Private Member Functions

 Study (std::shared_ptr< MPIManager > mpi_manager, const StudyConfig &config)
 

Private Attributes

std::shared_ptr< MPIManager > mpiManager
 
std::shared_ptr< ProgramOptions > programOptions
 
std::shared_ptr< OutputManager > outputManager
 
std::shared_ptr< RunOptions > runOptions
 
std::shared_ptr< ParallelLibrary > parallelLibrary
 
std::shared_ptr< StudyServices > studyServices
 
std::shared_ptr< StudyRuntime > studyRuntime
 

Detailed Description

Owns runtime services and factories for a library-mode study.

Construct variables, responses, interfaces, models, and methods from the leaves inward, then pass the top-level Iterator to run(). The Study must outlive every component constructed from it. Components from different Study instances may have incompatible runtime services and must not be combined.

Constructor & Destructor Documentation

◆ Study() [1/2]

Study ( const StudyConfig &  config = StudyConfig{})
explicit

Construct a serial study context.

Parameters
configOutput and execution-phase settings.

◆ Study() [2/2]

Study ( MPI_Comm  dakota_mpi_comm,
const StudyConfig &  config = StudyConfig{} 
)

Construct a study on an application-supplied MPI communicator.

Parameters
dakota_mpi_commCommunicator used by Dakota; ownership remains with the caller.
configOutput and execution-phase settings.

Member Function Documentation

◆ variables() [1/2]

Variables variables ( const IRStore &  variables_store) const

◆ variables() [2/2]

Variables variables ( const nlohmann::json &  variables_json) const

Validate and construct variables from a JSON block fragment.

Parameters
variables_jsonChildren of a variables block, without a top-level wrapper.
Returns
Variables associated with this study.
Exceptions
std::exceptionif validation or materialization fails.

References Study::variables().

◆ responses() [1/2]

Response responses ( const IRStore &  responses_store,
const Variables &  variables 
) const

Construct responses from materialized input representation.

Parameters
responses_storeMaterialized responses block.
variablesVariables whose active view determines response derivatives.
Returns
Response definition associated with variables.

References Study::variables().

Referenced by Study::responses().

◆ responses() [2/2]

Response responses ( const nlohmann::json &  responses_json,
const Variables &  variables 
) const

Validate and construct responses from a JSON block fragment.

Parameters
responses_jsonChildren of a responses block, without a top-level wrapper.
variablesVariables whose active view determines response derivatives.
Returns
Response definition associated with variables.
Exceptions
std::exceptionif validation or materialization fails.

References Study::responses(), and Study::variables().

◆ interface() [1/2]

std::shared_ptr< Interface > interface ( const IRStore &  interface_store) const

Construct an interface from materialized input representation.

Parameters
interface_storeMaterialized interface block.
Returns
Interface sharing this study's runtime services.
Exceptions
std::runtime_errorif the interface type is not supported by the DI API.

Referenced by Study::interface(), and Study::ModelFactory::single().

◆ interface() [2/2]

std::shared_ptr< Interface > interface ( const nlohmann::json &  interface_json) const

Validate and construct an interface from a JSON block fragment.

Parameters
interface_jsonChildren of an interface block, without a top-level wrapper.
Returns
Interface sharing this study's runtime services.
Exceptions
std::exceptionif validation, materialization, or construction fails.

References Study::interface().

◆ run() [1/2]

void run ( Iterator &  iterator) const

Execute a top-level iterator.

Parameters
iteratorIterator constructed with compatible study services.

Referenced by Study::run().

◆ run() [2/2]

void run ( const std::shared_ptr< Iterator > &  iterator) const

Execute a shared top-level iterator.

Parameters
iteratorNon-null iterator constructed with compatible study services.
Exceptions
std::runtime_errorif iterator is null.

References Study::run().


The documentation for this class was generated from the following files: