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.
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.
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:
Change the Script Name in ApplicationB
Check the ApplicationA as Possible input nodes and set the Condition to (=0).
The ApplicationB will be executed only if the ApplicationA exit status is =0.
Check the EndOK2 box to link Logic End icon and specify the application Exit Condition =0. The design is considered successfully evaluated if ApplicationB exit status is (=0).
Click the button to accept all changes.
When the ApplicationA exits with condition (=0) modeFRONTIERTM mines the output variables from outA.dat file and starts ApplicationB.
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.
Write a simple batch of commands, where the key one is the bc program, (Figure 5.27, "the Application Script Editor").
Click on the button to confirm all changes.
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
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"
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:
Change the Name into inB.dat.
Check the two input nodes boxes relative to the z and t to link the Input File with the Input Variables objects.
Check the output node box to link the Input File with ApplicationB.
Click the button to accept all changes.
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 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 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").
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 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".
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 button in the Output File properties window, then select a suitable file and click on the 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".
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:
Change the Name into con1.
Define the User Expression simply as c1 (but the expression can be a more complex combination of input and output variables).
Set Type Less Than (it means the result of the User Expression has to be less than the Value defined below).
Set the Value to 10.0
Set the Tolerance to 0.0 (If it is set to 0, the optimiser will not consider any design breaking the constraint. If it is different than 0, the optimiser will consider a design breaking the constraint, if it stays in the tolerance specified).
Click the button to accept all changes.
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