Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/superv.git] / examples / SupervRheolefGraph.py
index b537746d1ca14fc734ed05a59d865a39c6b03856..65c720f5e3e53716d621aca0f86fe3dc94605dc3 100755 (executable)
 from SuperV import *
 # Graph creation 
 aNewDataFlow = Graph( 'aNewDataFlow' )
-print aNewDataFlow.SetName( 'aNewDataFlow' )
-print aNewDataFlow.SetAuthor( '' )
-print aNewDataFlow.SetComment( '' )
+aNewDataFlow.SetName( 'aNewDataFlow' )
+aNewDataFlow.SetAuthor( '' )
+aNewDataFlow.SetComment( '' )
 aNewDataFlow.Coords( 0 , 0 )
 
-# Creation of Nodes
-InitCL = aNewDataFlow.Node( 'CLRheolef' , 'CLRheolef' , 'InitCL' )
-print InitCL.SetName( 'InitCL' )
-print InitCL.SetAuthor( '' )
-print InitCL.SetContainer( 'localhost/FactoryServer' )
-print InitCL.SetComment( '' )
-InitCL.Coords( 340 , 327 )
-MakeBox = aNewDataFlow.Node( 'GEOM' , 'GEOM' , 'MakeBox' )
-print MakeBox.SetName( 'MakeBox' )
-print MakeBox.SetAuthor( '' )
-print MakeBox.SetContainer( 'localhost/FactoryServer' )
-print MakeBox.SetComment( '' )
-MakeBox.Coords( 0 , 0 )
-MeshGeomShapeSup = aNewDataFlow.Node( 'QMG' , 'QMG' , 'MeshGeomShapeSup' )
-print MeshGeomShapeSup.SetName( 'MeshGeomShapeSup' )
-print MeshGeomShapeSup.SetAuthor( '' )
-print MeshGeomShapeSup.SetContainer( 'localhost/FactoryServer' )
-print MeshGeomShapeSup.SetComment( '' )
-MeshGeomShapeSup.Coords( 339 , 0 )
-SolveSup = aNewDataFlow.Node( 'Rheolef' , 'Rheolef' , 'SolveSup' )
-print SolveSup.SetName( 'SolveSup' )
-print SolveSup.SetAuthor( '' )
-print SolveSup.SetContainer( 'localhost/FactoryServer' )
-print SolveSup.SetComment( '' )
-SolveSup.Coords( 862 , 298 )
-ModifyCL = aNewDataFlow.Node( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' )
-print ModifyCL.SetName( 'ModifyCL' )
-print ModifyCL.SetAuthor( '' )
-print ModifyCL.SetContainer( 'localhost/FactoryServer' )
-print ModifyCL.SetComment( '' )
-ModifyCL.Coords( 509 , 328 )
-MakeBoolean = aNewDataFlow.Node( 'GEOM' , 'GEOM' , 'MakeBoolean' )
-print MakeBoolean.SetName( 'MakeBoolean' )
-print MakeBoolean.SetAuthor( '' )
-print MakeBoolean.SetContainer( 'localhost/FactoryServer' )
-print MakeBoolean.SetComment( '' )
-MakeBoolean.Coords( 171 , 0 )
-MakeBox_1 = aNewDataFlow.Node( 'GEOM' , 'GEOM' , 'MakeBox' )
-print MakeBox_1.SetName( 'MakeBox_1' )
-print MakeBox_1.SetAuthor( '' )
-print MakeBox_1.SetContainer( 'localhost/FactoryServer' )
-print MakeBox_1.SetComment( '' )
+# Creation of Factory Nodes
+
+InitCL = aNewDataFlow.FNode( 'CLRheolef' , 'CLRheolef' , 'InitCL' )
+InitCL.SetName( 'InitCL' )
+InitCL.SetAuthor( '' )
+InitCL.SetContainer( 'localhost/FactoryServer' )
+InitCL.SetComment( 'InitCL from CLRheolef' )
+InitCL.Coords( 414 , 334 )
+
+MakeBox = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeBox' )
+MakeBox.SetName( 'MakeBox' )
+MakeBox.SetAuthor( '' )
+MakeBox.SetContainer( 'localhost/FactoryServer' )
+MakeBox.SetComment( 'MakeBox from Geometry' )
+MakeBox.Coords( 7 , 29 )
+
+MeshGeomShapeSup = aNewDataFlow.FNode( 'QMG' , 'QMG' , 'MeshGeomShapeSup' )
+MeshGeomShapeSup.SetName( 'MeshGeomShapeSup' )
+MeshGeomShapeSup.SetAuthor( '' )
+MeshGeomShapeSup.SetContainer( 'localhost/FactoryServer' )
+MeshGeomShapeSup.SetComment( 'MeshGeomShapeSup from QMG' )
+MeshGeomShapeSup.Coords( 372 , 0 )
+
+SolveSup = aNewDataFlow.FNode( 'Rheolef' , 'Rheolef' , 'SolveSup' )
+SolveSup.SetName( 'SolveSup' )
+SolveSup.SetAuthor( '' )
+SolveSup.SetContainer( 'localhost/FactoryServer' )
+SolveSup.SetComment( 'SolveSup from Rheolef' )
+SolveSup.Coords( 1030 , 304 )
+
+ModifyCL = aNewDataFlow.FNode( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' )
+ModifyCL.SetName( 'ModifyCL' )
+ModifyCL.SetAuthor( '' )
+ModifyCL.SetContainer( 'localhost/FactoryServer' )
+ModifyCL.SetComment( 'ModifyCL from CLRheolef' )
+ModifyCL.Coords( 602 , 335 )
+
+MakeBoolean = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeBoolean' )
+MakeBoolean.SetName( 'MakeBoolean' )
+MakeBoolean.SetAuthor( '' )
+MakeBoolean.SetContainer( 'localhost/FactoryServer' )
+MakeBoolean.SetComment( 'MakeBoolean from Geometry' )
+MakeBoolean.Coords( 188 , 30 )
+
+MakeBox_1 = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeBox' )
+MakeBox_1.SetName( 'MakeBox_1' )
+MakeBox_1.SetAuthor( '' )
+MakeBox_1.SetContainer( 'localhost/FactoryServer' )
+MakeBox_1.SetComment( 'MakeBox from Geometry' )
 MakeBox_1.Coords( 0 , 325 )
-MakeTranslation = aNewDataFlow.Node( 'GEOM' , 'GEOM' , 'MakeTranslation' )
-print MakeTranslation.SetName( 'MakeTranslation' )
-print MakeTranslation.SetAuthor( '' )
-print MakeTranslation.SetContainer( 'localhost/FactoryServer' )
-print MakeTranslation.SetComment( '' )
-MakeTranslation.Coords( 165 , 325 )
-FindNode = aNewDataFlow.Node( 'QMG' , 'QMG' , 'FindNode' )
-print FindNode.SetName( 'FindNode' )
-print FindNode.SetAuthor( '' )
-print FindNode.SetContainer( 'localhost/FactoryServer' )
-print FindNode.SetComment( '' )
-FindNode.Coords( 510 , 0 )
-ValueOf = aNewDataFlow.Node( 'Rheolef' , 'Rheolef' , 'ValueOf' )
-print ValueOf.SetName( 'ValueOf' )
-print ValueOf.SetAuthor( '' )
-print ValueOf.SetContainer( 'localhost/FactoryServer' )
-print ValueOf.SetComment( '' )
-ValueOf.Coords( 692 , 43 )
-ModifyCL_1 = aNewDataFlow.Node( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' )
-print ModifyCL_1.SetName( 'ModifyCL_1' )
-print ModifyCL_1.SetAuthor( '' )
-print ModifyCL_1.SetContainer( 'localhost/FactoryServer' )
-print ModifyCL_1.SetComment( '' )
-ModifyCL_1.Coords( 674 , 328 )
-Plot = aNewDataFlow.Node( 'Rheolef' , 'Rheolef' , 'Plot' )
-print Plot.SetName( 'Plot' )
-print Plot.SetAuthor( '' )
-print Plot.SetContainer( 'localhost/FactoryServer' )
-print Plot.SetComment( '' )
-Plot.Coords( 860 , 43 )
-Add = aNewDataFlow.Node( 'AddComponent' , 'AddComponent' , 'Add' )
-print Add.SetName( 'Add' )
-print Add.SetAuthor( '' )
-print Add.SetContainer( 'localhost/FactoryServer' )
-print Add.SetComment( '' )
-Add.Coords( 0 , 650 )
-
-# Creation of intermediate Output variables and of links
+
+MakeTranslation = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeTranslation' )
+MakeTranslation.SetName( 'MakeTranslation' )
+MakeTranslation.SetAuthor( '' )
+MakeTranslation.SetContainer( 'localhost/FactoryServer' )
+MakeTranslation.SetComment( 'MakeTranslation from Geometry' )
+MakeTranslation.Coords( 190 , 325 )
+
+FindNode = aNewDataFlow.FNode( 'QMG' , 'QMG' , 'FindNode' )
+FindNode.SetName( 'FindNode' )
+FindNode.SetAuthor( '' )
+FindNode.SetContainer( 'localhost/FactoryServer' )
+FindNode.SetComment( 'FindNode from QMG' )
+FindNode.Coords( 621 , 0 )
+
+ValueOf = aNewDataFlow.FNode( 'Rheolef' , 'Rheolef' , 'ValueOf' )
+ValueOf.SetName( 'ValueOf' )
+ValueOf.SetAuthor( '' )
+ValueOf.SetContainer( 'localhost/FactoryServer' )
+ValueOf.SetComment( 'ValueOf from Rheolef' )
+ValueOf.Coords( 832 , 42 )
+
+ModifyCL_1 = aNewDataFlow.FNode( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' )
+ModifyCL_1.SetName( 'ModifyCL_1' )
+ModifyCL_1.SetAuthor( '' )
+ModifyCL_1.SetContainer( 'localhost/FactoryServer' )
+ModifyCL_1.SetComment( 'ModifyCL from CLRheolef' )
+ModifyCL_1.Coords( 800 , 334 )
+
+Plot = aNewDataFlow.FNode( 'Rheolef' , 'Rheolef' , 'Plot' )
+Plot.SetName( 'Plot' )
+Plot.SetAuthor( '' )
+Plot.SetContainer( 'localhost/FactoryServer' )
+Plot.SetComment( 'Plot from Rheolef' )
+Plot.Coords( 1029 , 41 )
+
+Add = aNewDataFlow.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
+Add.SetName( 'Add' )
+Add.SetAuthor( '' )
+Add.SetContainer( 'localhost/FactoryServer' )
+Add.SetComment( 'Add from AddComponent' )
+Add.Coords( 0 , 610 )
+
+# Creation of Links
 InitCLreturn = InitCL.Port( 'return' )
 ModifyCLmyRheolefData = aNewDataFlow.Link( InitCLreturn , ModifyCL.Port( 'myRheolefData' ) )
+
 MakeBoxshape = MakeBox.Port( 'shape' )
 MakeBooleanshape1 = aNewDataFlow.Link( MakeBoxshape , MakeBoolean.Port( 'shape1' ) )
+
 MeshGeomShapeSupreturn = MeshGeomShapeSup.Port( 'return' )
 SolveSupmyMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , SolveSup.Port( 'myMesh' ) )
-print SolveSupmyMesh.AddCoord( 1 , 836 , 509 )
-print SolveSupmyMesh.AddCoord( 2 , 835 , 320 )
-print SolveSupmyMesh.AddCoord( 3 , 499 , 321 )
-print SolveSupmyMesh.AddCoord( 4 , 498 , 152 )
+SolveSupmyMesh.AddCoord( 1 , 985 , 442 )
+SolveSupmyMesh.AddCoord( 2 , 984 , 301 )
+SolveSupmyMesh.AddCoord( 3 , 561 , 300 )
+SolveSupmyMesh.AddCoord( 4 , 561 , 83 )
+
 InitCLmyMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , InitCL.Port( 'myMesh' ) )
-print InitCLmyMesh.AddCoord( 1 , 333 , 570 )
-print InitCLmyMesh.AddCoord( 2 , 332 , 321 )
-print InitCLmyMesh.AddCoord( 3 , 499 , 321 )
-print InitCLmyMesh.AddCoord( 4 , 499 , 151 )
+InitCLmyMesh.AddCoord( 1 , 385 , 502 )
+InitCLmyMesh.AddCoord( 2 , 384 , 301 )
+InitCLmyMesh.AddCoord( 3 , 561 , 300 )
+InitCLmyMesh.AddCoord( 4 , 561 , 81 )
+
 FindNodeaMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , FindNode.Port( 'aMesh' ) )
-print FindNodeaMesh.AddCoord( 1 , 498 , 152 )
+
 SolveSupreturn = SolveSup.Port( 'return' )
 ValueOfaField = aNewDataFlow.Link( SolveSupreturn , ValueOf.Port( 'aField' ) )
-print ValueOfaField.AddCoord( 1 , 683 , 194 )
-print ValueOfaField.AddCoord( 2 , 682 , 16 )
-print ValueOfaField.AddCoord( 3 , 1000 , 17 )
-print ValueOfaField.AddCoord( 4 , 1001 , 450 )
+ValueOfaField.AddCoord( 1 , 818 , 122 )
+ValueOfaField.AddCoord( 2 , 817 , 26 )
+ValueOfaField.AddCoord( 3 , 1216 , 26 )
+ValueOfaField.AddCoord( 4 , 1218 , 385 )
+
 ModifyCLreturn = ModifyCL.Port( 'return' )
 ModifyCL_1myRheolefData = aNewDataFlow.Link( ModifyCLreturn , ModifyCL_1.Port( 'myRheolefData' ) )
+
 MakeBooleanshape = MakeBoolean.Port( 'shape' )
 MeshGeomShapeSupshape = aNewDataFlow.Link( MakeBooleanshape , MeshGeomShapeSup.Port( 'shape' ) )
-print MeshGeomShapeSupshape.AddCoord( 1 , 333 , 182 )
-print MeshGeomShapeSupshape.AddCoord( 2 , 332 , 153 )
+
 MakeBox_1shape = MakeBox_1.Port( 'shape' )
 MakeTranslationshape1 = aNewDataFlow.Link( MakeBox_1shape , MakeTranslation.Port( 'shape1' ) )
+
 MakeTranslationshape = MakeTranslation.Port( 'shape' )
 MakeBooleanshape2 = aNewDataFlow.Link( MakeTranslationshape , MakeBoolean.Port( 'shape2' ) )
-print MakeBooleanshape2.AddCoord( 1 , 163 , 182 )
-print MakeBooleanshape2.AddCoord( 2 , 163 , 321 )
-print MakeBooleanshape2.AddCoord( 3 , 326 , 321 )
-print MakeBooleanshape2.AddCoord( 4 , 327 , 477 )
+MakeBooleanshape2.AddCoord( 1 , 182 , 140 )
+MakeBooleanshape2.AddCoord( 2 , 181 , 261 )
+MakeBooleanshape2.AddCoord( 3 , 363 , 260 )
+MakeBooleanshape2.AddCoord( 4 , 363 , 411 )
+MakeBooleanshape2.AddCoord( 5 , 327 , 408 )
+
 FindNodereturn = FindNode.Port( 'return' )
 ValueOfnumberOfNode = aNewDataFlow.Link( FindNodereturn , ValueOf.Port( 'numberOfNode' ) )
-print ValueOfnumberOfNode.AddCoord( 1 , 673 , 224 )
-print ValueOfnumberOfNode.AddCoord( 2 , 672 , 151 )
+ValueOfnumberOfNode.AddCoord( 1 , 799 , 152 )
+ValueOfnumberOfNode.AddCoord( 2 , 798 , 81 )
+
 ValueOfreturn = ValueOf.Port( 'return' )
 PlotValue = aNewDataFlow.Link( ValueOfreturn , Plot.Port( 'Value' ) )
+
 ModifyCL_1return = ModifyCL_1.Port( 'return' )
 SolveSupmyRheolefData = aNewDataFlow.Link( ModifyCL_1return , SolveSup.Port( 'myRheolefData' ) )
+
 Addz = Add.Port( 'z' )
 MakeTranslationy1 = aNewDataFlow.Link( Addz , MakeTranslation.Port( 'y1' ) )
-print MakeTranslationy1.AddCoord( 1 , 161 , 537 )
-print MakeTranslationy1.AddCoord( 2 , 162 , 831 )
+MakeTranslationy1.AddCoord( 1 , 181 , 464 )
+MakeTranslationy1.AddCoord( 2 , 182 , 720 )
+
 FindNodey = aNewDataFlow.Link( Addz , FindNode.Port( 'y' ) )
-print FindNodey.AddCoord( 1 , 504 , 209 )
-print FindNodey.AddCoord( 2 , 503 , 832 )
+FindNodey.AddCoord( 1 , 592 , 139 )
+FindNodey.AddCoord( 2 , 593 , 720 )
+
 PlotPosition = aNewDataFlow.Link( Addz , Plot.Port( 'Position' ) )
-print PlotPosition.AddCoord( 1 , 854 , 228 )
-print PlotPosition.AddCoord( 2 , 855 , 832 )
+PlotPosition.AddCoord( 1 , 1010 , 150 )
+PlotPosition.AddCoord( 2 , 1011 , 720 )
 
 # Creation of Input datas
 InitCLstudyId = InitCL.Input( 'studyId' , 1)
@@ -183,7 +209,5 @@ PlotFilename = Plot.Input( 'Filename' , 'Result.plt')
 Addx = Add.Input( 'x' , 0)
 Addy = Add.Input( 'y' , 10)
 
-# Missing Input datas
-
 # Creation of Output variables
 AddFuncValue = Add.Port( 'FuncValue' )