2 Copyright (C) 2008-2024 EDF R&D
4 This file is part of SALOME ADAO module.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
24 .. index:: single: AdjointTest
25 .. _section_ref_algorithm_AdjointTest:
27 Algorithme de vérification "*AdjointTest*"
28 ------------------------------------------
30 .. ------------------------------------ ..
31 .. include:: snippets/Header2Algo01.rst
33 Cet algorithme permet de vérifier la qualité de l'adjoint d'un opérateur
34 :math:`F`, en calculant un résidu dont les propriétés théoriques sont connues.
35 Le test est applicable à un opérateur quelconque, d'évolution
36 :math:`\mathcal{D}` comme d'observation :math:`\mathcal{H}`.
38 Pour toutes les formules, avec :math:`\mathbf{x}` le point courant de
39 vérification, on prend :math:`\mathbf{dx}_0=Normal(0,\mathbf{x})` et
40 :math:`\mathbf{dx}=\alpha_0*\mathbf{dx}_0` avec :math:`\alpha_0` un paramètre
41 utilisateur de mise à l'échelle, par défaut à 1. :math:`F` est l'opérateur ou
42 le code de calcul (qui est ici défini par la commande d'opérateur d'observation
43 "*ObservationOperator*").
45 On observe le résidu suivant, qui est la différence de deux produits scalaires :
47 .. math:: R(\alpha) = | < TangentF_x(\mathbf{dx}) , \mathbf{y} > - < \mathbf{dx} , AdjointF_x(\mathbf{y}) > |
49 dans lequel la quantité optionnelle :math:`\mathbf{y}` doit être dans l'image
50 de :math:`F`. Si elle n'est pas donnée, on prend son évaluation par défaut
51 :math:`\mathbf{y} = F(\mathbf{x})`.
53 Ce résidu doit rester constamment égal à zéro à la précision du calcul.
55 .. ------------------------------------ ..
56 .. include:: snippets/Header2Algo12.rst
58 .. include:: snippets/FeaturePropDerivativeNeeded.rst
60 .. include:: snippets/FeaturePropParallelDerivativesOnly.rst
62 .. ------------------------------------ ..
63 .. include:: snippets/Header2Algo02.rst
65 .. include:: snippets/CheckingPoint.rst
67 .. include:: snippets/Observation.rst
69 .. include:: snippets/ObservationOperator.rst
71 .. ------------------------------------ ..
72 .. include:: snippets/Header2Algo03Chck.rst
74 .. include:: snippets/AmplitudeOfInitialDirection.rst
76 .. include:: snippets/EpsilonMinimumExponent.rst
78 .. include:: snippets/InitialDirection.rst
80 .. include:: snippets/NumberOfPrintedDigits.rst
82 .. include:: snippets/SetSeed.rst
84 StoreSupplementaryCalculations
85 .. index:: single: StoreSupplementaryCalculations
87 *Liste de noms*. Cette liste indique les noms des variables supplémentaires,
88 qui peuvent être disponibles au cours du déroulement ou à la fin de
89 l'algorithme, si elles sont initialement demandées par l'utilisateur. Leur
90 disponibilité implique, potentiellement, des calculs ou du stockage coûteux.
91 La valeur par défaut est donc une liste vide, aucune de ces variables n'étant
92 calculée et stockée par défaut (sauf les variables inconditionnelles). Les
93 noms possibles pour les variables supplémentaires sont dans la liste suivante
94 (la description détaillée de chaque variable nommée est donnée dans la suite
95 de cette documentation par algorithme spécifique, dans la sous-partie
96 "*Informations et variables disponibles à la fin de l'algorithme*") : [
99 "SimulatedObservationAtCurrentState",
103 ``{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}``
105 .. ------------------------------------ ..
106 .. include:: snippets/Header2Algo04.rst
108 .. include:: snippets/Residu.rst
110 .. ------------------------------------ ..
111 .. include:: snippets/Header2Algo05.rst
113 .. include:: snippets/CurrentState.rst
115 .. include:: snippets/Residu.rst
117 .. include:: snippets/SimulatedObservationAtCurrentState.rst
119 .. ------------------------------------ ..
120 .. _section_ref_algorithm_AdjointTest_examples:
122 .. include:: snippets/Header2Algo09.rst
124 .. include:: scripts/simple_AdjointTest.rst
126 .. literalinclude:: scripts/simple_AdjointTest.py
128 .. include:: snippets/Header2Algo10.rst
130 .. literalinclude:: scripts/simple_AdjointTest.res
133 .. ------------------------------------ ..
134 .. include:: snippets/Header2Algo06.rst
136 - :ref:`section_ref_algorithm_FunctionTest`
137 - :ref:`section_ref_algorithm_LinearityTest`
138 - :ref:`section_ref_algorithm_TangentTest`
139 - :ref:`section_ref_algorithm_GradientTest`
140 - :ref:`section_ref_algorithm_LocalSensitivityTest`