One of the most requested features for Rappture is a ''service'', a short calculation which runs independently of the '''Simulate''' button. A service could be an ''input service'', which runs automatically in response to user input, before '''Simulate''' is clicked, or an ''output service'', which runs as the user analyzes results of the main simulation, launched when the user clicks '''Simulate'''.
== Input service example: MaterialDB ==
As an example, consider the following tool:
This tool needs 3 inputs, a lattice constant, a dielectric constant, and a band gap, which are properties of the material chosen in the selector at the top. Using the current capabilities of Rappture, the user would need to input each of the 3 values separately (obviating the need for the Material selector).
The MaterialDB (an entirely separate project) calculates these material properties (and many others) from functional expressions. For example, the dielectric constant for !GaAs is
where T is the temperature. The details of the MaterialDB are not relevant to this proposal, except to say that by using it material parameters can be calculated on the fly. Running MaterialDB as an ''input service'' then, Rappture could populate the lattice constant, dielectric constant, and band gap inputs of the tool above
based solely on the value of the Material selector.
The core idea of this proposal is a method of connecting the input and output of tools with Rappture interfaces; to that end, we also need a Rappture GUI for the MaterialDB, like the following:
This tool takes a material name and parameter name and returns the requested material parameter from the MaterialDB. The tool.xml file for this tool is very simple.
MaterialDB ServiceRappture service interface to the Purdue MaterialDBtclsh @tool/matdb_service.tcl @driverwizard30x1Enter material name here30x1Enter parameter name here
Now we have two Rappture tools, the top level tool which needs material parameters and the MaterialDB tool which provides the parameters. The following tool.xml for the top level tool illustrates some ideas about how to describe calling the MaterialDB tool as an ''input service''.
Material Parameter LookupQuick reference for material parametersruby @tool/matref.rb @driverwizardChoose a semiconductor materialGaAsselectLength of conventional unit cell edge, in AngstromsA1.0Relative permittivity of a material (dimensionless)1.0Band gap at the gamma point (eV)eV1.0
The tag specifies which GUI actions launch the ''input service''. The tags delimit a specific, automatic invocation of the MaterialDB tool; each time the ''input service'' runs, it invokes the MaterialDB service once for each tag.