From 6e764625e64b7495c8c3719cf1d42e527bb66c0f Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Wed, 10 Apr 2024 16:10:22 +0200 Subject: [PATCH] Documentation update and review corrections --- ...ef_algorithm_ParticleSwarmOptimization.rst | 2 + doc/en/ref_algorithm_ReducedModelingTest.rst | 131 +++++++++++++++++ doc/en/reference.rst | 1 + doc/en/snippets/MaximumNumberOfLocations.rst | 3 +- doc/en/snippets/MaximumNumberOfModes.rst | 10 ++ doc/en/snippets/PlotAndSave.rst | 9 ++ ...ef_algorithm_ParticleSwarmOptimization.rst | 2 + doc/fr/ref_algorithm_ReducedModelingTest.rst | 132 ++++++++++++++++++ doc/fr/reference.rst | 1 + doc/fr/snippets/MaximumNumberOfIterations.rst | 10 +- doc/fr/snippets/MaximumNumberOfLocations.rst | 3 +- doc/fr/snippets/MaximumNumberOfModes.rst | 11 ++ doc/fr/snippets/PlotAndSave.rst | 9 ++ .../daAlgorithms/ReducedModelingTest.py | 6 +- 14 files changed, 320 insertions(+), 10 deletions(-) create mode 100644 doc/en/ref_algorithm_ReducedModelingTest.rst create mode 100644 doc/en/snippets/MaximumNumberOfModes.rst create mode 100644 doc/en/snippets/PlotAndSave.rst create mode 100644 doc/fr/ref_algorithm_ReducedModelingTest.rst create mode 100644 doc/fr/snippets/MaximumNumberOfModes.rst create mode 100644 doc/fr/snippets/PlotAndSave.rst diff --git a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst index 82b1d52..40f44f9 100644 --- a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst @@ -54,6 +54,8 @@ this algorithm. The following stable and robust formulations are proposed here: pair: Variant ; OGCR pair: Variant ; SPSO-2011 pair: Variant ; AIS PSO + pair: Variant ; SIS PSO + pair: Variant ; PSIS PSO pair: Variant ; APSO pair: Variant ; SPSO-2011-SIS pair: Variant ; SPSO-2011-PSIS diff --git a/doc/en/ref_algorithm_ReducedModelingTest.rst b/doc/en/ref_algorithm_ReducedModelingTest.rst new file mode 100644 index 0000000..4748fb7 --- /dev/null +++ b/doc/en/ref_algorithm_ReducedModelingTest.rst @@ -0,0 +1,131 @@ +.. + Copyright (C) 2008-2024 EDF R&D + + This file is part of SALOME ADAO module. + + This library 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 2.1 of the License, or (at your option) any later version. + + This library 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 this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + + Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D + +.. index:: single: ReducedModelingTest +.. _section_ref_algorithm_ReducedModelingTest: + +Checking algorithm "*ReducedModelingTest*" +------------------------------------------ + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo00.rst + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo01.rst + +This checking algorithm provides a simple analysis of the characteristics of +the state collection from the point of view of reduction. It aims to diagnose +the complexity of the information present in the available state collection, +and the possibility to represent this state information in a space smaller than +the entire state collection. Technically, based on a classical SVD (Singular +Value Decomposition) and in the same way as a PCA (Principal Component +Analysis), it evaluates how information decreases with the number of singular +values, either as values or, from a statistical point of view, as remaining +variance. + +Once the analysis is complete, a summary is displayed and, on request, a +graphical representation of the same information is produced. + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo02.rst + +.. include:: snippets/EnsembleOfSnapshots.rst + +.. include:: snippets/ExcludeLocations.rst + +.. include:: snippets/MaximumNumberOfLocations.rst + +.. include:: snippets/MaximumNumberOfModes.rst + +.. include:: snippets/NameOfLocations.rst + +.. include:: snippets/NumberOfPrintedDigits.rst + +.. include:: snippets/PlotAndSave.rst + +.. include:: snippets/SampleAsExplicitHyperCube.rst + +.. include:: snippets/SampleAsIndependantRandomVariables.rst + +.. include:: snippets/SampleAsMinMaxLatinHyperCube.rst + +.. include:: snippets/SampleAsMinMaxSobolSequence.rst + +.. include:: snippets/SampleAsMinMaxStepHyperCube.rst + +.. include:: snippets/SampleAsnUplet.rst + +.. include:: snippets/SetDebug.rst + +.. include:: snippets/SetSeed.rst + +.. include:: snippets/ShowElementarySummary.rst + +StoreSupplementaryCalculations + .. index:: single: StoreSupplementaryCalculations + + *List of names*. This list indicates the names of the supplementary + variables, that can be available during or at the end of the algorithm, if + they are initially required by the user. Their availability involves, + potentially, costly calculations or memory consumptions. The default is then + a void list, none of these variables being calculated and stored by default + (excepted the unconditional variables). The possible names are in the + following list (the detailed description of each named variable is given in + the following part of this specific algorithmic documentation, in the + sub-section "*Information and variables available at the end of the + algorithm*"): [ + "EnsembleOfSimulations", + "EnsembleOfStates", + "Residus", + "SingularValues", + ]. + + Example : + ``{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}`` + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo04.rst + +.. include:: snippets/NoUnconditionalOutput.rst + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo05.rst + +.. include:: snippets/EnsembleOfSimulations.rst + +.. include:: snippets/EnsembleOfStates.rst + +.. include:: snippets/Residus.rst + +.. include:: snippets/SingularValues.rst + +.. ------------------------------------ .. +.. _section_ref_algorithm_ReducedModelingTest_examples: + +.. include:: snippets/Header2Algo06.rst + +- :ref:`section_ref_algorithm_FunctionTest` +- :ref:`section_ref_algorithm_ParallelFunctionTest` +- :ref:`section_ref_algorithm_EnsembleOfSimulationGenerationTask` +- :ref:`section_ref_algorithm_MeasurementsOptimalPositioningTask` + diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 4267aba..6b7b673 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -147,6 +147,7 @@ providing :ref:`section_theory`. ref_algorithm_ObservationSimulationComparisonTest ref_algorithm_ObserverTest ref_algorithm_ParallelFunctionTest + ref_algorithm_ReducedModelingTest ref_algorithm_SamplingTest ref_algorithm_TangentTest ref_checking_keywords diff --git a/doc/en/snippets/MaximumNumberOfLocations.rst b/doc/en/snippets/MaximumNumberOfLocations.rst index 039610d..0f4d273 100644 --- a/doc/en/snippets/MaximumNumberOfLocations.rst +++ b/doc/en/snippets/MaximumNumberOfLocations.rst @@ -5,7 +5,8 @@ MaximumNumberOfLocations found in the optimal search. The default value is 1. The optimal search may eventually find less positions than required by this key, as for example in the case where the residual associated to the approximation is lower than the - criterion and leads to the early termination of the optimal search. + criterion and leads to the early termination of the optimal search. It is + recommended to adapt this parameter to the needs on real problems. Example : ``{"MaximumNumberOfLocations":5}`` diff --git a/doc/en/snippets/MaximumNumberOfModes.rst b/doc/en/snippets/MaximumNumberOfModes.rst new file mode 100644 index 0000000..ee3b4fe --- /dev/null +++ b/doc/en/snippets/MaximumNumberOfModes.rst @@ -0,0 +1,10 @@ +.. index:: single: MaximumNumberOfModes + +MaximumNumberOfModes + *Integer value*. This key indicates the maximum possible number of + decomposition modes to be included in the reduction analysis. The default + value is 1.e6, which is very similar to no limit on this number of modes, and + it is recommended to adapt it to the needs of real problems. + + Example : + ``{"MaximumNumberOfModes":5}`` diff --git a/doc/en/snippets/PlotAndSave.rst b/doc/en/snippets/PlotAndSave.rst new file mode 100644 index 0000000..47e131c --- /dev/null +++ b/doc/en/snippets/PlotAndSave.rst @@ -0,0 +1,9 @@ +.. index:: single: PlotAndSave + +PlotAndSave + *Boolean value*. The variable leads to the display of results in graphical + form and the saving in a file of an associated figure. The default is + "False", the choices are "True" or "False". + + Example : + ``{"PlotAndSave":False}`` diff --git a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst index cdff929..e6bafe8 100644 --- a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst @@ -56,6 +56,8 @@ et robustes suivantes : pair: Variant ; OGCR pair: Variant ; SPSO-2011 pair: Variant ; AIS PSO + pair: Variant ; SIS PSO + pair: Variant ; PSIS PSO pair: Variant ; APSO pair: Variant ; SPSO-2011-SIS pair: Variant ; SPSO-2011-PSIS diff --git a/doc/fr/ref_algorithm_ReducedModelingTest.rst b/doc/fr/ref_algorithm_ReducedModelingTest.rst new file mode 100644 index 0000000..c916a3e --- /dev/null +++ b/doc/fr/ref_algorithm_ReducedModelingTest.rst @@ -0,0 +1,132 @@ +.. + Copyright (C) 2008-2024 EDF R&D + + This file is part of SALOME ADAO module. + + This library 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 2.1 of the License, or (at your option) any later version. + + This library 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 this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + + Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D + +.. index:: single: ReducedModelingTest +.. _section_ref_algorithm_ReducedModelingTest: + +Algorithme de vérification "*ReducedModelingTest*" +-------------------------------------------------- + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo00.rst + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo01.rst + +Cet algorithme de vérification permet d'analyser de manière simple les +caractéristiques de la collection d'états du point de vue de la réduction. Il +vise à diagnostiquer la complexité des informations présentes dans la +collection d'états disponible, et la possibilité de représenter ces +informations d'état dans un espace plus réduit que l'ensemble de la collection +d'états. Techniquement, en s'appuyant sur une décomposition classique de type +SVD (Singular Value Decomposition) et de la même manière qu'une PCA (Principal +Component Analysis), il évalue la manière avec laquelle l'information diminue +avec le nombre de valeurs singulières, soit en tant que valeurs, soit, d'un +point de vue statistique, en tant que variance restante. + +Une fois l'analyse terminée, un résumé est affiché et, sur demande, une +représentation graphique des mêmes informations est produite. + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo02.rst + +.. include:: snippets/EnsembleOfSnapshots.rst + +.. include:: snippets/ExcludeLocations.rst + +.. include:: snippets/MaximumNumberOfLocations.rst + +.. include:: snippets/MaximumNumberOfModes.rst + +.. include:: snippets/NameOfLocations.rst + +.. include:: snippets/NumberOfPrintedDigits.rst + +.. include:: snippets/PlotAndSave.rst + +.. include:: snippets/SampleAsExplicitHyperCube.rst + +.. include:: snippets/SampleAsIndependantRandomVariables.rst + +.. include:: snippets/SampleAsMinMaxLatinHyperCube.rst + +.. include:: snippets/SampleAsMinMaxSobolSequence.rst + +.. include:: snippets/SampleAsMinMaxStepHyperCube.rst + +.. include:: snippets/SampleAsnUplet.rst + +.. include:: snippets/SetDebug.rst + +.. include:: snippets/SetSeed.rst + +.. include:: snippets/ShowElementarySummary.rst + +StoreSupplementaryCalculations + .. index:: single: StoreSupplementaryCalculations + + *Liste de noms*. Cette liste indique les noms des variables supplémentaires, + qui peuvent être disponibles au cours du déroulement ou à la fin de + l'algorithme, si elles sont initialement demandées par l'utilisateur. Leur + disponibilité implique, potentiellement, des calculs ou du stockage coûteux. + La valeur par défaut est donc une liste vide, aucune de ces variables n'étant + calculée et stockée par défaut (sauf les variables inconditionnelles). Les + noms possibles pour les variables supplémentaires sont dans la liste suivante + (la description détaillée de chaque variable nommée est donnée dans la suite + de cette documentation par algorithme spécifique, dans la sous-partie + "*Informations et variables disponibles à la fin de l'algorithme*") : [ + "EnsembleOfSimulations", + "EnsembleOfStates", + "Residus", + "SingularValues", + ]. + + Exemple : + ``{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}`` + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo04.rst + +.. include:: snippets/NoUnconditionalOutput.rst + +.. ------------------------------------ .. +.. include:: snippets/Header2Algo05.rst + +.. include:: snippets/EnsembleOfSimulations.rst + +.. include:: snippets/EnsembleOfStates.rst + +.. include:: snippets/Residus.rst + +.. include:: snippets/SingularValues.rst + +.. ------------------------------------ .. +.. _section_ref_algorithm_ReducedModelingTest_examples: + +.. include:: snippets/Header2Algo06.rst + +- :ref:`section_ref_algorithm_FunctionTest` +- :ref:`section_ref_algorithm_ParallelFunctionTest` +- :ref:`section_ref_algorithm_EnsembleOfSimulationGenerationTask` +- :ref:`section_ref_algorithm_MeasurementsOptimalPositioningTask` + diff --git a/doc/fr/reference.rst b/doc/fr/reference.rst index 67825e2..a703cfb 100644 --- a/doc/fr/reference.rst +++ b/doc/fr/reference.rst @@ -149,6 +149,7 @@ section générale donnant :ref:`section_theory`. ref_algorithm_ObservationSimulationComparisonTest ref_algorithm_ObserverTest ref_algorithm_ParallelFunctionTest + ref_algorithm_ReducedModelingTest ref_algorithm_SamplingTest ref_algorithm_TangentTest ref_checking_keywords diff --git a/doc/fr/snippets/MaximumNumberOfIterations.rst b/doc/fr/snippets/MaximumNumberOfIterations.rst index 4ea877e..875aad1 100644 --- a/doc/fr/snippets/MaximumNumberOfIterations.rst +++ b/doc/fr/snippets/MaximumNumberOfIterations.rst @@ -3,11 +3,11 @@ MaximumNumberOfIterations *Valeur entière*. Cette clé indique le nombre maximum d'itérations internes possibles en optimisation itérative. Le défaut est 15000, qui est très - similaire à une absence de limite sur les itérations. Il est ainsi recommandé - d'adapter ce paramètre aux besoins pour des problèmes réels. Pour certains - optimiseurs, le nombre de pas effectif d'arrêt peut être légèrement différent - de la limite à cause d'exigences de contrôle interne de l'algorithme. On peut - se reporter à la partie décrivant les manières de + similaire à une absence de limite sur ce nombre d'itérations. Il est ainsi + recommandé d'adapter ce paramètre aux besoins pour des problèmes réels. Pour + certains optimiseurs, le nombre de pas effectif d'arrêt peut être légèrement + différent de la limite à cause d'exigences de contrôle interne de + l'algorithme. On peut se reporter à la partie décrivant les manières de :ref:`subsection_iterative_convergence_control` pour des recommandations plus détaillées. diff --git a/doc/fr/snippets/MaximumNumberOfLocations.rst b/doc/fr/snippets/MaximumNumberOfLocations.rst index 72c9e9f..e3105b3 100644 --- a/doc/fr/snippets/MaximumNumberOfLocations.rst +++ b/doc/fr/snippets/MaximumNumberOfLocations.rst @@ -6,7 +6,8 @@ MaximumNumberOfLocations optimale peut éventuellement trouver moins de positions que ce qui est requis par cette clé, comme par exemple dans le cas où le résidu associé à l'approximation est inférieur au critère et conduit à l'arrêt anticipé de la - recherche optimale. + recherche optimale. Il est recommandé de l’adapter aux besoins pour des + problèmes réels. Exemple : ``{"MaximumNumberOfLocations":5}`` diff --git a/doc/fr/snippets/MaximumNumberOfModes.rst b/doc/fr/snippets/MaximumNumberOfModes.rst new file mode 100644 index 0000000..af5f509 --- /dev/null +++ b/doc/fr/snippets/MaximumNumberOfModes.rst @@ -0,0 +1,11 @@ +.. index:: single: MaximumNumberOfModes + +MaximumNumberOfModes + *Valeur entière*. Cette clé indique le nombre maximum possible de modes de + décomposition sur lesquels va porter l'analyse de réduction. La valeur par + défaut est 1.e6, qui est très similaire à une absence de limite sur ce nombre + de modes, et il est recommandé de l'adapter aux besoins pour des problèmes + réels. + + Exemple : + ``{"MaximumNumberOfModes":5}`` diff --git a/doc/fr/snippets/PlotAndSave.rst b/doc/fr/snippets/PlotAndSave.rst new file mode 100644 index 0000000..da3bfae --- /dev/null +++ b/doc/fr/snippets/PlotAndSave.rst @@ -0,0 +1,9 @@ +.. index:: single: PlotAndSave + +PlotAndSave + *Valeur booléenne*. La variable conduit à l'affichage des résultats sous + forme graphique et à la sauvegarde en fichier d'une figure associée. La + valeur par défaut est "False", les choix sont "True" ou "False". + + Exemple : + ``{"PlotAndSave":False}`` diff --git a/src/daComposant/daAlgorithms/ReducedModelingTest.py b/src/daComposant/daAlgorithms/ReducedModelingTest.py index 43eba98..05f7198 100644 --- a/src/daComposant/daAlgorithms/ReducedModelingTest.py +++ b/src/daComposant/daAlgorithms/ReducedModelingTest.py @@ -118,7 +118,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): ) self.defineRequiredParameter( name = "MaximumNumberOfModes", - default = 15000, + default = 1000000, typecast = int, message = "Nombre maximal de modes pour l'analyse", minval = 0, @@ -144,9 +144,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): ) self.defineRequiredParameter( name = "ResultFile", - default = self._name + "_result_file", + default = self._name + "_result_file.pdf", typecast = str, - message = "Nom de base (hors extension) des fichiers de sauvegarde des résultats", + message = "Nom de base (y.c. extension) des fichiers de sauvegarde des résultats", ) self.defineRequiredParameter( name = "PlotAndSave", -- 2.39.2