GitLab will be shut down on June 25 to move to a new facility. https://www.eclipsestatus.io/incidents/5ffy27gwcbx7

Commit 79e340d6 authored by Robert Smith's avatar Robert Smith
Browse files

Merge branch 'next' of https://github.com/eclipse/ice into next

parents d14fc2b5 1b2f2ef2
......@@ -28,9 +28,7 @@ select \texttt{ICE Item Creation Wizard}. You will be met with a standard new
project wizard page, in which you can name your project. We will call ours
\texttt{org.eclipse.ice.fern}. Once you have named your project click the \texttt{Next >} button.
\begin{center} \includegraphics[width=\textwidth]{figures/comb23} \end{center}
Now you are able to customize the plugin-specific portions of the project. We do
not need an Activator to be generated, so uncheck that box, then select
\texttt{Next}.
Now you are able to customize the plugin-specific portions of the project.
On this page you need to tell the wizard what you want to use as a base
name for your item classes. We will call this one \texttt{Fern}. Then, we will
......
......@@ -93,10 +93,10 @@ be presented with the view in the figure below.
\begin{center} \includegraphics[width=\textwidth]{figures/fernmodelItem}
\end{center}
Here you can modify the various defaults with the values you would like for a
given Fern simulation. Once done, simply save the Item and click Go on the
Export to INI Process. This will execute the process of creating a new INI Fern
given Fern simulation. Once done, simply save the Item and click the
\texttt{Go!} button. This will execute the process of creating a new INI Fern
input file for use with the Fern Launcher. You can check the result by opening
the fern\_output.ini file, as shown below.
the \texttt{fern\_config.ini} file, as shown below.
\begin{center} \includegraphics[width=\textwidth]{figures/result}
\end{center}
......@@ -136,7 +136,7 @@ A Parallel launch configuration for your application is created as follows:
\item Click on the \texttt{Parallel Application} entry, then click the
\texttt{New} button
\item From the \texttt{Target System Configuration} dropdown, select
\textttt{Generic Torque Batch}
\texttt{Generic Torque Batch}
\item From the \texttt{Please select a connection}, choose the \texttt{gordon}
connection you created earlier
\item Click \texttt{Yes} when asked if you would like to run a command on the
......
......@@ -89,7 +89,7 @@ protected void setupItemInfo() {
setDescription("This Item constructs " +
"input files for the FERN reaction " +
"network solver");
outputName = "fern_output.ini";
outputName = "fern_config.ini";
exportString = "Export to INI";
allowedActions.add(0, exportString);
ioFormat = "INI";
......@@ -151,7 +151,7 @@ Add the following to your setupForm() method:
StringEntry massTol = new StringEntry();
massTol.setName("massTol");
massTol.setDescription("The mass tolerance to consider");
massTol.setDefaultValue("1e-7");
massTol.setDefaultValue("1.0e-7");
StringEntry fluxFrac = new StringEntry();
fluxFrac.setName("fluxFrac");
......@@ -192,12 +192,12 @@ Add the following to your setupForm() method:
StringEntry startTime = new StringEntry();
startTime.setName("startTime");
startTime.setDescription("The start time for the simulation.");
startTime.setDefaultValue("1e-20");
startTime.setDefaultValue("1.0e-20");
StringEntry endTime = new StringEntry();
endTime.setName("endTime");
endTime.setDescription("The end time for the simulation");
endTime.setDefaultValue("1e-3");
endTime.setDefaultValue("1.0e-8");
StringEntry initialTimeStep = new StringEntry();
initialTimeStep.setName("initialTimeStep");
......@@ -208,7 +208,7 @@ Add the following to your setupForm() method:
StringEntry density = new StringEntry();
density.setName("density");
density.setDescription("The initial density.");
density.setDefaultValue("1e8");
density.setDefaultValue("1.0e8");
initConditionsComp.addEntry(t9);
initConditionsComp.addEntry(startTime);
......
......@@ -126,7 +126,7 @@ print 'Hello World'
Once you have entered the Python script, is can be easily launched using the run
button (green arrow) on the \texttt{Script Exporer} view. Simply select the
the script file you want to run and click on the run button. Any (textual)
script file you want to run and click on the run button. Any (textual)
output generated by the script will be displayed in the Console view shown
below.
......@@ -178,42 +178,51 @@ to the script:
\subsection{Interacting with ICE}
In order to interact with Java classes in ICE from the Python script, we
need to include the \texttt{Platform} module. In order to load a module, we use
the \texttt{loadModule()} function in Python. The argument to this function is a
string representation of the module path, which in this case will be
\texttt{/System/Platform}.
need to include additonal modules. In order to load modules,
we use the \texttt{loadModule()} function in Python. The argument to this function is a
string representation of the module path. For this tutorial we will need to load
the \texttt{/System/Platform}, \texttt{/System/Resources}, and
\texttt{/System/UI} modules.
In the \texttt{Modules Explorer} view, open the \texttt{System} folder, then drag
the \texttt{Platform} item into the script file after the initial comments. This
should insert the following line into your script:
the \texttt{Platform}, \texttt{Resources}, and \texttt{UI} items
into the script file after the initial comments (you can also type these line
in manually if you wish).
This should insert the following lines into your script:
\lstset{basicstyle=\ttfamily\small, breaklines}
{\small
\begin{verbatim}
loadModule("/System/Platform")
loadModule('/System/Platform');
loadModule('/System/Resources');
loadModule('/System/UI');
\end{verbatim}
}
Once this module has been loaded, a number of additional functions become
Once these module have been loaded, a number of additional functions become
available. We want to obtain a reference to the core ICE service, which is used
as the starting point for manipulating ICE models. This is done by adding the
following line:
as the starting point for manipulating ICE models. We also want to obtain a
reference to the \texttt{fern} project. This is done by adding the following
lines:
{\small
\begin{verbatim}
coreService = getService(org.eclipse.ice.core.iCore.ICore)
project = getProject("fern")
\end{verbatim}
}
Once a reference to the core services has been obtained, we can use this to
obtain a reference to the Reflectivity Model and set some parameters. This is
done by adding the following lines:
obtain a reference to the Reflectivity Model and set some parameters. We supply
the project to the \textit{createItem()} method so that the generated files will
be saved in the project folder. This is done by adding the following lines:
{\small
\begin{verbatim}
reflectModel = coreService.getItem(int(coreService.createItem("Reflectivity Model")))
component = reflectModel.getComponents().get(0)
item = coreService.createItem("Reflectivity Model", project)
model = coreService.getItem(int(item))
component = model.getComponents().get(0)
entry = component.retrieveAllEntries().get(0)
entry.setValue("waveVector_space.csv")
\end{verbatim}
......@@ -228,25 +237,23 @@ service \texttt{processItem()} as follows:
{\small
\begin{verbatim}
res = coreService.processItem(reflectModel.getId(), "Calculate Reflectivity", 1)
res = coreService.processItem(model.getId(), "Calculate Reflectivity", 1)
\end{verbatim}
}
Finally, let's print out the result of processing the model to see if it was
Finally, lets display one of the resulting CSV files if it was
successful.
{\small
\begin{verbatim}
print "result was: %s" % res
if str(res) == "Processed":
output = getFile("reflectivityModel_%d_rfd.csv" % model.getId())
openEditor(output)
\end{verbatim}
}
Remember to save the editor using \texttt{Ctrl/Cmd-S} or the \texttt{File
$\rightarrow$ Save} command from the ICE menu bar.
Before running this script, you need to copy the \texttt{waveVector\_space.csv}
file from the \texttt{default} folder to the \texttt{itemDB} folder. You should
then be able to run the script successfully.
$\rightarrow$ Save} command from the ICE menu bar before running the script.
\subsection{Using the Sample Scripts}
......
org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
org.eclipse.ui/defaultPerspectiveId=org.eclipse.cdt.ui.CPerspective
\ No newline at end of file
org.eclipse.ui/defaultPerspectiveId=org.eclipse.cdt.ui.CPerspective
org.eclipse.ui.editors/lineNumberRuler=true
\ No newline at end of file
org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
org.eclipse.ui/defaultPerspectiveId=org.eclipse.pde.ui.PDEPerspective
org.eclipse.ui.editors/lineNumberRuler=true
\ No newline at end of file
......@@ -59,7 +59,7 @@ public class FernModel extends Model {
setDescription("This Item constructs input files for the FERN reaction network solver");
writerName = "INIWriter";
readerName = "INIReader";
outputName = "fern_output.ini";
outputName = "fern_config.ini";
exportString = "Export to INI";
allowedActions.add(0, exportString);
}
......@@ -103,7 +103,7 @@ public class FernModel extends Model {
StringEntry massTol = new StringEntry();
massTol.setName("massTol");
massTol.setDescription("The mass tolerance to consider");
massTol.setDefaultValue("1e-7");
massTol.setDefaultValue("1.0e-7");
StringEntry fluxFrac = new StringEntry();
fluxFrac.setName("fluxFrac");
......@@ -144,12 +144,12 @@ public class FernModel extends Model {
StringEntry startTime = new StringEntry();
startTime.setName("startTime");
startTime.setDescription("The start time for the simulation.");
startTime.setDefaultValue("1e-20");
startTime.setDefaultValue("1.0e-20");
StringEntry endTime = new StringEntry();
endTime.setName("endTime");
endTime.setDescription("The end time for the simulation");
endTime.setDefaultValue("1e-3");
endTime.setDefaultValue("1.0e-8");
StringEntry initialTimeStep = new StringEntry();
initialTimeStep.setName("initialTimeStep");
......@@ -159,7 +159,7 @@ public class FernModel extends Model {
StringEntry density = new StringEntry();
density.setName("density");
density.setDescription("The initial density.");
density.setDefaultValue("1e8");
density.setDefaultValue("1.0e8");
// Add the entries to the DataComponent!
initConditionsComp.addEntry(t9);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment