]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Updating and extending examples
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Wed, 9 Oct 2013 10:53:43 +0000 (12:53 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Wed, 9 Oct 2013 10:53:43 +0000 (12:53 +0200)
20 files changed:
configure.ac
examples/daSalome/Makefile.am
examples/daSalome/test001_ADAO_JDC_using_strings.comm
examples/daSalome/test001_ADAO_JDC_using_strings.py [new file with mode: 0644]
examples/daSalome/test002_ADAO_JDC_using_strings.comm
examples/daSalome/test002_ADAO_JDC_using_strings.py [new file with mode: 0644]
examples/daSalome/test003_ADAO_JDC_using_scripts.comm.in
examples/daSalome/test003_ADAO_JDC_using_scripts.py.in [new file with mode: 0644]
examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.comm.in
examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.py.in [new file with mode: 0644]
examples/daSalome/test004_ADAO_JDC_using_scripts.py.in [new file with mode: 0644]
examples/daSalome/test005_ADAO_Operators.py.in [new file with mode: 0644]
examples/daSalome/test006_Observers.comm.in
examples/daSalome/test006_Observers.py.in [new file with mode: 0644]
examples/daSalome/test008_ADAO_Elementary_GradientTest.comm
examples/daSalome/test008_ADAO_Elementary_GradientTest.py [new file with mode: 0644]
examples/daSalome/test009_ADAO_Simple_GradientTest.comm
examples/daSalome/test009_ADAO_Simple_GradientTest.py [new file with mode: 0644]
examples/daSalome/test010_ADAO_Simple_AdjointTest.comm
examples/daSalome/test010_ADAO_Simple_AdjointTest.py [new file with mode: 0644]

index 6916b58daaa5d0c3d4075838847ceb921210c35f..1cadb704c293acb63d38478739292f650256b473 100644 (file)
@@ -125,10 +125,15 @@ AC_CONFIG_FILES([
         examples/Makefile
         examples/daSalome/Makefile
         examples/daSalome/test003_ADAO_JDC_using_scripts.comm
+        examples/daSalome/test003_ADAO_JDC_using_scripts.py
+        examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.comm
+        examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.py
         examples/daSalome/test004_ADAO_JDC_using_scripts.comm
+        examples/daSalome/test004_ADAO_JDC_using_scripts.py
         examples/daSalome/test005_ADAO_Operators.comm
-        examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.comm
+        examples/daSalome/test005_ADAO_Operators.py
         examples/daSalome/test006_Observers.comm
+        examples/daSalome/test006_Observers.py
         examples/daSkeletons/Makefile
         examples/daSkeletons/External_data_definition_by_scripts/Makefile
         examples/daSkeletons/External_data_definition_by_scripts/ADAO_Case.comm
index ef667f03acc9bf22bfa11c437c11489821f8f4f9..75937145ea142578c9be76ce452814721d47e4bf 100644 (file)
 include $(top_srcdir)/adm_local/make_common_starter.am
 
 DATA_INST = \
-       test001_ADAO_JDC_using_strings.comm \
-       test002_ADAO_JDC_using_strings.comm \
-       test003_ADAO_JDC_using_scripts.comm \
-       test003_ADAO_scripts_for_JDC.py \
-       test004_ADAO_JDC_using_scripts.comm \
-       test004_ADAO_scripts_for_JDC.py \
-       test005_ADAO_Operators.comm \
-       test005_ADAO_scripts_for_JDC.py \
-       test003_bis_ADAO_JDC_using_user_data_init.comm \
-       test003_bis_ADAO_user_data_init.py \
-       test003_bis_ADAO_scripts_for_JDC.py \
-       test006_Observers.comm \
-       test006_Observers_observer_with_file.py \
-       test006_Observers_init.py \
-       test006_Observers_Observation_Operator.py \
-       test006_Observers_var.py \
+        test001_ADAO_JDC_using_strings.comm \
+        test001_ADAO_JDC_using_strings.py \
+        test002_ADAO_JDC_using_strings.comm \
+        test002_ADAO_JDC_using_strings.py \
+        test003_ADAO_JDC_using_scripts.comm \
+        test003_ADAO_JDC_using_scripts.py \
+        test003_ADAO_scripts_for_JDC.py \
+        test003_bis_ADAO_JDC_using_user_data_init.comm \
+        test003_bis_ADAO_JDC_using_user_data_init.py \
+        test003_bis_ADAO_scripts_for_JDC.py \
+        test003_bis_ADAO_user_data_init.py \
+        test004_ADAO_JDC_using_scripts.comm \
+        test004_ADAO_JDC_using_scripts.py \
+        test004_ADAO_scripts_for_JDC.py \
+        test005_ADAO_Operators.comm\
+        test005_ADAO_Operators.py \
+        test005_ADAO_scripts_for_JDC.py \
+        test006_Observers.comm \
+        test006_Observers_init.py \
+        test006_Observers_Observation_Operator.py \
+        test006_Observers_observer_with_file.py \
+        test006_Observers.py \
+        test006_Observers_var.py \
         test008_ADAO_Elementary_GradientTest.comm \
-       test009_ADAO_Simple_GradientTest.comm \
-       test010_ADAO_Simple_AdjointTest.comm
+        test008_ADAO_Elementary_GradientTest.py \
+        test009_ADAO_Simple_GradientTest.comm \
+        test009_ADAO_Simple_GradientTest.py \
+        test010_ADAO_Simple_AdjointTest.comm \
+        test010_ADAO_Simple_AdjointTest.py
 
 examplesdasalome_DATA = ${DATA_INST}
 
 EXTRA_DIST = \
-       test001_ADAO_JDC_using_strings.comm \
-       test002_ADAO_JDC_using_strings.comm \
-       test003_ADAO_JDC_using_scripts.comm.in \
-       test003_ADAO_scripts_for_JDC.py \
-       test004_ADAO_JDC_using_scripts.comm.in \
-       test004_ADAO_scripts_for_JDC.py \
-       test005_ADAO_Operators.comm.in \
-       test005_ADAO_scripts_for_JDC.py \
-       test003_bis_ADAO_JDC_using_user_data_init.comm.in \
-       test003_bis_ADAO_user_data_init.py \
-       test003_bis_ADAO_scripts_for_JDC.py \
-       test006_Observers.comm.in \
-       test006_Observers_observer_with_file.py \
-       test006_Observers_init.py \
-       test006_Observers_Observation_Operator.py \
-       test006_Observers_var.py \
+        test001_ADAO_JDC_using_strings.comm \
+        test001_ADAO_JDC_using_strings.py \
+        test002_ADAO_JDC_using_strings.comm \
+        test002_ADAO_JDC_using_strings.py \
+        test003_ADAO_JDC_using_scripts.comm.in \
+        test003_ADAO_JDC_using_scripts.py.in \
+        test003_ADAO_scripts_for_JDC.py \
+        test003_bis_ADAO_JDC_using_user_data_init.comm.in \
+        test003_bis_ADAO_JDC_using_user_data_init.py.in \
+        test003_bis_ADAO_scripts_for_JDC.py \
+        test003_bis_ADAO_user_data_init.py \
+        test004_ADAO_JDC_using_scripts.comm.in \
+        test004_ADAO_JDC_using_scripts.py.in \
+        test004_ADAO_scripts_for_JDC.py \
+        test005_ADAO_Operators.comm.in \
+        test005_ADAO_Operators.py.in \
+        test005_ADAO_scripts_for_JDC.py \
+        test006_Observers.comm.in \
+        test006_Observers_init.py \
+        test006_Observers_Observation_Operator.py \
+        test006_Observers_observer_with_file.py \
+        test006_Observers.py.in \
+        test006_Observers_var.py \
         test008_ADAO_Elementary_GradientTest.comm \
-       test009_ADAO_Simple_GradientTest.comm \
-       test010_ADAO_Simple_AdjointTest.comm
+        test008_ADAO_Elementary_GradientTest.py \
+        test009_ADAO_Simple_GradientTest.comm \
+        test009_ADAO_Simple_GradientTest.py \
+        test010_ADAO_Simple_AdjointTest.comm \
+        test010_ADAO_Simple_AdjointTest.py
index 4196350325308c016df2c81d4876d8d0ef301b67..81133f3c86389acc718d4ae2566fc3eddc05000d 100644 (file)
@@ -28,4 +28,3 @@ ASSIMILATION_STUDY(Study_name='Test',
                                                   """import numpy
 xa=numpy.ravel(ADD.get('Analysis')[-1])
 print 'Analysis:',xa""",),);
-#CHECKSUM:05af4155253fa5540d31e30d50b2b2b3  -:FIN CHECKSUM
\ No newline at end of file
diff --git a/examples/daSalome/test001_ADAO_JDC_using_strings.py b/examples/daSalome/test001_ADAO_JDC_using_strings.py
new file mode 100644 (file)
index 0000000..2bd9acf
--- /dev/null
@@ -0,0 +1,50 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = 'Blue'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'String'
+Background_config['Data'] = '0 0 0'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'String'
+BackgroundError_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'String'
+Observation_config['Data'] = '1 1 1'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'String'
+ObservationError_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'String'
+ObservationOperator_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa"""
+study_config['UserPostAnalysis'] = Analysis_config
index efb2bbdd54c336487cb1ceceb54504f2f0641775..010f40ff5333b50e11ce67098b75cb024213d2af 100644 (file)
@@ -28,4 +28,3 @@ ASSIMILATION_STUDY(Study_name='Test',
                                                   """import numpy
 xa=numpy.ravel(ADD.get('Analysis')[-1])
 print 'Analysis:',xa""",),);
-#CHECKSUM:17bc9d8f671d897f163b094a1e21d53f  -:FIN CHECKSUM
\ No newline at end of file
diff --git a/examples/daSalome/test002_ADAO_JDC_using_strings.py b/examples/daSalome/test002_ADAO_JDC_using_strings.py
new file mode 100644 (file)
index 0000000..57d8adc
--- /dev/null
@@ -0,0 +1,50 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = '3DVAR'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'String'
+Background_config['Data'] = '0 0 0'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'String'
+BackgroundError_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'String'
+Observation_config['Data'] = '1 1 1'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'String'
+ObservationError_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'String'
+ObservationOperator_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa"""
+study_config['UserPostAnalysis'] = Analysis_config
index 16513f1eae46bffb935c93908a8bf5303235453a..c41dcd7e36efb67251c0c74c12bcf319dcfa246d 100644 (file)
@@ -16,10 +16,16 @@ ASSIMILATION_STUDY(Study_name='Test',
                                   data=_F(FROM='Script',
                                           SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),),
                    ObservationError=_F(Stored=0,
-                                      INPUT_TYPE='Matrix',
+                                       INPUT_TYPE='Matrix',
                                        data=_F(FROM='Script',
                                                SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),),
                    ObservationOperator=_F(Stored=0,
                                           INPUT_TYPE='Matrix',
                                           data=_F(FROM='Script',
-                                                  SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),),);
+                                                  SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),),
+                   UserPostAnalysis=_F(FROM='Template',
+                                       Template='AnalysisPrinter',
+                                       ValueTemplate=
+                                                  """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa""",),);
diff --git a/examples/daSalome/test003_ADAO_JDC_using_scripts.py.in b/examples/daSalome/test003_ADAO_JDC_using_scripts.py.in
new file mode 100644 (file)
index 0000000..3e75605
--- /dev/null
@@ -0,0 +1,51 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = '3DVAR'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'Script'
+Background_config['Data'] = 'test003_ADAO_scripts_for_JDC.py'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'Script'
+BackgroundError_config['Data'] = 'test003_ADAO_scripts_for_JDC.py'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'Script'
+Observation_config['Data'] = 'test003_ADAO_scripts_for_JDC.py'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'Script'
+ObservationError_config['Data'] = 'test003_ADAO_scripts_for_JDC.py'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'Script'
+ObservationOperator_config['Data'] = 'test003_ADAO_scripts_for_JDC.py'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSalome'
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa"""
+study_config['UserPostAnalysis'] = Analysis_config
index 152277e81f69cde951ced1cfd8855a7812832e40..bc03a7b82aea33faa0bf785e5a615e3b9344467b 100644 (file)
@@ -20,10 +20,16 @@ ASSIMILATION_STUDY(Study_name='Test',
                                        data=_F(FROM='Script',
                                                SCRIPT_FILE='test003_bis_ADAO_scripts_for_JDC.py',),),
                    ObservationOperator=_F(Stored=0,
-                                         INPUT_TYPE='Matrix',
+                                          INPUT_TYPE='Matrix',
                                           data=_F(FROM='Script',
                                                   SCRIPT_FILE='test003_bis_ADAO_scripts_for_JDC.py',),),
                    UserDataInit=_F(INIT_FILE='test003_bis_ADAO_user_data_init.py',
                                    TARGET_LIST=
                                    ('Background','BackgroundError','Observation',
-                                                 'ObservationError','ObservationOperator',),),);
+                                                 'ObservationError','ObservationOperator',),),
+                   UserPostAnalysis=_F(FROM='Template',
+                                       Template='AnalysisPrinter',
+                                       ValueTemplate=
+                                                  """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa""",),);
diff --git a/examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.py.in b/examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.py.in
new file mode 100644 (file)
index 0000000..cf4afcd
--- /dev/null
@@ -0,0 +1,57 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = '3DVAR'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'Script'
+Background_config['Data'] = 'test003_bis_ADAO_scripts_for_JDC.py'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'Script'
+BackgroundError_config['Data'] = 'test003_bis_ADAO_scripts_for_JDC.py'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'Script'
+Observation_config['Data'] = 'test003_bis_ADAO_scripts_for_JDC.py'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'Script'
+ObservationError_config['Data'] = 'test003_bis_ADAO_scripts_for_JDC.py'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'Script'
+ObservationOperator_config['Data'] = 'test003_bis_ADAO_scripts_for_JDC.py'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSalome'
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa"""
+study_config['UserPostAnalysis'] = Analysis_config
+Init_config = {}
+Init_config['Type'] = 'Dict'
+Init_config['From'] = 'Script'
+Init_config['Data'] = 'test003_bis_ADAO_user_data_init.py'
+Init_config['Target'] = ['Background','BackgroundError','Observation','ObservationError','ObservationOperator',]
+study_config['UserDataInit'] = Init_config
diff --git a/examples/daSalome/test004_ADAO_JDC_using_scripts.py.in b/examples/daSalome/test004_ADAO_JDC_using_scripts.py.in
new file mode 100644 (file)
index 0000000..bd6f8a0
--- /dev/null
@@ -0,0 +1,55 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = 'Blue'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'Script'
+Background_config['Data'] = 'test004_ADAO_scripts_for_JDC.py'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'Script'
+BackgroundError_config['Data'] = 'test004_ADAO_scripts_for_JDC.py'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'Script'
+Observation_config['Data'] = 'test004_ADAO_scripts_for_JDC.py'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'Script'
+ObservationError_config['Data'] = 'test004_ADAO_scripts_for_JDC.py'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'Script'
+ObservationOperator_config['Data'] = 'test004_ADAO_scripts_for_JDC.py'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSalome'
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+Xa = ADD.get("Analysis")[-1]
+print
+print "Size of Analysis = %i"%len(Xa)
+print "Min, mean, max   = %8.3f, %8.3f, %8.3f"%(min(Xa),numpy.mean(Xa),max(Xa))
+print
+"""
+study_config['UserPostAnalysis'] = Analysis_config
diff --git a/examples/daSalome/test005_ADAO_Operators.py.in b/examples/daSalome/test005_ADAO_Operators.py.in
new file mode 100644 (file)
index 0000000..3005493
--- /dev/null
@@ -0,0 +1,62 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = '3DVAR'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'String'
+Background_config['Data'] = '0 0 0'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'String'
+BackgroundError_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'String'
+Observation_config['Data'] = '1 1 1'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'String'
+ObservationError_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_FunctionDict = {}
+ObservationOperator_FunctionDict['Function'] = ['Direct', 'Tangent', 'Adjoint']
+ObservationOperator_FunctionDict['Script'] = {}
+ObservationOperator_FunctionDict['Script']['Direct'] = 'test005_ADAO_scripts_for_JDC.py'
+ObservationOperator_FunctionDict['Script']['Tangent'] = 'test005_ADAO_scripts_for_JDC.py'
+ObservationOperator_FunctionDict['Script']['Adjoint'] = 'test005_ADAO_scripts_for_JDC.py'
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Function'
+ObservationOperator_config['From'] = 'FunctionDict'
+ObservationOperator_config['Data'] = ObservationOperator_FunctionDict
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSalome'
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+Xb = Study.getBackground()
+Xa = ADD.get("Analysis")[-1]
+print
+print "Size of Background...........= %i"%len(Xb.A1)
+print "Size of Analysis.............= %i"%len(Xa)
+print "Min, mean, max of Analysis...= %8.3f, %8.3f, %8.3f"%(min(Xa),numpy.mean(Xa),max(Xa))
+print
+"""
+study_config['UserPostAnalysis'] = Analysis_config
index 26d95db78588be1b907b794cb1f74bbf43a4b8c3..97bcd4ecfcbd6850a6e873c51741139121673e91 100644 (file)
@@ -16,7 +16,7 @@ ASSIMILATION_STUDY(Study_name='test_observers',
                                   data=_F(FROM='Script',
                                           SCRIPT_FILE='test006_Observers_var.py',),),
                    ObservationError=_F(Stored=0,
-                                  INPUT_TYPE='Matrix',
+                                       INPUT_TYPE='Matrix',
                                        data=_F(FROM='Script',
                                                SCRIPT_FILE='test006_Observers_var.py',),),
                    ObservationOperator=_F(Stored=0,
@@ -31,7 +31,11 @@ ASSIMILATION_STUDY(Study_name='test_observers',
                                    ('Background','BackgroundError','Observation',
                                                  'ObservationError','AlgorithmParameters',),),
                    Observers=_F(SELECTION=('CurrentState','CostFunctionJ',),
-                                CostFunctionJ_data=_F(NodeType='String',
+                                CurrentState_data=_F(Info='CurrentState',
+                                                     NodeType='Script',
+                                                     Value='test006_Observers_observer_with_file.py',),
+                                CostFunctionJ_data=_F(Info='CostFunctionJ',
+                                                      NodeType='String',
                                                       Value=
 """print "  ---> observerCost"
 print "       var  =",var[:]
@@ -51,6 +55,4 @@ filename = os.path.join("/tmp", "imageCost_%02i.ps"%numero)
 print "       imageCost %s"%filename
 gp.hardcopy(filename=filename, color=1)
 numero += 1
-""",),
-                                CurrentState_data=_F(NodeType='Script',
-                                                     Value='test006_Observers_observer_with_file.py',),),);
+""",),),);
diff --git a/examples/daSalome/test006_Observers.py.in b/examples/daSalome/test006_Observers.py.in
new file mode 100644 (file)
index 0000000..da76ded
--- /dev/null
@@ -0,0 +1,91 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'test_observers'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = '3DVAR'
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'Script'
+Background_config['Data'] = 'test006_Observers_var.py'
+Background_config['Stored'] = '0'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'Script'
+BackgroundError_config['Data'] = 'test006_Observers_var.py'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'Script'
+Observation_config['Data'] = 'test006_Observers_var.py'
+Observation_config['Stored'] = '0'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'Script'
+ObservationError_config['Data'] = 'test006_Observers_var.py'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_FunctionDict = {}
+ObservationOperator_FunctionDict['Function'] = ['Direct', 'Tangent', 'Adjoint']
+ObservationOperator_FunctionDict['Script'] = {}
+ObservationOperator_FunctionDict['Script']['Direct'] = 'test006_Observers_Observation_Operator.py'
+ObservationOperator_FunctionDict['Script']['Tangent'] = 'test006_Observers_Observation_Operator.py'
+ObservationOperator_FunctionDict['Script']['Adjoint'] = 'test006_Observers_Observation_Operator.py'
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Function'
+ObservationOperator_config['From'] = 'FunctionDict'
+ObservationOperator_config['Data'] = ObservationOperator_FunctionDict
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSalome'
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'Script'
+AlgorithmParameters_config['Data'] = 'test006_Observers_var.py'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
+Init_config = {}
+Init_config['Type'] = 'Dict'
+Init_config['From'] = 'Script'
+Init_config['Data'] = 'test006_Observers_init.py'
+Init_config['Target'] = ['Background','BackgroundError','Observation','ObservationError','AlgorithmParameters',]
+study_config['UserDataInit'] = Init_config
+observers = {}
+observers["CostFunctionJ"] = {}
+observers["CostFunctionJ"]["number"] = 3
+observers["CostFunctionJ"]["nodetype"] = "String"
+observers["CostFunctionJ"]["String"] = """print "  ---> observerCost"
+print "       var  =",var[:]
+print "       info =",info
+#
+import Gnuplot
+import os
+try:
+  numero
+except NameError:
+  numero = 0
+gp = Gnuplot.Gnuplot()
+gp('set style data lines')
+gp('set title  "'+str(info)+'"')
+gp.plot( Gnuplot.Data( var[:] ) )
+filename = os.path.join("/tmp", "imageCost_%02i.ps"%numero)
+print "       imageCost %s"%filename
+gp.hardcopy(filename=filename, color=1)
+numero += 1
+"""
+observers["CostFunctionJ"]["info"] = """CostFunctionJ"""
+observers["CurrentState"] = {}
+observers["CurrentState"]["number"] = 4
+observers["CurrentState"]["nodetype"] = "Script"
+observers["CurrentState"]["Script"] = "test006_Observers_observer_with_file.py"
+observers["CurrentState"]["info"] = """CurrentState"""
+study_config['Observers'] = observers
index b70cc2286cb589dc5329c5be27441991ce98fe4c..73973a0f22271a5ec568be82e4f8ca724ad94ed9 100644 (file)
@@ -1,6 +1,5 @@
 
 CHECKING_STUDY(Study_name='Elementary gradient test',
-               Study_repertory='/home/ahbhhjp/ADAO',
                Debug=0,
                Algorithm='GradientTest',
                CheckingPoint=_F(Stored=0,
@@ -14,4 +13,3 @@ CHECKING_STUDY(Study_name='Elementary gradient test',
                AlgorithmParameters=_F(INPUT_TYPE='Dict',
                                       data=_F(FROM='String',
                                               STRING='{ "SetSeed" : 1000 }',),),);
-#CHECKSUM:195fb2032d0dcb0cb5668d4084352fb0  -:FIN CHECKSUM
\ No newline at end of file
diff --git a/examples/daSalome/test008_ADAO_Elementary_GradientTest.py b/examples/daSalome/test008_ADAO_Elementary_GradientTest.py
new file mode 100644 (file)
index 0000000..4d15507
--- /dev/null
@@ -0,0 +1,31 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'CHECKING_STUDY'
+study_config['Name'] = 'Elementary gradient test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = 'GradientTest'
+CheckingPoint_config = {}
+CheckingPoint_config['Type'] = 'Vector'
+CheckingPoint_config['From'] = 'String'
+CheckingPoint_config['Data'] = '1 1 1'
+CheckingPoint_config['Stored'] = '0'
+study_config['CheckingPoint'] = CheckingPoint_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'String'
+ObservationOperator_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'String'
+AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
index 3cc522ebbfed72e6a45106513e6563b4f2977766..56da492b48232b528e82c9af4f0e67b9571c749b 100644 (file)
@@ -13,4 +13,3 @@ CHECKING_STUDY(Study_name='Test',
                AlgorithmParameters=_F(INPUT_TYPE='Dict',
                                       data=_F(FROM='String',
                                               STRING='{ "SetSeed" : 1000 }',),),);
-#CHECKSUM:b61b9cb1c617749ecfcf3fbfa3fadde1  -:FIN CHECKSUM
\ No newline at end of file
diff --git a/examples/daSalome/test009_ADAO_Simple_GradientTest.py b/examples/daSalome/test009_ADAO_Simple_GradientTest.py
new file mode 100644 (file)
index 0000000..4349c4e
--- /dev/null
@@ -0,0 +1,31 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'CHECKING_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = 'GradientTest'
+CheckingPoint_config = {}
+CheckingPoint_config['Type'] = 'Vector'
+CheckingPoint_config['From'] = 'String'
+CheckingPoint_config['Data'] = '1 1 1'
+CheckingPoint_config['Stored'] = '0'
+study_config['CheckingPoint'] = CheckingPoint_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'String'
+ObservationOperator_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1 ; 1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'String'
+AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
index 07f4668fca48d6e6ee6d407ff889fbe932032885..af873790fb1c3aaaca05a14c4381ead4a5d217c2 100644 (file)
@@ -13,4 +13,3 @@ CHECKING_STUDY(Study_name='Test',
                AlgorithmParameters=_F(INPUT_TYPE='Dict',
                                       data=_F(FROM='String',
                                               STRING='{ "SetSeed" : 1000 }',),),);
-#CHECKSUM:66b339da11b97e97e44e775a4cdb1824  -:FIN CHECKSUM
\ No newline at end of file
diff --git a/examples/daSalome/test010_ADAO_Simple_AdjointTest.py b/examples/daSalome/test010_ADAO_Simple_AdjointTest.py
new file mode 100644 (file)
index 0000000..1d60dc8
--- /dev/null
@@ -0,0 +1,31 @@
+#-*-coding:iso-8859-1-*- 
+study_config = {} 
+study_config['StudyType'] = 'CHECKING_STUDY'
+study_config['Name'] = 'Test'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = 'AdjointTest'
+CheckingPoint_config = {}
+CheckingPoint_config['Type'] = 'Vector'
+CheckingPoint_config['From'] = 'String'
+CheckingPoint_config['Data'] = '1 1 1'
+CheckingPoint_config['Stored'] = '0'
+study_config['CheckingPoint'] = CheckingPoint_config
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Matrix'
+ObservationOperator_config['From'] = 'String'
+ObservationOperator_config['Data'] = '1 0 0 ; 0 1 0 ; 0 0 1 ; 1 0 0 ; 0 1 0 ; 0 0 1'
+ObservationOperator_config['Stored'] = '0'
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'String'
+AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config