7.13. DAE Tools Simulator

7.13.1. Overview

7.13.2. Classes

class daeSimulator(app, **kwargs)[source]
done(self, int)[source]
run(showExplorer)[source]
showMessage(msg)[source]
slotAbout()[source]
slotExportSparseMatrixAsMatrixMarketFormat()[source]
slotOpenSparseMatrixImage()[source]
slotPause()[source]
slotResume()[source]
slotRun()[source]
slotShowExplorerAndRun()[source]
class daeSimulationExplorer(qt_app, simulation, **kwargs)[source]
generateCode(language)[source]
static generateHTMLForm(simulation, htmlOutputFile, find_files_dir='.')[source]
static generateJSONSettings(simulation)[source]
property jsonRuntimeSettings
reject(self)[source]
property runtimeSettings
static saveJSONSettings(simulation, filename)[source]
updateSimulation(verbose=False)[source]
class daeSimulationInspector(simulation)[source]
categoryActiveStates = '___ACTIVE_STATES___'
categoryDOFs = '___DOFS___'
categoryDomains = '___DOMAINS___'
categoryInitialConditions = '___INITIAL_CONDITIONS___'
categoryParameters = '___PARAMETERS___'
categoryVariablesToReport = '___VARIABLES_TO_REPORT___'

7.13.3. Web service classes

daeWebService()

The base class for web applications/web services.

daeSimulationWebService()

daeFMI2_CoS_WebService()

class BadRequest[source]

Results in: 400 Bad Request response

class ServerError[source]

Results in: 500 Internal Server Error response

class NoLoggingWSGIRequestHandler(request, client_address, server)[source]

Request handler that suppresses logging to the stderr.

log_message(format, *args)[source]

Log an arbitrary message.

This is used by all other logging functions. Override it if you have specific logging wishes.

The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it’s just like printf!).

The client ip and current date/time are prefixed to every message.

Unicode control characters are replaced with escaped hex before writing the output to stderr.

class daeWebService[source]

The base class for web applications/web services. Performs the low level tasks such as parsing the query to get its arguments and sending responses with results to the clients.

getQueryArguments(environ)[source]

Returns the query arguments’ values as a dictionary object. Can process both GET and POST requests (double check this).

jsonBadRequest(reason, start_response, simulationID)[source]

Returns the bad request error status to the client. The argument reason is a string with the exception description. It is not a fatal error, thus DO NOT delete the current object identified by its simulationID.

jsonError(reason, start_response, simulationID)[source]

Returns the error status to the client. The argument reason is a string with the exception description. In case of errors always deletes the current object identified by its simulationID.

jsonResult(result, start_response)[source]

Returns the success status and the data to the client.

jsonSuccess(start_response)[source]

Returns the success status to the client and no results.

keepRunning()[source]

Server will stop if at least one request has been processed and no activeObjects exist (all active objects finished with the simulation). Therefore, the server can serve multiple clients but will shutdown after all objects freed their resources and the number of active objects goes to zero.

static startWebService(application, address, port, serveForever=False)[source]

Start the web application.

static tryConnectWebService(address, port, timeout=10)[source]

Try to connect to the above server (timeout is 10s). If successful, the server has successfully been started and the subsequent clients can connect to it.

class daeSimulationWebService[source]
static runSimulationsAsWebService(availableSimulations, address='127.0.0.1', port=8001)[source]

Starts the daetools web service providing the simulation via their names. Argument ‘simulations’ is a dictionary: {name: callable}

