From: Renaud Barate Date: Mon, 19 May 2014 13:26:53 +0000 (+0200) Subject: Add new tutorial in the documentation about the usage of a Python script as the solve... X-Git-Tag: V7_4_0rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fe232457cb81481494e807b1fe3ab59f9cad3597;p=modules%2Fparametric.git Add new tutorial in the documentation about the usage of a Python script as the solver code --- diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 3cd5fdf..60dbb5f 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -19,15 +19,20 @@ SET(RSTFILES index.rst reference.rst ref_solver.rst - tut_deterministic.rst - tutorial.rst - tut_values.rst + tut_deterministic_compo.rst + tutorial_compo.rst + tut_values_compo.rst ref_csv_export.rst ref_execution.rst ref_values.rst - tut_execution.rst - tut_solver.rst - tut_variables.rst + tut_execution_compo.rst + tut_solver_compo.rst + tut_variables_compo.rst + tutorial_python.rst + tut_values_python.rst + tut_execution_python.rst + tut_solver_python.rst + tut_variables_python.rst ) SET(SPHINXOPTS ) diff --git a/doc/_static/define_solver_python.png b/doc/_static/define_solver_python.png new file mode 100644 index 0000000..a4d9e57 Binary files /dev/null and b/doc/_static/define_solver_python.png differ diff --git a/doc/_static/ob_new_study_python.png b/doc/_static/ob_new_study_python.png new file mode 100644 index 0000000..e6040da Binary files /dev/null and b/doc/_static/ob_new_study_python.png differ diff --git a/doc/_static/popup_export_csv_python.png b/doc/_static/popup_export_csv_python.png new file mode 100644 index 0000000..b3e3911 Binary files /dev/null and b/doc/_static/popup_export_csv_python.png differ diff --git a/doc/_static/popup_run_study_python.png b/doc/_static/popup_run_study_python.png new file mode 100644 index 0000000..3633e42 Binary files /dev/null and b/doc/_static/popup_run_study_python.png differ diff --git a/doc/_static/select_variables_python_full.png b/doc/_static/select_variables_python_full.png new file mode 100644 index 0000000..771f1d7 Binary files /dev/null and b/doc/_static/select_variables_python_full.png differ diff --git a/doc/index.rst b/doc/index.rst index 5228f1a..32f78d8 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -28,12 +28,13 @@ can vary in a given range. This module provides a way to run the simulation for different values of those parameters, and to distribute the computations across several machines. -The documentation of this module is divided in two parts. The tutorial gives a -quick insight in the usage and goals of this module. The reference guide +The documentation of this module is divided in three parts. The two tutorials +give a quick insight in the usage and goals of this module. The reference guide details the main features of the module. .. toctree:: :maxdepth: 2 - tutorial.rst + tutorial_python.rst + tutorial_compo.rst reference.rst diff --git a/doc/tut_deterministic.rst b/doc/tut_deterministic.rst deleted file mode 100644 index c976a5c..0000000 --- a/doc/tut_deterministic.rst +++ /dev/null @@ -1,66 +0,0 @@ -.. - Copyright (C) 2012-2014 EDF - - This file is part of SALOME PARAMETRIC module. - - SALOME PARAMETRIC module is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SALOME PARAMETRIC module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SALOME PARAMETRIC module. If not, see . - - -===================================== -Step 1: Define the deterministic case -===================================== - -The first step is to create a deterministic case, that is a description of the -calculation to be done. As our example uses the GENERICSOLVER module, first -you must activate this module: - -.. image:: /_static/activate_gensolver.png - :align: center - -.. raw:: html - -
- -.. image:: /_static/new_gensolver.png - :align: center - -Then create a calculation case: - -.. image:: /_static/new_detcase.png - :align: center - -You can modify the values of the different variables if you want, but note -that the values of the variables that you will define as parametric will be -overrided. - -.. image:: /_static/setvalue_detcase.png - :align: center - -You can also run a deterministic calculation of the deviation of the beam with -the values set for the variables: - -.. image:: /_static/runsolver_detcase.png - :align: center - -.. raw:: html - -
- -.. image:: /_static/result_detcase.png - :align: center - -Now we have defined the target of our parametric study. It's time to describe -what this study will look like. - -:ref:`tut-variables-label` diff --git a/doc/tut_deterministic_compo.rst b/doc/tut_deterministic_compo.rst new file mode 100644 index 0000000..5ca50e4 --- /dev/null +++ b/doc/tut_deterministic_compo.rst @@ -0,0 +1,66 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +===================================== +Step 1: Define the deterministic case +===================================== + +The first step is to create a deterministic case, that is a description of the +calculation to be done. As our example uses the GENERICSOLVER module, first +you must activate this module: + +.. image:: /_static/activate_gensolver.png + :align: center + +.. raw:: html + +
+ +.. image:: /_static/new_gensolver.png + :align: center + +Then create a calculation case: + +.. image:: /_static/new_detcase.png + :align: center + +You can modify the values of the different variables if you want, but note +that the values of the variables that you will define as parametric will be +overrided. + +.. image:: /_static/setvalue_detcase.png + :align: center + +You can also run a deterministic calculation of the deviation of the beam with +the values set for the variables: + +.. image:: /_static/runsolver_detcase.png + :align: center + +.. raw:: html + +
+ +.. image:: /_static/result_detcase.png + :align: center + +Now we have defined the target of our parametric study. It's time to describe +what this study will look like. + +:ref:`tut-variables-compo-label` diff --git a/doc/tut_execution.rst b/doc/tut_execution.rst deleted file mode 100644 index d921eca..0000000 --- a/doc/tut_execution.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. - Copyright (C) 2012-2014 EDF - - This file is part of SALOME PARAMETRIC module. - - SALOME PARAMETRIC module is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SALOME PARAMETRIC module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SALOME PARAMETRIC module. If not, see . - - -.. _tut-execution-label: - -=================================================== -Step 5: Run the parametric study and export results -=================================================== - -In this step we will launch the execution of the parametric study on the local -computer. For that, just click on the study in the object browser with the -right button and select "Run parametric study" in the popup menu. - -.. image:: /_static/popup_run_study.png - :align: center - -The execution ends after a few dozens seconds. It is now possible to export -the results in a CSV file to analyze them with a spreadsheet for instance. For -that, click again on the study with the right button and select "Export data -to CSV file". You can then choose the file in which the results will be saved. - -.. image:: /_static/popup_export_csv.png - :align: center - -It is then possible to open this file in a spreadsheet to draw graphs, analyze -results, etc. - -.. image:: /_static/spreadsheet.png - :align: center diff --git a/doc/tut_execution_compo.rst b/doc/tut_execution_compo.rst new file mode 100644 index 0000000..c38751b --- /dev/null +++ b/doc/tut_execution_compo.rst @@ -0,0 +1,45 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-execution-compo-label: + +=================================================== +Step 5: Run the parametric study and export results +=================================================== + +In this step we will launch the execution of the parametric study on the local +computer. For that, just click on the study in the object browser with the +right button and select "Run parametric study" in the popup menu. + +.. image:: /_static/popup_run_study.png + :align: center + +The execution ends after a few dozens seconds. It is now possible to export +the results in a CSV file to analyze them with a spreadsheet for instance. For +that, click again on the study with the right button and select "Export data +to CSV file". You can then choose the file in which the results will be saved. + +.. image:: /_static/popup_export_csv.png + :align: center + +It is then possible to open this file in a spreadsheet to draw graphs, analyze +results, etc. + +.. image:: /_static/spreadsheet.png + :align: center diff --git a/doc/tut_execution_python.rst b/doc/tut_execution_python.rst new file mode 100644 index 0000000..a6fdfbb --- /dev/null +++ b/doc/tut_execution_python.rst @@ -0,0 +1,45 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-execution-python-label: + +=================================================== +Step 4: Run the parametric study and export results +=================================================== + +In this step we will launch the execution of the parametric study on the local +computer. For that, just click on the study in the object browser with the +right button and select "Run parametric study" in the popup menu. + +.. image:: /_static/popup_run_study_python.png + :align: center + +The execution ends after a few dozens seconds. It is now possible to export +the results in a CSV file to analyze them with a spreadsheet for instance. For +that, click again on the study with the right button and select "Export data +to CSV file". You can then choose the file in which the results will be saved. + +.. image:: /_static/popup_export_csv_python.png + :align: center + +It is then possible to open this file in a spreadsheet to draw graphs, analyze +results, etc. + +.. image:: /_static/spreadsheet.png + :align: center diff --git a/doc/tut_solver.rst b/doc/tut_solver.rst deleted file mode 100644 index 7bd7ac4..0000000 --- a/doc/tut_solver.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. - Copyright (C) 2012-2014 EDF - - This file is part of SALOME PARAMETRIC module. - - SALOME PARAMETRIC module is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SALOME PARAMETRIC module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SALOME PARAMETRIC module. If not, see . - - -.. _tut-solver-label: - -====================================================== -Step 4: Define the solver and the execution parameters -====================================================== - -In this step we will define the solver to use for our parametric study. Two -types of solvers can be used with the PARAMETRIC module: - -* The solver can be a Salome component that must define a few methods with - given signatures. -* The solver can be a Python script. - -In this tutorial, we use the Salome component DEVIATION that is defined in the -GENERICSOLVER module. For that, we must set the component name "DEVIATION" and -select in the object browser the deterministic case that was created in step 1. -We can also change the name of the parametric study (the name that the study -will have in the object browser) and the number of computations that will be -launched in parallel. - -.. image:: /_static/define_solver.png - :align: center - -Finally, just click the "OK" button to validate the creation of the parametric -study. A new item representing the study appears in the object browser. - -.. image:: /_static/ob_new_study.png - :align: center - -:ref:`tut-execution-label` diff --git a/doc/tut_solver_compo.rst b/doc/tut_solver_compo.rst new file mode 100644 index 0000000..5643045 --- /dev/null +++ b/doc/tut_solver_compo.rst @@ -0,0 +1,49 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-solver-compo-label: + +====================================================== +Step 4: Define the solver and the execution parameters +====================================================== + +In this step we will define the solver to use for our parametric study. Two +types of solvers can be used with the PARAMETRIC module: + +* The solver can be a Salome component that must define a few methods with + given signatures. +* The solver can be a Python script. + +In this tutorial, we use the Salome component DEVIATION that is defined in the +GENERICSOLVER module. For that, we must set the component name "DEVIATION" and +select in the object browser the deterministic case that was created in step 1. +We can also change the name of the parametric study (the name that the study +will have in the object browser) and the number of computations that will be +launched in parallel. + +.. image:: /_static/define_solver.png + :align: center + +Finally, just click the "OK" button to validate the creation of the parametric +study. A new item representing the study appears in the object browser. + +.. image:: /_static/ob_new_study.png + :align: center + +:ref:`tut-execution-compo-label` diff --git a/doc/tut_solver_python.rst b/doc/tut_solver_python.rst new file mode 100644 index 0000000..f1331ba --- /dev/null +++ b/doc/tut_solver_python.rst @@ -0,0 +1,53 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-solver-python-label: + +====================================================== +Step 3: Define the solver and the execution parameters +====================================================== + +In this step we will define the solver to use for our parametric study. Two +types of solvers can be used with the PARAMETRIC module: + +* The solver can be a Salome component that must define a few methods with + given signatures. +* The solver can be a Python script. + +In this tutorial, we use a Python script. Select the second radio button +"Python script", and implement the script directly in this window (of course, +you can also copy-paste the script from an external editor if you prefer). +This script should directly use the input variables *F* and *L* that will be +set automatically in the context of the script before running it. It should +create the output variable *dev*, like in the example below. + +We can also change the name of the parametric study (the name that the study +will have in the object browser) and the number of computations that will be +launched in parallel. + +.. image:: /_static/define_solver_python.png + :align: center + +Finally, just click the "OK" button to validate the creation of the parametric +study. A new item representing the study appears in the object browser. + +.. image:: /_static/ob_new_study_python.png + :align: center + +:ref:`tut-execution-python-label` diff --git a/doc/tut_values.rst b/doc/tut_values.rst deleted file mode 100644 index 14c0f89..0000000 --- a/doc/tut_values.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. - Copyright (C) 2012-2014 EDF - - This file is part of SALOME PARAMETRIC module. - - SALOME PARAMETRIC module is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SALOME PARAMETRIC module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SALOME PARAMETRIC module. If not, see . - - -.. _tut-values-label: - -====================================================== -Step 3: Define the values for the parametric variables -====================================================== - -In this step we will define the values that the parametric variables will take -in the parametric study. Three methods are proposed for that: - -* Define ranges for each variable. The domain that is defined by those ranges - will be completely sampled to build the experimental plane. -* Write a Python script that will create the sample. -* Import the sample from a CSV file. - -In this tutorial, we will use the first method. To define the ranges for the -parametric variables, you just have to select the minimum and maximum value -for each variable along with the sampling step, as illustrated below. - -.. image:: /_static/define_ranges.png - :align: center - -Then click button "Next >>" to proceed to the last step of the parametric -study creation. - -:ref:`tut-solver-label` diff --git a/doc/tut_values_compo.rst b/doc/tut_values_compo.rst new file mode 100644 index 0000000..5b471eb --- /dev/null +++ b/doc/tut_values_compo.rst @@ -0,0 +1,44 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-values-compo-label: + +====================================================== +Step 3: Define the values for the parametric variables +====================================================== + +In this step we will define the values that the parametric variables will take +in the parametric study. Three methods are proposed for that: + +* Define ranges for each variable. The domain that is defined by those ranges + will be completely sampled to build the experimental plane. +* Write a Python script that will create the sample. +* Import the sample from a CSV file. + +In this tutorial, we will use the first method. To define the ranges for the +parametric variables, you just have to select the minimum and maximum value +for each variable along with the sampling step, as illustrated below. + +.. image:: /_static/define_ranges.png + :align: center + +Then click button "Next >>" to proceed to the last step of the parametric +study creation. + +:ref:`tut-solver-compo-label` diff --git a/doc/tut_values_python.rst b/doc/tut_values_python.rst new file mode 100644 index 0000000..f31eb7a --- /dev/null +++ b/doc/tut_values_python.rst @@ -0,0 +1,44 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-values-python-label: + +====================================================== +Step 2: Define the values for the parametric variables +====================================================== + +In this step we will define the values that the parametric variables will take +in the parametric study. Three methods are proposed for that: + +* Define ranges for each variable. The domain that is defined by those ranges + will be completely sampled to build the experimental plane. +* Write a Python script that will create the sample. +* Import the sample from a CSV file. + +In this tutorial, we will use the first method. To define the ranges for the +parametric variables, you just have to select the minimum and maximum value +for each variable along with the sampling step, as illustrated below. + +.. image:: /_static/define_ranges.png + :align: center + +Then click button "Next >>" to proceed to the last step of the parametric +study creation. + +:ref:`tut-solver-python-label` diff --git a/doc/tut_variables.rst b/doc/tut_variables.rst deleted file mode 100644 index 881a52f..0000000 --- a/doc/tut_variables.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. - Copyright (C) 2012-2014 EDF - - This file is part of SALOME PARAMETRIC module. - - SALOME PARAMETRIC module is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SALOME PARAMETRIC module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SALOME PARAMETRIC module. If not, see . - - -.. _tut-variables-label: - -===================================================================== -Step 2: Define the parametric variables and the variables of interest -===================================================================== - -In this step we will define the variables that will be exchanged between -the PARAMETRIC module and the calculation code (DEVIATION in our example). The -parametric variables are the input variables of the calculation code that will -vary in a given range. Let's say that in our example, *F* and *L* are the two -parametric variables and *E* and *I* are fixed variables. - -The variables of interest are the output variables of the calculation code -that we want to study. In our example, there is only one output variable and -thus only one variable of interest: the deviation *dev*. - -To define those variables, you first have to activate the PARAMETRIC module. - -.. image:: /_static/activate_parametric.png - :align: center - -.. |button_new_study| image:: /_static/button_new_study.png - :align: middle - -Then click on the button |button_new_study| to create a new parametric study -and to open the variables definition window. - -.. image:: /_static/select_variables_empty.png - :align: center - -Now select the item "Variables" in the object browser under the deterministic -case and click button "Select". The left side of the window will be filled -with all the variables in the deterministic case. - -.. image:: /_static/select_variables_potential_vars.png - :align: center - -Now select the two input variables *F* and *L* and click button "Add" in the -upper part of the window. Select the output variable "dev" and click button -"Add" in the lower part of the window. In the end, your variables definition -window should look like this: - -.. image:: /_static/select_variables_full.png - :align: center - -Note that if the deterministic case does not provide a "Variables" item, you -can still create the probabilistic variables and the variables of interest by -using the "New..." buttons. - -Finally, when you have selected all the desired variables, click button -"Next >>" to proceed to the next step. - -:ref:`tut-values-label` diff --git a/doc/tut_variables_compo.rst b/doc/tut_variables_compo.rst new file mode 100644 index 0000000..251eb66 --- /dev/null +++ b/doc/tut_variables_compo.rst @@ -0,0 +1,72 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +.. _tut-variables-compo-label: + +===================================================================== +Step 2: Define the parametric variables and the variables of interest +===================================================================== + +In this step we will define the variables that will be exchanged between +the PARAMETRIC module and the calculation code (DEVIATION in our example). The +parametric variables are the input variables of the calculation code that will +vary in a given range. Let's say that in our example, *F* and *L* are the two +parametric variables and *E* and *I* are fixed variables. + +The variables of interest are the output variables of the calculation code +that we want to study. In our example, there is only one output variable and +thus only one variable of interest: the deviation *dev*. + +To define those variables, you first have to activate the PARAMETRIC module. + +.. image:: /_static/activate_parametric.png + :align: center + +.. |button_new_study| image:: /_static/button_new_study.png + :align: middle + +Then click on the button |button_new_study| to create a new parametric study +and to open the variables definition window. + +.. image:: /_static/select_variables_empty.png + :align: center + +Now select the item "Variables" in the object browser under the deterministic +case and click button "Select". The left side of the window will be filled +with all the variables in the deterministic case. + +.. image:: /_static/select_variables_potential_vars.png + :align: center + +Now select the two input variables *F* and *L* and click button "Add" in the +upper part of the window. Select the output variable "dev" and click button +"Add" in the lower part of the window. In the end, your variables definition +window should look like this: + +.. image:: /_static/select_variables_full.png + :align: center + +Note that if the deterministic case does not provide a "Variables" item, you +can still create the probabilistic variables and the variables of interest by +using the "New..." buttons. + +Finally, when you have selected all the desired variables, click button +"Next >>" to proceed to the next step. + +:ref:`tut-values-compo-label` diff --git a/doc/tut_variables_python.rst b/doc/tut_variables_python.rst new file mode 100644 index 0000000..f415e58 --- /dev/null +++ b/doc/tut_variables_python.rst @@ -0,0 +1,60 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +===================================================================== +Step 1: Define the parametric variables and the variables of interest +===================================================================== + +In this step we will define the variables that will be exchanged between +the PARAMETRIC module and the calculation script. The parametric variables are +the input variables of the calculation script that will vary in a given range. +Let's say that in our example, *F* and *L* are the two parametric variables and +*E* and *I* are fixed variables. + +The variables of interest are the output variables of the calculation code +that we want to study. In our example, there is only one output variable and +thus only one variable of interest: the deviation *dev*. + +To define those variables, you first have to activate the PARAMETRIC module. + +.. image:: /_static/activate_parametric.png + :align: center + +.. |button_new_study| image:: /_static/button_new_study.png + :align: middle + +Then click on the button |button_new_study| to create a new parametric study +and to open the variables definition window. + +.. image:: /_static/select_variables_empty.png + :align: center + +Now click on the "New..." button in the upper part of the window. Double click +on the new item named "TO EDIT!" to set it to the value "F". Then do the same +for the variable "L". In the lower part of the window, create the output +variable "dev" with the same method. In the end, your variables definition +window should look like this: + +.. image:: /_static/select_variables_python_full.png + :align: center + +Finally, when you have created all the desired variables, click button +"Next >>" to proceed to the next step. + +:ref:`tut-values-python-label` diff --git a/doc/tutorial.rst b/doc/tutorial.rst deleted file mode 100644 index 4b7b381..0000000 --- a/doc/tutorial.rst +++ /dev/null @@ -1,37 +0,0 @@ -.. - Copyright (C) 2012-2014 EDF - - This file is part of SALOME PARAMETRIC module. - - SALOME PARAMETRIC module is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SALOME PARAMETRIC module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SALOME PARAMETRIC module. If not, see . - - -######## -Tutorial -######## - -This tutorial explains how to create and run a parametric study with the -PARAMETRIC module in Salome. In all this documentation, we will use the example -calculation code "DEVIATION" that is defined in the module GENERICSOLVER. -It is an implementation of a classical example: the computation of the -deviation of a cantilever beam. - -.. toctree:: - :maxdepth: 2 - - tut_deterministic.rst - tut_variables.rst - tut_values.rst - tut_solver.rst - tut_execution.rst diff --git a/doc/tutorial_compo.rst b/doc/tutorial_compo.rst new file mode 100644 index 0000000..2b19db8 --- /dev/null +++ b/doc/tutorial_compo.rst @@ -0,0 +1,37 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +###################################################################### +Tutorial: Parametric study using a SALOME component as the solver code +###################################################################### + +This tutorial explains how to create and run a parametric study using a SALOME +component as the solver code. We will use the example calculation code +"DEVIATION" that is defined in the module GENERICSOLVER. It is an +implementation of a classical example: the computation of the deviation of a +cantilever beam. + +.. toctree:: + :maxdepth: 2 + + tut_deterministic_compo.rst + tut_variables_compo.rst + tut_values_compo.rst + tut_solver_compo.rst + tut_execution_compo.rst diff --git a/doc/tutorial_python.rst b/doc/tutorial_python.rst new file mode 100644 index 0000000..fee5f14 --- /dev/null +++ b/doc/tutorial_python.rst @@ -0,0 +1,39 @@ +.. + Copyright (C) 2012-2014 EDF + + This file is part of SALOME PARAMETRIC module. + + SALOME PARAMETRIC module is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SALOME PARAMETRIC module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with SALOME PARAMETRIC module. If not, see . + + +################################################################### +Tutorial: Parametric study using a Python script as the solver code +################################################################### + +This tutorial explains how to create and run a parametric study using a Python +script as the solver code. We will use an example script that implements a +classical example: the computation of the deviation of a cantilever beam. + +This computation is done with the simple formula +*dev = (F * L * L * L) / (3. * E * I)*, where *dev* is the deviation, *F* is +the vertical force applied to the end of the beam, *L* is the length of the +beam, *E* is the Young's modulus and *I* is the section modulus. + +.. toctree:: + :maxdepth: 2 + + tut_variables_python.rst + tut_values_python.rst + tut_solver_python.rst + tut_execution_python.rst