Skip to content
Snippets Groups Projects
2DPhaseDiagram_PlotScriptV2.py 111 KiB
Newer Older
  • Learn to ignore specific revisions
  • Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    anglesLUTColorBar.ScalarBarThickness = 16
    anglesLUTColorBar.ScalarBarLength = 0.33
    
    # Properties modified on anglesLUTColorBar
    anglesLUTColorBar.DrawTickLabels = 0
    anglesLUTColorBar.AddRangeLabels = 0
    
    # Properties modified on anglesLUTColorBar
    anglesLUTColorBar.Title = 'angle $\\alpha$'
    # anglesLUTColorBar.Title = 'angle $\\angle$'
    anglesLUTColorBar.HorizontalTitle = 1
    anglesLUTColorBar.TitleFontSize = 20
    # Properties modified on anglesLUTColorBar
    anglesLUTColorBar.LabelFontSize = 20
    
    anglesLUTColorBar.TitleFontSize = 24
    # Properties modified on anglesLUTColorBar
    anglesLUTColorBar.LabelFontSize = 20
    
    # Properties modified on anglesLUTColorBar
    anglesLUTColorBar.DrawTickMarks = 0
    
    
    
    
    # Properties modified on renderView1.AxesGrid
    renderView1.AxesGrid.GridColor = [0.1803921568627451, 0.20392156862745098, 0.21176470588235294]
    
    
    # only label 2 axes...
    renderView1.AxesGrid.AxesToLabel = 7
    
    renderView1.OrientationAxesVisibility = 0
    
    #### saving camera placements for all active views
    
    # current camera placement for renderView1
    renderView1.InteractionMode = '2D'
    renderView1.CameraPosition = [0.0, 7.295131721662212, 0.5]
    renderView1.CameraFocalPoint = [0.0, 10.0, 0.5]
    renderView1.CameraViewUp = [0.0, 0.0, 1.0]
    renderView1.CameraParallelScale = 0.7000714249274855
    
    
    # DRAW LINE
    
    #
    # # create a new 'Line'
    # line1 = Line()
    #
    # # find source
    # xMLStructuredGridReader1 = FindSource('XMLStructuredGridReader1')
    #
    # # Properties modified on line1
    # line1.Point1 = [0.3, 0.0, 0.0]
    # line1.Point2 = [0.3, 0.0, 1.0]
    # line1.Resolution = 500
    # # Properties modified on line1Display
    #
    #
    # # get active view
    # renderView1 = GetActiveViewOrCreate('RenderView')
    # # uncomment following to set a specific view size
    # # renderView1.ViewSize = [1380, 518]
    #
    # # show data in view
    # line1Display = Show(line1, renderView1)
    #
    # # trace defaults for the display properties.
    # line1Display.Representation = 'Surface'
    # line1Display.ColorArrayName = [None, '']
    # line1Display.OSPRayScaleArray = 'Texture Coordinates'
    # line1Display.OSPRayScaleFunction = 'PiecewiseFunction'
    # line1Display.SelectOrientationVectors = 'None'
    # line1Display.ScaleFactor = 0.1
    # line1Display.SelectScaleArray = 'None'
    # line1Display.GlyphType = 'Arrow'
    # line1Display.GlyphTableIndexArray = 'None'
    # line1Display.GaussianRadius = 0.005
    # line1Display.SetScaleArray = ['POINTS', 'Texture Coordinates']
    # line1Display.ScaleTransferFunction = 'PiecewiseFunction'
    # line1Display.OpacityArray = ['POINTS', 'Texture Coordinates']
    # line1Display.OpacityTransferFunction = 'PiecewiseFunction'
    # line1Display.DataAxesGrid = 'GridAxesRepresentation'
    # line1Display.PolarAxes = 'PolarAxesRepresentation'
    #
    # # init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
    # line1Display.OSPRayScaleFunction.Points = [1.0, 0.8602941036224365, 0.5, 0.0, 1.213836476688135, 0.625, 0.5, 0.0, 1.3616352081298828, 0.6691176295280457, 0.5, 0.0, 1.6666333299996667, 0.8676470518112183, 0.5, 0.0, 1.7358490228652954, 0.6911764740943909, 0.5, 0.0, 2.0, 0.8014705777168274, 0.5, 0.0]
    #
    # # init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
    # line1Display.ScaleTransferFunction.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 0.2138364766881351, 0.625, 0.5, 0.0, 0.3616352081298828, 0.6691176295280457, 0.5, 0.0, 0.6666333299996667, 0.8676470518112183, 0.5, 0.0, 0.7358490228652954, 0.6911764740943909, 0.5, 0.0, 1.0, 0.8014705777168274, 0.5, 0.0]
    #
    # # init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
    # line1Display.OpacityTransferFunction.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 0.2138364766881351, 0.625, 0.5, 0.0, 0.3616352081298828, 0.6691176295280457, 0.5, 0.0, 0.6666333299996667, 0.8676470518112183, 0.5, 0.0, 0.7358490228652954, 0.6911764740943909, 0.5, 0.0, 1.0, 0.8014705777168274, 0.5, 0.0]
    #
    # # find source
    # transform1 = FindSource('Transform1')
    #
    # # update the view to ensure updated data information
    # renderView1.Update()
    #
    # # change solid color
    # line1Display.AmbientColor = [1.0, 1.0, 0.4980392156862745]
    # line1Display.DiffuseColor = [1.0, 1.0, 0.4980392156862745]
    #
    # # change representation type
    # line1Display.SetRepresentationType('Points')
    #
    # line1Display.PointSize = 3.0
    # # reset view to fit data bounds
    # renderView1.ResetCamera(0.30000001192092896, 0.30000001192092896, 0.0, 0.0, 0.0, 1.0)
    #
    # # toggle 3D widget visibility (only when running from the GUI)
    # Hide3DWidgets(proxy=line1)
    #
    # #### saving camera placements for all active views
    #
    # # current camera placement for renderView1
    # renderView1.InteractionMode = '2D'
    # renderView1.CameraPosition = [0.30000001192092896, -1.9318516525781368, 0.5]
    # renderView1.CameraFocalPoint = [0.30000001192092896, 0.0, 0.5]
    # renderView1.CameraViewUp = [0.0, 0.0, 1.0]
    # renderView1.CameraParallelScale = 0.7320500000000002
    #
    
    
    # # reset view to fit data
    # renderView1.ResetCamera()
    
    
    if drawLine:
        # create a new 'Line'
        line1 = Line()
    
        # Properties modified on line1
        line1.Point1 = [0.3, 0.0, 0.0]
        line1.Point2 = [0.3, 0.0, 1.0]
        line1.Resolution = 400
    
        # get active view
        renderView1 = GetActiveViewOrCreate('RenderView')
        # uncomment following to set a specific view size
        # renderView1.ViewSize = [1046, 545]
    
        # show data in view
        line1Display = Show(line1, renderView1)
    
        # trace defaults for the display properties.
        line1Display.Representation = 'Surface'
        line1Display.ColorArrayName = [None, '']
        line1Display.OSPRayScaleArray = 'Texture Coordinates'
        line1Display.OSPRayScaleFunction = 'PiecewiseFunction'
        line1Display.SelectOrientationVectors = 'None'
        line1Display.ScaleFactor = 0.1
        line1Display.SelectScaleArray = 'None'
        line1Display.GlyphType = 'Arrow'
        line1Display.GlyphTableIndexArray = 'None'
        line1Display.GaussianRadius = 0.005
        line1Display.SetScaleArray = ['POINTS', 'Texture Coordinates']
        line1Display.ScaleTransferFunction = 'PiecewiseFunction'
        line1Display.OpacityArray = ['POINTS', 'Texture Coordinates']
        line1Display.OpacityTransferFunction = 'PiecewiseFunction'
        line1Display.DataAxesGrid = 'GridAxesRepresentation'
        line1Display.PolarAxes = 'PolarAxesRepresentation'
    
        # init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
        line1Display.OSPRayScaleFunction.Points = [1.0, 0.8602941036224365, 0.5, 0.0, 1.213836476688135, 0.625, 0.5, 0.0, 1.3616352081298828, 0.6691176295280457, 0.5, 0.0, 1.6666333299996667, 0.8676470518112183, 0.5, 0.0, 1.7358490228652954, 0.6911764740943909, 0.5, 0.0, 2.0, 0.8014705777168274, 0.5, 0.0]
    
        # init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
        line1Display.ScaleTransferFunction.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 0.2138364766881351, 0.625, 0.5, 0.0, 0.3616352081298828, 0.6691176295280457, 0.5, 0.0, 0.6666333299996667, 0.8676470518112183, 0.5, 0.0, 0.7358490228652954, 0.6911764740943909, 0.5, 0.0, 1.0, 0.8014705777168274, 0.5, 0.0]
    
        # init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
        line1Display.OpacityTransferFunction.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 0.2138364766881351, 0.625, 0.5, 0.0, 0.3616352081298828, 0.6691176295280457, 0.5, 0.0, 0.6666333299996667, 0.8676470518112183, 0.5, 0.0, 0.7358490228652954, 0.6911764740943909, 0.5, 0.0, 1.0, 0.8014705777168274, 0.5, 0.0]
    
        # find source
        xMLStructuredGridReader1 = FindSource('XMLStructuredGridReader1')
    
        # find source
        transform1 = FindSource('Transform1')
    
        # update the view to ensure updated data information
        renderView1.Update()
    
        # change representation type
        line1Display.SetRepresentationType('Points')
    
        # change solid color
        line1Display.AmbientColor = [1.0, 1.0, 0.4980392156862745]
        line1Display.DiffuseColor = [1.0, 1.0, 0.4980392156862745]
    
        # Properties modified on line1Display
        line1Display.PointSize = 3.0
    
        # toggle 3D widget visibility (only when running from the GUI)
        Hide3DWidgets(proxy=line1)
    
        # reset view to fit data
        renderView1.ResetCamera()
    
    # reset view to fit data
    renderView1.ResetCamera()
    
    #### saving camera placements for all active views
    
    # current camera placement for renderView1
    renderView1.InteractionMode = '2D'
    renderView1.CameraPosition = [0.0, -14.510745305395833, 0.5]
    renderView1.CameraFocalPoint = [0.0, 5.0, 0.5]
    renderView1.CameraViewUp = [0.0, 0.0, 1.0]
    renderView1.CameraParallelScale = 0.7506135276429463
    
    
    
    
    
    #
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    # if case == 1:
    if gamma == '0':
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
        # get color transfer function/color map for 'angles'
        anglesLUT = GetColorTransferFunction('angles')
        anglesLUT.AutomaticRescaleRangeMode = "Grow and update on 'Apply'"
        anglesLUT.InterpretValuesAsCategories = 0
        anglesLUT.AnnotationsInitialized = 0
        anglesLUT.ShowCategoricalColorsinDataRangeOnly = 0
        anglesLUT.RescaleOnVisibilityChange = 0
        anglesLUT.EnableOpacityMapping = 1
        anglesLUT.RGBPoints = [0.0, 0.23137254902, 0.298039215686, 0.752941176471, 0.9632241725921631, 0.865, 0.865, 0.865, 1.5707963267948966, 0.705882352941, 0.0156862745098, 0.149019607843]
        anglesLUT.UseLogScale = 0
        anglesLUT.ColorSpace = 'Diverging'
        anglesLUT.UseBelowRangeColor = 0
        anglesLUT.BelowRangeColor = [0.0, 0.0, 0.0]
        anglesLUT.UseAboveRangeColor = 0
        anglesLUT.AboveRangeColor = [0.5, 0.5, 0.5]
        anglesLUT.NanColor = [1.0, 1.0, 0.0]
        anglesLUT.NanOpacity = 1.0
        anglesLUT.Discretize = 1
        anglesLUT.NumberOfTableValues = 256
        anglesLUT.ScalarRangeInitialized = 1.0
        anglesLUT.HSVWrap = 0
        anglesLUT.VectorComponent = 0
        anglesLUT.VectorMode = 'Magnitude'
        anglesLUT.AllowDuplicateScalars = 1
        anglesLUT.Annotations = ['1.57', '$\\pi / 2$', '0.78', '$\\pi/4$', '0', '0']
        anglesLUT.ActiveAnnotatedValues = []
        anglesLUT.IndexedColors = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0]
        anglesLUT.IndexedOpacities = [1.0, 1.0, 1.0, 1.0]
    
        # get opacity transfer function/opacity map for 'angles'
        anglesPWF = GetOpacityTransferFunction('angles')
        anglesPWF.Points = [0.0, 0.136764707416296, 0.5, 0.0, 0.705621357414266, 1.0, 0.5, 0.0, 0.82168139570297, 1.0, 0.5, 0.0, 0.9799451305746117, 1.0, 0.5, 0.0, 1.0960051688633157, 1.0, 0.5, 0.0, 1.5707963267948966, 1.0, 0.5, 0.0]
        anglesPWF.AllowDuplicateScalars = 1
        anglesPWF.UseLogScale = 0
        anglesPWF.ScalarRangeInitialized = 1
    
        # Properties modified on anglesLUT
        anglesLUT.InterpretValuesAsCategories = 1
        anglesLUT.AnnotationsInitialized = 1
    
        # Properties modified on anglesLUT
        anglesLUT.Annotations = ['1.57', '$\\pi / 2$', '0.78', '$\\pi/4$', '0', '0', '1.5707963267948966', '1.5708']
    
        # Properties modified on anglesLUT
        anglesLUT.Annotations = ['1.57', '$\\pi / 2$', '0.78', '$\\pi/4$', '0', '0']
        anglesLUT.IndexedColors = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0]
        anglesLUT.IndexedOpacities = [1.0, 1.0, 1.0]
    
        # Properties modified on anglesLUT
        anglesLUT.Annotations = ['1.57', '$\\pi / 2$', '0', '0']
        anglesLUT.IndexedColors = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0]
        anglesLUT.IndexedOpacities = [1.0, 1.0]
    
        # Properties modified on anglesLUT
        anglesLUT.Annotations = ['1.5707963267948966', '$\\pi / 2$', '0', '0']
    
        # Properties modified on anglesLUT
        anglesLUT.IndexedColors = [1.0, 0.0, 0.0, 1.0, 0.0, 0.0]
    
        # Properties modified on anglesLUT
        anglesLUT.IndexedColors = [1.0, 0.0, 0.0, 0.23137254901960785, 0.2980392156862745, 0.7529411764705882]
        # Properties modified on anglesLUT
        anglesLUT.IndexedColors = [0.7058823529411765, 0.01568627450980392, 0.14901960784313725, 0.23137254901960785, 0.2980392156862745, 0.7529411764705882]
    
        # Properties modified on anglesLUT
        anglesLUT.IndexedOpacities = [1.0, 0.02]
    
        # Properties modified on anglesLUT
        anglesLUT.IndexedOpacities = [1.0, 0.05]
    
        # Properties modified on anglesLUT
        anglesLUT.IndexedOpacities = [1.0, 0.1]
        anglesLUT.IndexedOpacities = [1.0, 1.0]
    
        # #TEST: (only for 100SP..)
        # anglesLUT.IndexedOpacities = [1.0, 0.03]
        # transform1Display.Opacity = 0.1  #overall Opacity
    
    
    
    
    
    
    if curvature == 1 :
    
        # find source
        transform1 = FindSource('Transform1')
    
        # set active source
        SetActiveSource(transform1)
    
        # get color transfer function/color map for 'angles'
        anglesLUT = GetColorTransferFunction('angles')
        anglesLUT.RGBPoints = [0.0, 0.23137254902, 0.298039215686, 0.752941176471, 0.7853981633974483, 0.865, 0.865, 0.865, 1.5707963267948966, 0.705882352941, 0.0156862745098, 0.149019607843]
        anglesLUT.ScalarRangeInitialized = 1.0
        anglesLUT.Annotations = ['0', '0', '1.5707963267948966', '$\\pi/2$', '0.785398163', '$\\pi/4$']
        anglesLUT.IndexedColors = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0]
        anglesLUT.IndexedOpacities = [1.0, 1.0, 1.0]
    
        # get opacity transfer function/opacity map for 'angles'
        anglesPWF = GetOpacityTransferFunction('angles')
        anglesPWF.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 0.33589355211648514, 0.625, 0.5, 0.0, 0.5680552565701278, 0.6691176295280457, 0.5, 0.0, 1.0471451860825267, 0.8676470518112183, 0.5, 0.0, 1.15586894219242, 0.6911764740943909, 0.5, 0.0, 1.5707963267948966, 0.8014705777168274, 0.5, 0.0]
        anglesPWF.ScalarRangeInitialized = 1
    
        # get active view
        renderView1 = GetActiveViewOrCreate('RenderView')
        # uncomment following to set a specific view size
        # renderView1.ViewSize = [1046, 545]
    
        # get display properties
        transform1Display = GetDisplayProperties(transform1, view=renderView1)
    
        # set scalar coloring
        ColorBy(transform1Display, ('POINTS', 'curvature'))
    
        # Hide the scalar bar for this color map if no visible data is colored by it.
        HideScalarBarIfNotNeeded(anglesLUT, renderView1)
    
        # rescale color and/or opacity maps used to include current data range
        transform1Display.RescaleTransferFunctionToDataRange(True, False)
    
        # show color bar/color legend
        transform1Display.SetScalarBarVisibility(renderView1, True)
    
        # get color transfer function/color map for 'curvature'
        curvatureLUT = GetColorTransferFunction('curvature')
        curvatureLUT.RGBPoints = [-74.1, 0.001462, 0.000466, 0.013866, -73.517583, 0.002258, 0.001295, 0.018331, -72.93531449999999, 0.003279, 0.002305, 0.023708, -72.3528975, 0.004512, 0.00349, 0.029965, -71.77062899999999, 0.00595, 0.004843, 0.03713, -71.18821199999998, 0.007588, 0.006356, 0.044973, -70.60594350000001, 0.009426, 0.008022, 0.052844, -70.02352650000002, 0.011465, 0.009828, 0.06075, -69.44110949999998, 0.013708, 0.011771, 0.068667, -68.858841, 0.016156, 0.01384, 0.076603, -68.276424, 0.018815, 0.016026, 0.084584, -67.6941555, 0.021692, 0.01832, 0.09261, -67.1117385, 0.024792, 0.020715, 0.100676, -66.52946999999999, 0.028123, 0.023201, 0.108787, -65.947053, 0.031696, 0.025765, 0.116965, -65.36463599999999, 0.03552, 0.028397, 0.125209, -64.78236749999999, 0.039608, 0.03109, 0.133515, -64.19995049999999, 0.04383, 0.03383, 0.141886, -63.61768199999998, 0.048062, 0.036607, 0.150327, -63.03526499999998, 0.05232, 0.039407, 0.158841, -62.452996500000005, 0.056615, 0.04216, 0.167446, -61.870579500000005, 0.060949, 0.044794, 0.176129, -61.28816249999998, 0.06533, 0.047318, 0.184892, -60.705894, 0.069764, 0.049726, 0.193735, -60.12347700000001, 0.074257, 0.052017, 0.20266, -59.541208499999996, 0.078815, 0.054184, 0.211667, -58.9587915, 0.083446, 0.056225, 0.220755, -58.37652299999999, 0.088155, 0.058133, 0.229922, -57.79410599999999, 0.092949, 0.059904, 0.239164, -57.21183749999999, 0.097833, 0.061531, 0.248477, -56.62942049999998, 0.102815, 0.06301, 0.257854, -56.04700349999999, 0.107899, 0.064335, 0.267289, -55.464734999999976, 0.113094, 0.065492, 0.276784, -54.882317999999984, 0.118405, 0.066479, 0.286321, -54.30004950000001, 0.123833, 0.067295, 0.295879, -53.71763250000001, 0.12938, 0.067935, 0.305443, -53.135363999999996, 0.135053, 0.068391, 0.315, -52.552947, 0.140858, 0.068654, 0.324538, -51.970530000000004, 0.146785, 0.068738, 0.334011, -51.3882615, 0.152839, 0.068637, 0.343404, -50.8058445, 0.159018, 0.068354, 0.352688, -50.22357599999999, 0.165308, 0.067911, 0.361816, -49.64115899999999, 0.171713, 0.067305, 0.370771, -49.05889049999998, 0.178212, 0.066576, 0.379497, -48.47647349999998, 0.184801, 0.065732, 0.387973, -47.89405649999999, 0.19146, 0.064818, 0.396152, -47.31178800000001, 0.198177, 0.063862, 0.404009, -46.729370999999986, 0.204935, 0.062907, 0.411514, -46.1471025, 0.211718, 0.061992, 0.418647, -45.56468550000001, 0.218512, 0.061158, 0.425392, -44.982417, 0.225302, 0.060445, 0.431742, -44.400000000000006, 0.232077, 0.059889, 0.437695, -43.817583, 0.238826, 0.059517, 0.443256, -43.235314499999994, 0.245543, 0.059352, 0.448436, -42.652897499999995, 0.25222, 0.059415, 0.453248, -42.07062899999999, 0.258857, 0.059706, 0.45771, -41.48821199999999, 0.265447, 0.060237, 0.46184, -40.90594349999998, 0.271994, 0.060994, 0.46566, -40.323526499999986, 0.278493, 0.061978, 0.46919, -39.741109499999986, 0.284951, 0.063168, 0.472451, -39.158840999999974, 0.291366, 0.064553, 0.475462, -38.57642399999998, 0.29774, 0.066117, 0.478243, -37.994155500000005, 0.304081, 0.067835, 0.480812, -37.411738500000006, 0.310382, 0.069702, 0.483186, -36.82947, 0.316654, 0.07169, 0.48538, -36.247053, 0.322899, 0.073782, 0.487408, -35.664636, 0.329114, 0.075972, 0.489287, -35.0823675, 0.335308, 0.078236, 0.491024, -34.4999505, 0.341482, 0.080564, 0.492631, -33.917681999999985, 0.347636, 0.082946, 0.494121, -33.33526499999999, 0.353773, 0.085373, 0.495501, -32.752996500000016, 0.359898, 0.087831, 0.496778, -32.17057949999998, 0.366012, 0.090314, 0.49796, -31.58816249999999, 0.372116, 0.092816, 0.499053, -31.005894000000012, 0.378211, 0.095332, 0.500067, -30.423476999999977, 0.384299, 0.097855, 0.501002, -29.8412085, 0.390384, 0.100379, 0.501864, -29.258791500000008, 0.396467, 0.102902, 0.502658, -28.676522999999996, 0.402548, 0.10542, 0.503386, -28.094105999999996, 0.408629, 0.10793, 0.504052, -27.51183749999999, 0.414709, 0.110431, 0.504662, -26.929420499999992, 0.420791, 0.11292, 0.505215, -26.347003499999992, 0.426877, 0.115395, 0.505714, -25.764734999999988, 0.432967, 0.117855, 0.50616, -25.182317999999988, 0.439062, 0.120298, 0.506555, -24.600049499999976, 0.445163, 0.122724, 0.506901, -24.017632499999984, 0.451271, 0.125132, 0.507198, -23.435364000000007, 0.457386, 0.127522, 0.507448, -22.852946999999972, 0.463508, 0.129893, 0.507652, -22.270530000000008, 0.46964, 0.132245, 0.507809, -21.688261500000003, 0.47578, 0.134577, 0.507921, -21.105844500000003, 0.481929, 0.136891, 0.507989, -20.523576, 0.488088, 0.139186, 0.508011, -19.941159, 0.494258, 0.141462, 0.507988, -19.358890499999987, 0.500438, 0.143719, 0.50792, -18.776473499999994, 0.506629, 0.145958, 0.507806, -18.194056499999995, 0.512831, 0.148179, 0.507648, -17.611787999999983, 0.519045, 0.150383, 0.507443, -17.02937099999999, 0.52527, 0.152569, 0.507192, -16.447102500000014, 0.531507, 0.154739, 0.506895, -15.864685499999979, 0.537755, 0.156894, 0.506551, -15.282417000000002, 0.544015, 0.159033, 0.506159, -14.70000000000001, 0.550287, 0.161158, 0.505719, -14.117582999999975, 0.556571, 0.163269, 0.50523, -13.535314499999998, 0.562866, 0.165368, 0.504692, -12.952897500000006, 0.569172, 0.167454, 0.504105, -12.370628999999994, 0.57549, 0.16953, 0.503466, -11.788211999999994, 0.581819, 0.171596, 0.502777, -11.20594349999999, 0.588158, 0.173652, 0.502035, -10.62352649999999, 0.594508, 0.175701, 0.501241, -10.04110949999999, 0.600868, 0.177743, 0.500394, -9.458840999999978, 0.607238, 0.179779, 0.499492, -8.876423999999986, 0.613617, 0.181811, 0.498536, -8.294155499999974, 0.620005, 0.18384, 0.497524, -7.71173850000001, 0.626401, 0.185867, 0.496456, -7.129469999999998, 0.632805, 0.187893, 0.495332, -6.547053000000005, 0.639216, 0.189921, 0.49415, -5.964636000000013, 0.645633, 0.191952, 0.49291, -5.382367500000001, 0.652056, 0.193986, 0.491611, -4.7999505000000084, 0.658483, 0.196027, 0.490253, -4.217681999999996, 0.664915, 0.198075, 0.488836, -3.6352649999999898, 0.671349, 0.200133, 0.487358, -3.052996499999992, 0.677786, 0.202203, 0.485819, -2.4705794999999853, 0.684224, 0.204286, 0.484219, -1.8881624999999929, 0.690661, 0.206384, 0.482558, -1.3058939999999808, 0.697098, 0.208501, 0.480835, -0.7234769999999884, 0.703532, 0.210638, 0.479049, -0.14120850000000473, 0.709962, 0.212797, 0.477201, 0.4412085000000161, 0.716387, 0.214982, 0.47529, 1.0234770000000282, 0.722805, 0.217194, 0.473316, 1.6058939999999922, 0.729216, 0.219437, 0.471279, 2.1881625000000042, 0.735616, 0.221713, 0.46918, 2.7705794999999966, 0.742004, 0.224025, 0.467018, 3.3529965000000033, 0.748378, 0.226377, 0.464794, 3.935265000000001, 0.754737, 0.228772, 0.462509, 4.517682000000008, 0.761077, 0.231214, 0.460162, 5.099950499999977, 0.767398, 0.233705, 0.457755, 5.682367500000012, 0.773695, 0.236249, 0.455289, 6.264636000000024, 0.779968, 0.238851, 0.452765, 6.847052999999988, 0.786212, 0.241514, 0.450184, 7.429470000000009, 0.792427, 0.244242, 0.447543, 8.011738500000021, 0.798608, 0.24704, 0.444848, 8.594155499999985, 0.804752, 0.249911, 0.442102, 9.176423999999997, 0.810855, 0.252861, 0.439305, 9.758841000000032, 0.816914, 0.255895, 0.436461, 10.341109500000002, 0.822926, 0.259016, 0.433573, 10.923526500000008, 0.828886, 0.262229, 0.430644, 11.5059435, 0.834791, 0.26554, 0.427671, 12.088212000000013, 0.840636, 0.268953, 0.424666, 12.670629000000005, 0.846416, 0.272473, 0.421631, 13.252897500000017, 0.852126, 0.276106, 0.418573, 13.83531450000001, 0.857763, 0.279857, 0.415496, 14.417582999999993, 0.86332, 0.283729, 0.412403, 15.000000000000014, 0.868793, 0.287728, 0.409303, 15.582416999999978, 0.874176, 0.291859, 0.406205, 16.16468549999999, 0.879464, 0.296125, 0.403118, 16.747102500000025, 0.884651, 0.30053, 0.400047, 17.329370999999995, 0.889731, 0.305079, 0.397002, 17.911788, 0.8947, 0.309773, 0.393995, 18.4940565, 0.899552, 0.314616, 0.391037, 19.076473500000006, 0.904281, 0.31961, 0.388137, 19.6588905, 0.908884, 0.324755, 0.385308, 20.24115900000001, 0.913354, 0.330052, 0.382563, 20.823576000000003, 0.917689, 0.3355, 0.379915, 21.405844499999986, 0.921884, 0.341098, 0.377376, 21.988261500000007, 0.925937, 0.346844, 0.374959, 22.57053000000002, 0.929845, 0.352734, 0.372677, 23.152946999999983, 0.933606, 0.358764, 0.370541, 23.73536400000002, 0.937221, 0.364929, 0.368567, 24.31763250000003, 0.940687, 0.371224, 0.366762, 24.900049499999994, 0.944006, 0.377643, 0.365136, 25.482318000000006, 0.94718, 0.384178, 0.363701, 26.064735000000027, 0.95021, 0.39082, 0.362468, 26.64700350000001, 0.953099, 0.397563, 0.361438, 27.229420500000003, 0.955849, 0.4044, 0.360619, 27.811837499999996, 0.958464, 0.411324, 0.360014, 28.394106000000008, 0.960949, 0.418323, 0.35963, 28.976523000000014, 0.96331, 0.42539, 0.359469, 29.558791500000012, 0.965549, 0.432519, 0.359529, 30.141208499999976, 0.967671, 0.439703, 0.35981, 30.72347699999999, 0.96968, 0.446936, 0.360311, 31.305894000000023, 0.971582, 0.45421, 0.36103, 31.888162500000035, 0.973381, 0.46152, 0.361965, 32.4705795, 0.975082, 0.468861, 0.363111, 33.05299650000002, 0.97669, 0.476226, 0.364466, 33.635265000000004, 0.97821, 0.483612, 0.366025, 34.217681999999996, 0.979645, 0.491014, 0.367783, 34.79995050000001, 0.981, 0.498428, 0.369734, 35.3823675, 0.982279, 0.505851, 0.371874, 35.964635999999985, 0.983485, 0.51328, 0.374198, 36.547053000000005, 0.984622, 0.520713, 0.376698, 37.12947000000001, 0.985693, 0.528148, 0.379371, 37.71173849999998, 0.9867, 0.535582, 0.38221, 38.294155500000016, 0.987646, 0.543015, 0.38521, 38.87642400000003, 0.988533, 0.550446, 0.388365, 39.45884099999999, 0.989363, 0.557873, 0.391671, 40.041109500000005, 0.990138, 0.565296, 0.395122, 40.623526500000025, 0.990871, 0.572706, 0.398714, 41.20594349999999, 0.991558, 0.580107, 0.402441, 41.788212, 0.992196, 0.587502, 0.406299, 42.370628999999994, 0.992785, 0.594891, 0.410283, 42.952897500000006, 0.993326, 0.602275, 0.41439, 43.53531450000001, 0.993834, 0.609644, 0.418613, 44.11758300000001, 0.994309, 0.616999, 0.42295, 44.70000000000002, 0.994738, 0.62435, 0.427397, 45.28241700000001, 0.995122, 0.631696, 0.431951, 45.86468550000002, 0.99548, 0.639027, 0.436607, 46.447102499999986, 0.99581, 0.646344, 0.441361, 47.029371, 0.996096, 0.653659, 0.446213, 47.61178800000002, 0.996341, 0.660969, 0.45116, 48.1940565, 0.99658, 0.668256, 0.456192, 48.776473499999994, 0.996775, 0.675541, 0.461314, 49.35889050000003, 0.996925, 0.682828, 0.466526, 49.941159, 0.997077, 0.690088, 0.471811, 50.523576000000006, 0.997186, 0.697349, 0.477182, 51.1058445, 0.997254, 0.704611, 0.482635, 51.68826150000001, 0.997325, 0.711848, 0.488154, 52.27052999999998, 0.997351, 0.719089, 0.493755, 52.852947000000015, 0.997351, 0.726324, 0.499428, 53.43536400000001, 0.997341, 0.733545, 0.505167, 54.01763249999999, 0.997285, 0.740772, 0.510983, 54.60004950000001, 0.997228, 0.747981, 0.516859, 55.18231800000004, 0.997138, 0.75519, 0.522806, 55.764735, 0.997019, 0.762398, 0.528821, 56.3470035, 0.996898, 0.769591, 0.534892, 56.92942050000002, 0.996727, 0.776795, 0.541039, 57.511837499999984, 0.996571, 0.783977, 0.547233, 58.09410600000001, 0.996369, 0.791167, 0.553499, 58.676523, 0.996162, 0.798348, 0.55982, 59.2587915, 0.995932, 0.805527, 0.566202, 59.84120850000002, 0.99568, 0.812706, 0.572645, 60.42347700000002, 0.995424, 0.819875, 0.57914, 61.005893999999984, 0.995131, 0.827052, 0.585701, 61.58816249999998, 0.994851, 0.834213, 0.592307, 62.17057950000003, 0.994524, 0.841387, 0.598983, 62.752996499999995, 0.994222, 0.84854, 0.605696, 63.33526499999999, 0.993866, 0.855711, 0.612482, 63.91768200000001, 0.993545, 0.862859, 0.619299, 64.49995050000001, 0.99317, 0.870024, 0.626189, 65.0823675, 0.992831, 0.877168, 0.633109, 65.664636, 0.99244, 0.88433, 0.640099, 66.247053, 0.992089, 0.89147, 0.647116, 66.82947000000001, 0.991688, 0.898627, 0.654202, 67.41173850000001, 0.991332, 0.905763, 0.661309, 67.9941555, 0.99093, 0.912915, 0.668481, 68.57642399999997, 0.99057, 0.920049, 0.675675, 69.15884100000002, 0.990175, 0.927196, 0.682926, 69.74110950000002, 0.989815, 0.934329, 0.690198, 70.32352649999999, 0.989434, 0.94147, 0.697519, 70.9059435, 0.989077, 0.948604, 0.704863, 71.48821200000003, 0.988717, 0.955742, 0.712242, 72.070629, 0.988367, 0.962878, 0.719649, 72.6528975, 0.988033, 0.970012, 0.727077, 73.23531449999999, 0.987691, 0.977154, 0.734536, 73.81758300000001, 0.987387, 0.984288, 0.742002, 74.4, 0.987053, 0.991438, 0.749504]
        curvatureLUT.ColorSpace = 'RGB'
        curvatureLUT.NanColor = [0.0, 1.0, 0.0]
        curvatureLUT.ScalarRangeInitialized = 1.0
    
        # get opacity transfer function/opacity map for 'curvature'
        curvaturePWF = GetOpacityTransferFunction('curvature')
        curvaturePWF.Points = [-74.1, 0.8602941036224365, 0.5, 0.0, -42.34528321181193, 0.625, 0.5, 0.0, -20.397171592712397, 0.6691176295280457, 0.5, 0.0, 24.89504950495052, 0.8676470518112183, 0.5, 0.0, 35.173579895496374, 0.6911764740943909, 0.5, 0.0, 74.4, 0.8014705777168274, 0.5, 0.0]
        curvaturePWF.ScalarRangeInitialized = 1
    
        # create a new 'Contour'
        contour1 = Contour(Input=transform1)
        contour1.ContourBy = ['POINTS', 'Type']
        contour1.Isosurfaces = [2.0]
        contour1.PointMergeMethod = 'Uniform Binning'
    
        # find source
        line1 = FindSource('Line1')
    
        # find source
        xMLStructuredGridReader1 = FindSource('XMLStructuredGridReader1')
    
        # Properties modified on contour1
        contour1.ContourBy = ['POINTS', 'curvature']
        contour1.Isosurfaces = [0.0]
    
        # show data in view
        contour1Display = Show(contour1, renderView1)
    
        # trace defaults for the display properties.
        contour1Display.Representation = 'Surface'
        contour1Display.ColorArrayName = ['POINTS', 'curvature']
        contour1Display.LookupTable = curvatureLUT
        contour1Display.OSPRayScaleArray = 'curvature'
        contour1Display.OSPRayScaleFunction = 'PiecewiseFunction'
        contour1Display.SelectOrientationVectors = 'None'
        contour1Display.ScaleFactor = 0.08543854954749906
        contour1Display.SelectScaleArray = 'curvature'
        contour1Display.GlyphType = 'Arrow'
        contour1Display.GlyphTableIndexArray = 'curvature'
        contour1Display.GaussianRadius = 0.004271927477374953
        contour1Display.SetScaleArray = ['POINTS', 'curvature']
        contour1Display.ScaleTransferFunction = 'PiecewiseFunction'
        contour1Display.OpacityArray = ['POINTS', 'curvature']
        contour1Display.OpacityTransferFunction = 'PiecewiseFunction'
        contour1Display.DataAxesGrid = 'GridAxesRepresentation'
        contour1Display.PolarAxes = 'PolarAxesRepresentation'
    
        # init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
        contour1Display.OSPRayScaleFunction.Points = [1.0, 0.8602941036224365, 0.5, 0.0, 1.213836476688135, 0.625, 0.5, 0.0, 1.3616352081298828, 0.6691176295280457, 0.5, 0.0, 1.6666333299996667, 0.8676470518112183, 0.5, 0.0, 1.7358490228652954, 0.6911764740943909, 0.5, 0.0, 2.0, 0.8014705777168274, 0.5, 0.0]
    
        # init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
        contour1Display.ScaleTransferFunction.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 2.5142493840581125e-39, 0.625, 0.5, 0.0, 4.252039284300157e-39, 0.6691176295280457, 0.5, 0.0, 7.838150278676329e-39, 0.8676470518112183, 0.5, 0.0, 8.651975477491057e-39, 0.6911764740943909, 0.5, 0.0, 1.1757813367477812e-38, 0.8014705777168274, 0.5, 0.0]
    
        # init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
        contour1Display.OpacityTransferFunction.Points = [0.0, 0.8602941036224365, 0.5, 0.0, 2.5142493840581125e-39, 0.625, 0.5, 0.0, 4.252039284300157e-39, 0.6691176295280457, 0.5, 0.0, 7.838150278676329e-39, 0.8676470518112183, 0.5, 0.0, 8.651975477491057e-39, 0.6911764740943909, 0.5, 0.0, 1.1757813367477812e-38, 0.8014705777168274, 0.5, 0.0]
    
        # show color bar/color legend
        contour1Display.SetScalarBarVisibility(renderView1, True)
    
        # update the view to ensure updated data information
        renderView1.Update()
    
        # turn off scalar coloring
        ColorBy(contour1Display, None)
    
        # Hide the scalar bar for this color map if no visible data is colored by it.
        HideScalarBarIfNotNeeded(curvatureLUT, renderView1)
    
        # change solid color
        contour1Display.AmbientColor = [1.0, 1.0, 0.4980392156862745]
        contour1Display.DiffuseColor = [1.0, 1.0, 0.4980392156862745]
    
        # change solid color
        contour1Display.AmbientColor = [0.0, 0.0, 0.0]
        contour1Display.DiffuseColor = [0.0, 0.0, 0.0]
    
        # set active source
        SetActiveSource(transform1)
    
        # Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
        curvatureLUT.ApplyPreset('Cold and Hot', True)
    
        # set active source
        SetActiveSource(contour1)
    
        # change solid color
        contour1Display.AmbientColor = [1.0, 1.0, 0.4980392156862745]
        contour1Display.DiffuseColor = [1.0, 1.0, 0.4980392156862745]
    
        # change solid color
        contour1Display.AmbientColor = [1.0, 1.0, 1.0]
        contour1Display.DiffuseColor = [1.0, 1.0, 1.0]
    
        #### saving camera placements for all active views
    
        # current camera placement for renderView1
        renderView1.InteractionMode = '2D'
        renderView1.CameraPosition = [0.0, -14.510745305395833, 0.5]
        renderView1.CameraFocalPoint = [0.0, 5.0, 0.5]
        renderView1.CameraViewUp = [0.0, 0.0, 1.0]
        renderView1.CameraParallelScale = 0.7506135276429463
    
        curvatureLUTColorBar = GetScalarBar(curvatureLUT, renderView1)
        curvatureLUTColorBar.Title = 'curvature'
        curvatureLUTColorBar.ComponentTitle = ''
    
        # Properties modified on curvatureLUTColorBar
        curvatureLUTColorBar.Title = '$ \\kappa $'
        curvatureLUTColorBar.HorizontalTitle = 1
        curvatureLUTColorBar.TitleFontSize = 24
        curvatureLUTColorBar.LabelFontSize = 20
    
    
        # get active source.
        contour1 = GetActiveSource()
    
        # get active view
        renderView1 = GetActiveViewOrCreate('RenderView')
        # uncomment following to set a specific view size
        # renderView1.ViewSize = [1046, 545]
    
        # get display properties
        contour1Display = GetDisplayProperties(contour1, view=renderView1)
    
        # change representation type
        contour1Display.SetRepresentationType('Surface')
    
        # change representation type
        contour1Display.SetRepresentationType('Points')
    
        # Properties modified on contour1Display
        contour1Display.PointSize = 3.0
    
        # Properties modified on contour1Display
        contour1Display.PointSize = 2.0
    
        # Properties modified on contour1Display
        contour1Display.RenderPointsAsSpheres = 0
    
        # Properties modified on contour1Display
        contour1Display.RenderPointsAsSpheres = 1
    
        # rescale color and/or opacity maps used to exactly fit the current data range
        transform1Display.RescaleTransferFunctionToDataRange(False, True)
    
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
        if discreteColor:
            # Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
            curvatureLUT.ApplyPreset('KAAMS Step', True)
            # invert the transfer function
            curvatureLUT.InvertTransferFunction()
    
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    
    
    # if case == 3:
    # if gamma != '0' and gamma != 'infinity':
    if smallerRegion:
        paraview.simple._DisableFirstRenderCameraReset()
    
        # get active view
        renderView1 = GetActiveViewOrCreate('RenderView')
        # uncomment following to set a specific view size
        # renderView1.ViewSize = [1184, 905]
    
        #### saving camera placements for all active views
    
        renderView1.AxesGrid.DataScale = [0.0666667, 1.0, 1.0]
    
    
    
        # Properties modified on renderView1.AxesGrid
        renderView1.AxesGrid.ZAxisLabels = [ 0.4, 0.5, 0.6]
    
        # Properties modified on renderView1.AxesGrid
        renderView1.AxesGrid.ShowEdges = 0
    
        # Properties modified on renderView1.AxesGrid
        renderView1.AxesGrid.XAxisPrecision = 1
        renderView1.AxesGrid.XAxisLabels = [0.0]
    
        # Properties modified on renderView1.AxesGrid
        renderView1.AxesGrid.ZAxisPrecision = 1
    
        # Properties modified on renderView1.AxesGrid
        renderView1.AxesGrid.XAxisUseCustomLabels = 1
        renderView1.AxesGrid.XAxisLabels = [-2.0, -1.0, 0.0, 1.0]
        # current camera placement for renderView1
        renderView1.InteractionMode = '2D'
        renderView1.CameraPosition = [0.0, -14.510745305395833, 0.5]
        renderView1.CameraFocalPoint = [0.0, 5.0, 0.5]
        renderView1.CameraViewUp = [0.0, 0.0, 1.0]
        renderView1.CameraParallelScale = 0.7506135276429463
    
    
        if gamma == '0' or gamma == 'infinity':
            # Properties modified on transform1Display
            transform1Display.GaussianRadius = 0.00075
    
        else :
            # transform1Display.GaussianRadius= 0.00001
            transform1Display.GaussianRadius= 0.00075
        # reset view to fit data
        renderView1.ResetCamera()
    
    
        # # current camera placement for renderView1
        # renderView1.InteractionMode = '2D'
        # renderView1.CameraPosition = [-0.03333335, 9.453589701883667, 0.5]
        # renderView1.CameraFocalPoint = [-0.03333335, 10.0, 0.5]
        # renderView1.CameraViewUp = [0.0, 0.0, 1.0]
        # renderView1.CameraParallelScale = 0.14142139159265296
    
    
    
    
    
    
    
    
    
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    #### uncomment the following to render all views
    # RenderAllViews()
    # alternatively, if you want to write images, you can use SaveScreenshot(...).
    # ----------------- EXPORT -----------------
    # save screenshot
    # SaveScreenshot('/home/klaus/Desktop/PhaseDiagramPlot.png', renderView1, ImageResolution=[1257, 934])
    # SaveScreenshot('/home/klaus/Desktop/PhaseDiagramPlot.png', renderView1, ImageResolution=[2514, 1868])
    # SaveScreenshot('/home/klaus/Desktop/PhaseDiagramPlot.png', renderView1, ImageResolution=[1063, 657])
    
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    outputName  = '/home/klaus/Desktop/2DPhaseDiagram_' + str(gamma) + ".png"
    
    
    # SaveScreenshot('/home/klaus/Desktop/2DPhaseDiagram.png', renderView1, ImageResolution=[2126, 1314])
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    SaveScreenshot(outputName , renderView1, ImageResolution=[2126, 1314])
    
    Klaus Böhnlein's avatar
    Klaus Böhnlein committed
    # export view
    # ExportView('/home/klaus/Desktop/PhaseDiagramPlot.pdf', view=renderView1)