$extrastylesheet
Dakota  Version 6.2
Public Member Functions | Protected Member Functions | Protected Attributes
MatlabInterface Class Reference
Inheritance diagram for MatlabInterface:
DirectApplicInterface ApplicationInterface Interface

List of all members.

Public Member Functions

 MatlabInterface (const ProblemDescDB &problem_db)
 Constructor: start Matlab engine.
 ~MatlabInterface ()
 Destructor: close Matlab engine.

Protected Member Functions

virtual int derived_map_ac (const String &ac_name)
 execute an analysis code portion of a direct evaluation invocation
int matlab_engine_run (const Dakota::String &ac_name)
 Helper function supporting derived_map_ac. Sends data to Matlab, executes analysis, collects return data.
int matlab_field_prep (mxArray *dakota_matlab, const char *field_name)
 check that the dakota_matlab strucutre has the specified field_name and add if necessary; free structure memory in preparation for new alloc

Protected Attributes

engine * matlabEngine
 pointer to the MATLAB engine used for direct evaluations

Detailed Description

Specialization of DirectApplicInterface to link to Matlab analysis drivers. Includes convenience functions to map data to/from Matlab


Member Function Documentation

int derived_map_ac ( const String &  ac_name) [protected, virtual]

execute an analysis code portion of a direct evaluation invocation

Matlab specialization of dervied analysis components.

Reimplemented from DirectApplicInterface.

References ApplicationInterface::analysisServerId, and MatlabInterface::matlab_engine_run().

int matlab_engine_run ( const Dakota::String &  ac_name) [protected]

Helper function supporting derived_map_ac. Sends data to Matlab, executes analysis, collects return data.

Direct interface to Matlab through Mathworks external API. m-file executed is specified through analysis_drivers, extra strings through analysis_components. (Original BMA 11/28/2005)

Special thanks to Lee Peterson for substantial enhancements 12/15/2007: Added output buffer for the MATLAB command response and error messages Made the Dakota variable persistent in the MATLAB engine workspace Added robustness to the user deleting required Dakota fields

References Dakota::abort_handler(), DirectApplicInterface::analysisComponents, DirectApplicInterface::analysisDriverIndex, Interface::currEvalId, DirectApplicInterface::directFnASV, DirectApplicInterface::directFnDVV, Dakota::FIELD_NAMES, DirectApplicInterface::fnGrads, DirectApplicInterface::fnHessians, Interface::fnLabels, DirectApplicInterface::fnVals, DirectApplicInterface::gradFlag, DirectApplicInterface::hessFlag, MatlabInterface::matlab_field_prep(), MatlabInterface::matlabEngine, DirectApplicInterface::numACV, DirectApplicInterface::numADIV, DirectApplicInterface::numADRV, Dakota::NUMBER_OF_FIELDS, DirectApplicInterface::numDerivVars, DirectApplicInterface::numFns, DirectApplicInterface::numVars, Interface::outputLevel, DirectApplicInterface::xC, DirectApplicInterface::xCLabels, DirectApplicInterface::xDI, DirectApplicInterface::xDILabels, DirectApplicInterface::xDR, and DirectApplicInterface::xDRLabels.

Referenced by MatlabInterface::derived_map_ac().


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