class fmi2Component(simulation, instanceName, guid)[source]
fmi2CancelStep()[source]
fmi2DoStep(currentCommunicationPoint, communicationStepSize, noSetFMUStatePriorToCurrentPoint)[source]
fmi2EnterInitializationMode()[source]
fmi2ExitInitializationMode()[source]
fmi2FreeInstance()[source]
fmi2GetBoolean(valReferences)[source]
fmi2GetInteger(valReferences)[source]
fmi2GetReal(valReferences)[source]
fmi2GetString(valReferences)[source]
static fmi2Instantiate(instanceName, guid, resourceLocation)[source]
fmi2Reset()[source]
fmi2SetBoolean(valReferences, values)[source]
fmi2SetInteger(valReferences, values)[source]
fmi2SetReal(valReferences, values)[source]
fmi2SetString(valReferences, values)[source]
fmi2SetupExperiment(toleranceDefined, tolerance, startTime, stopTimeDefined, stopTime)[source]
fmi2Terminate()[source]
class daeFMI2_CoS_WebService[source]
class daeWebServiceClient(webServiceName, address, port)[source]
getResponse()[source]
sendRequest(args, method='POST')[source]
class fmi2Component_ws(webServiceName='daetools_fmi_ws', server='127.0.0.1', port=8002)[source]
fmi2CancelStep()[source]
fmi2DoStep(currentCommunicationPoint, communicationStepSize, noSetFMUStatePriorToCurrentPoint)[source]
fmi2EnterInitializationMode()[source]
fmi2ExitInitializationMode()[source]
fmi2FreeInstance()[source]
fmi2GetBoolean(valReferences)[source]
fmi2GetInteger(valReferences)[source]
fmi2GetReal(valReferences)[source]
fmi2GetString(valReferences)[source]
fmi2Instantiate(instanceName, guid, resourceLocation)[source]
fmi2Reset()[source]
fmi2SetBoolean(valReferences, values)[source]
fmi2SetInteger(valReferences, values)[source]
fmi2SetReal(valReferences, values)[source]
fmi2SetString(valReferences, values)[source]
fmi2SetupExperiment(toleranceDefined, tolerance, startTime, stopTimeDefined, stopTime)[source]
fmi2Terminate()[source]

7.13.4. Web service JavaScript classes

daeSimulation

class daeWebService(address, port, webServiceName, method)
daeWebService.ServerStatus
daeWebService.ClearServer()
daeWebService.onSuccess(httpRequest, path, args)
daeWebService.onError(httpRequest, path, args)
daeWebService.onConnectionFailure(path, error)
daeWebService.getResponse(httpRequest)
daeWebService.createHTTPRequest()
daeWebService.executeFun(functionName, parameters)
class daeSimulation(webService)
daeSimulation.LoadSimulation(pythonFile, loadCallable, args)
daeSimulation.LoadTutorial(tutorialName)
daeSimulation.LoadSimulationByName(simulationName, args)
daeSimulation.AvailableSimulations()
daeSimulation.Finalize()
daeSimulation.ModelInfo
daeSimulation.Name
daeSimulation.DataReporter
daeSimulation.DAESolver
daeSimulation.CurrentTime
daeSimulation.TimeHorizon
daeSimulation.ReportingInterval
daeSimulation.Run()
daeSimulation.SolveInitial()
daeSimulation.Reinitialize()
daeSimulation.Reset()
daeSimulation.ReportData()
daeSimulation.Integrate(stopAtDiscontinuity, reportDataAroundDiscontinuities)
daeSimulation.IntegrateForTimeInterval(timeInterval, stopAtDiscontinuity, reportDataAroundDiscontinuities)
daeSimulation.IntegrateUntilTime(time, stopAtDiscontinuity, reportDataAroundDiscontinuities)
daeSimulation.GetParameterValue(name)
daeSimulation.GetVariableValue(name)
daeSimulation.GetActiveState(stnName)
daeSimulation.SetParameterValue(name, value)
daeSimulation.ReAssignValue(name, value)
daeSimulation.ReSetInitialCondition(name, value)
daeSimulation.SetActiveState(stnName, activeState)
create_daetools_ws()
class daeDataReporter(simulation)
daeDataReporter.Value(variableName)
daeDataReporter.AllValues()
class daeDAESolver(simulation)
daeDAESolver.RelativeTolerance
class daeFMI2Simulation(webService)
daeFMI2Simulation.fmi2Instantiate(instanceName, guid, resourceLocation)
daeFMI2Simulation.fmi2Terminate()
daeFMI2Simulation.fmi2FreeInstance()
daeFMI2Simulation.fmi2SetupExperiment(toleranceDefined, tolerance, startTime, stopTimeDefined, stopTime)
daeFMI2Simulation.fmi2EnterInitializationMode()
daeFMI2Simulation.fmi2ExitInitializationMode()
daeFMI2Simulation.fmi2Reset()
daeFMI2Simulation.fmi2DoStep(currentCommunicationPoint, communicationStepSize, noSetFMUStatePriorToCurrentPoint)
daeFMI2Simulation.fmi2CancelStep()
daeFMI2Simulation.fmi2GetReal(valReferences)
daeFMI2Simulation.fmi2SetReal(valReferences, values)
daeFMI2Simulation.fmi2GetString(valReferences)
daeFMI2Simulation.fmi2SetString(valReferences, values)
daeFMI2Simulation.fmi2GetBoolean(valReferences)
daeFMI2Simulation.fmi2SetBoolean(valReferences, values)
daeFMI2Simulation.fmi2GetInteger(valReferences)
daeFMI2Simulation.fmi2SetInteger(valReferences, values)