Esempio n. 1
0
 def __init__( self, the_case_dir = None, the_output_mesh_name = None ) :
     """
     Constructs instance of this class
     """
     # Construct the base class first
     TFilePostProcessor.__init__( self )
     
     self.output_mesh_name = the_output_mesh_name
     self.case_dir = the_case_dir
     pass
Esempio n. 2
0
    def run( self, the_case_dir, the_output_med_file, the_output_mesh_name, the_foam_time ) :
        """
        Runs the main functionality
        """
        an_is_ok = TFilePostProcessor.run( self, 
                                           the_case_dir,
                                           the_output_med_file,
                                           the_output_mesh_name, 
                                           the_foam_time )
        if not an_is_ok :
            return False
        
        # Connect to SALOME
        import pysalome, VISU, visu
        from batchmode_salome import orb, naming_service, lcc, myStudyManager, myStudy

        aVisuGen = visu.Initialize( orb, naming_service, lcc, myStudyManager, myStudy, 0 )

        an_output_med_file = self.get_output_med_file()
        print_d( "an_output_med_file = \"%s\"" % an_output_med_file )

        aResult = aVisuGen.CopyAndImportFile( an_output_med_file )

        a_mesh_name = self.get_output_mesh_name()
        print_d( "a_mesh_name = \"%s\"" % a_mesh_name )

        aScalarMap = aVisuGen.ScalarMapOnField( aResult, a_mesh_name, VISU.NODE, 'Point U', 1 )
        aScalarMap.SetBarOrientation( VISU.ColoredPrs3d.HORIZONTAL )
        aScalarMap.SetPosition( 0.05, 0.01 )
        aScalarMap.SetSize( 0.90, 0.15 )
        aScalarMap.SetNbColors( 64 )
        aScalarMap.SetLabels( 5 )
        
        aViewManager = aVisuGen.GetViewManager()
        aView3D = aViewManager.Create3DView()
        aView3D.Display( aScalarMap );
        aView3D.FitAll()
        
        return True