5.1.3. The Independent Applications Pattern




Suppose we have to analyse a design from two points of view, i.e. structural-fluidynamical, structural-thermical, thermical-electromagnetic, ..., and the models are parametrised on the same quantities or at least one parameter is used by both the model.

If we want to optimise a design bearing both aspects in mind we have to join the two analysis in the same project.

The modified Template Input File

Figure 5.24. The modified Template Input File

We can rebuild the Work Flow from the beginning or we can reuse what we have already done in the first tutorial.

To do so, open the Simple Process Flow Pattern project, a copy is available with the name testSimple.prj in .../FRONTIER30x/projects/testcase/simple.

However the already build project for "The Serial Indipendent Applications Pattern" can be found in:

This project is already available in .../modeFRONTIER30x/projects/testcase/serial-indip/testSerial-indip.prj

Before adding a new External Script we have to unlink the Logic End from the ApplicationA because it will not be the last application to run.

Open the Logic End properties window and unmark the relative check box as shown in Figure 5.25, "Unlink the Logic Completed node".

We can do the same operation faster: Click on the link between the Logic End icon and External Script to select the link, RMB click into an empty zone of the Work Flow canvas and select Cut or Remove Selected Links in the pop-up menu.

Unlink the Logic Completed node

Figure 5.25. Unlink the Logic Completed node

Now, the Logic Log window displays the following message :

Error 127 NO EXIT PATH FOR SCRIPT NODE ApplicationA

Error 113 MISSING INPUT LINK(S) EndOk2

and the ApplicationA and EndOk2 nodes are red bordered.

As done in the Simple WorkFlow Pattern tutorial, let's start creating a new External Script.

Select from the tool bar the External Script object and put it in the Work Flow window.

Double LMB click on its icon to bring up the properties window (Figure 5.26, "Insert the next Application") and do the following:

When the ApplicationA exits with condition (=0) modeFRONTIERTM mines the output variables from outA.dat file and starts ApplicationB.

Insert the next Application

Figure 5.26. Insert the next Application

Now we have to create the script that will perform the external tasks for the ApplicationB.

Click on the Edit Script button, (Figure 5.26, "Insert the next Application"), and a simple text editor will show up.

Note:

It is always recommended to test the script in our normal shell environment, if its performances are as we expected it will do the same inside the modeFRONTIERTM SYSTEM

the Application Script Editor

Figure 5.27. the Application Script Editor

Create two more Input Variables selecting the relative object from the palette on the left and place it on the Work Flow desktop.

The Input Variable objects must then be configured.

Double LMB click on the Input Variable icon to bring up the properties window and define the new Input Variable objects like in Figure 5.28, "the new input variable z" and Figure 5.29, "the new input variable t"

the new input variable z

Figure 5.28. the new input variable z

the new input variable t

Figure 5.29. the new input variable t

Create another Input File selecting the relative object from the palette on the left and place it on the Work Flow desktop.

The Input File object must then be configured.

Double LMB click on the Input File icon to bring up the properties window and do the following:

The next step is to create the template file for the Input File inB.dat. The operation can be carried out loading an existing inB.dat file using the Open button in the Input File properties. The action will bring up a File Chooser Dialog and an example of inB.dat template file for this tutorial can be found in:

.../modeFRONTIER30x/projects/testcase/serial-indip/inB.dat

When the suitable file is located on the file system click on the Open button to load it inside the Template Input Editor. In the lower part of the Template Input Editor a list of all the linked input variables is shown and after having inserted the Input Variable the file looks like in (Figure 5.30, "the Process Flow desktop in the input file insert phase").

the Process Flow desktop in the input file insert phase

Figure 5.30. the Process Flow desktop in the input file insert phase

Select one Output File from the tool bar and click on the Work Flow desktop to place it and do the same with one Output Variable . A new Output File and one Output Variable should now be present in the project.

Enter the Output Variable properties window double clicking on it or with the RMB to pop-up a menu, and select Edit Node Properties.

Change the default name of Output Variable editing the Name field and giving the name c1. The Output File object name must be changed to outB.dat, then the output variable can be connected as output of the file by clicking on their respective check boxes.

Connect the output file to the ApplicationB by clicking on the Possible input node check box. The condition must be specify as =0 because only if the ApplicationB exit status is =0 the results have to be considered acceptable.

Note:

the Output File object must have the same name of the output file generated by the ApplicationB because modeFRONTIERTM will look for a file with a specific name in the working directory of the ApplicationB

By clicking the Ok button all changes to the logic are applied, the variables are connected and the system should look like Figure 5.31, "Linking output file to the application and to output variables".

Linking output file to the application and to output variables

Figure 5.31. Linking output file to the application and to output variables

The error messages in the Logic Log window show us that we have not defined any Mining Rules to extract the Output Variable values from the Output File.

First select a suitable file using the Open button in the Output File properties window, then select a suitable file and click on the Open button.

For this tutorial a correct Output File can be found in: .../modeFRONTIER30x/projects/testcase/serial-indip/outB.dat

Mine the Output Variable from the Output File as we learnt in the Simple WorkFlow Pattern tutorial and the Template Output Editor should look like Figure 5.32, "the Mining Rules".

the Mining Rules

Figure 5.32. the Mining Rules

Select one Constraint objects from the tool bar and click on the Work Flow desktop to place it.

The Constraint object must then be configured.

Double LMB click on the Constraint icon to bring up the properties editor (Figure 5.33, "the Constraints") and do the following:

the Constraints

Figure 5.33. the Constraints

Now our project should look like the one in Figure 5.24, "The modified Template Input File", the error messages are no more displayed in the Logic Log panel and the logic can be correctly used.

Before exiting modeFRONTIERTM save the project as testSerial-indip.prj

If we are not sure to have correctly built this project a tested copy is already available in: .../modeFRONTIER30x/projects/testcase/serial-indip/testSerial-indip.prj


Return to modeFRONTIER Index