Пример #1
0
    top.addCondition(flux, fluxprof)

    print "BC's defined."
    # trace_enable()


    mesh.equilibrate(maxiters, tolerance, krylov_dim)

    if outfile:
        import display
        display = display.Display()

        import color
        import displaymethods

        edgedisp = display.add_method(
            displaymethods.EdgeDisplay(outputClones.posOutput))
        edgedisp.set_param('width',0.001)
        edgedisp.set_param('color',color.Gray(0.5))

        import psoutput
        device = psoutput.PSoutput(outfile)

        display.draw(mesh,device)
        
##        import psgfx
##        deformOutput = outputClones.VectorFieldOutput.clone()
##        deformOutput.plugParameter(displacement,"field")
##        positionSum = outputClones.VFieldSumOutput.clone()
##        positionSum.plugInput(deformOutput)
##        positionSum.plugInput(meshGUI.posOutput)
Пример #2
0
    # trace_enable()

    mesh.activate_field(temperature)
    mesh.activate_equation(heat_eqn)

    mesh.equilibrate(maxiters, tolerance, krylov_dim)

    if psfilename:
        thermalOutput = output.outputTypes['scalar field'].clone()
        thermalOutput.plugParameter(temperature, "field")
        rscl = outputClones.RescaleOutput.clone()
        rscl.plugInput(thermalOutput)
        rscl.plugParameter(0.0, "minimum")
        rscl.plugParameter(1.0, "maximum")

        import psoutput
        import display
        import displaymethods
        import color
        psdriver = psoutput.PSoutput(psfilename)

        display = display.Display()
        fill = display.add_method(
            displaymethods.CenterFillDisplay(outputClones.posOutput, rscl))
        fill.set_param('colormap', color.SpectralMap(saturation=0.9))
        display.draw(mesh, psdriver)

except ErrSetupError, s:
    print "Caught ErrSetupError."
    print "Message string: " + s.message()
Пример #3
0
    thermalOutput = outputClones.ScalarFieldOutput.clone()
    thermalOutput.plugParameter(temperature, "field")

    # create a display object
    import display
    display = display.Display()

    import contourdisplay
    import displaymethods
    import color

    funcOutput = outputClones.FunctionOutput.clone()
    funcOutput.plugParameter(function, 'f')

    contourdisp = display.add_method(
        contourdisplay.FilledContourDisplay(outputClones.posOutput,
                                            funcOutput))
    contourdisp.set_param('levels', nlevels)
    contourdisp.set_param('nbins', contourbins)
    #    contourdisp.set_param('colormap', color.SpectralMap(saturation=0.9))

    if do_colors:
        colordisp = display.add_method(
            displaymethods.CenterFillDisplay(outputClones.posOutput,
                                             outputClones.MaterialColorOutput))
        colordisp.set_param('colormap', color.graymap)

    if do_edges:
        edgedisp = display.add_method(
            displaymethods.EdgeDisplay(outputClones.posOutput))
        edgedisp.set_param('width', 0.001)
Пример #4
0
    mesh.equilibrate(maxiters, tolerance, krylov_dim)

    if psfilename:
        # Get the temperature Field
        thermalOutput = outputClones.ScalarFieldOutput.clone()
        thermalOutput.plugParameter(temperature, "field")

        # create a display object
        import display
        display = display.Display()

        import contourdisplay
        import displaymethods
        import color

        edisp = display.add_method(
            displaymethods.EdgeDisplay(outputClones.posOutput))
        edisp.set_param('width', 0.0)
        edisp.set_param('color', color.black)

        perimdisp = display.add_method(
            displaymethods.PerimeterDisplay(outputClones.posOutput))
        perimdisp.set_param('width', 0.01)
        perimdisp.set_param('color', color.red)

        funcOutput = outputClones.FunctionOutput.clone()
        funcOutput.plugParameter(function, 'f')

        contourdisp = display.add_method(
            contourdisplay.PlainContourDisplay(outputClones.posOutput,
                                                funcOutput))
        contourdisp.set_param('levels', nlevels)
Пример #5
0
    top.addCondition(floatdispy, fixedprof)
    top.addCondition(flux, fluxprof)

    print "BC's defined."
    # trace_enable()

    mesh.equilibrate(maxiters, tolerance, krylov_dim)

    if outfile:
        import display
        display = display.Display()

        import color
        import displaymethods

        edgedisp = display.add_method(
            displaymethods.EdgeDisplay(outputClones.posOutput))
        edgedisp.set_param('width', 0.001)
        edgedisp.set_param('color', color.Gray(0.5))

        import psoutput
        device = psoutput.PSoutput(outfile)

        display.draw(mesh, device)

##        import psgfx
##        deformOutput = outputClones.VectorFieldOutput.clone()
##        deformOutput.plugParameter(displacement,"field")
##        positionSum = outputClones.VFieldSumOutput.clone()
##        positionSum.plugInput(deformOutput)
##        positionSum.plugInput(meshGUI.posOutput)
Пример #6
0
        thermalOutput = outputClones.ScalarFieldOutput.clone()
        thermalOutput.plugParameter(temperature, "field")

        # create a display object
        import display
        display = display.Display()

        import contourdisplay
        import displaymethods
        import color

        funcOutput = outputClones.FunctionOutput.clone()
        funcOutput.plugParameter(function, 'f')

        contourdisp = display.add_method(
            contourdisplay.FilledContourDisplay(outputClones.posOutput,
                                                funcOutput))
        contourdisp.set_param('levels', nlevels)
        contourdisp.set_param('nbins', contourbins)
        #    contourdisp.set_param('colormap', color.SpectralMap(saturation=0.9))

        if do_edges:
            edgedisp = display.add_method(
                displaymethods.EdgeDisplay(outputClones.posOutput))
            edgedisp.set_param('width', 0.001)
            edgedisp.set_param('color', color.Gray(0.5))

        if do_contours:
            cdisp = display.add_method(
                contourdisplay.PlainContourDisplay(outputClones.posOutput,
                                                   funcOutput))
Пример #7
0
    mesh.activate_field(temperature)
    mesh.activate_equation(heat_eqn)

    mesh.equilibrate(maxiters, tolerance, krylov_dim)

    if psfilename:
        thermalOutput = output.outputTypes['scalar field'].clone()
        thermalOutput.plugParameter(temperature, "field")
        rscl = outputClones.RescaleOutput.clone()
        rscl.plugInput(thermalOutput)
        rscl.plugParameter(0.0, "minimum")
        rscl.plugParameter(1.0, "maximum")

        import psoutput
        import display
        import displaymethods
        import color
        psdriver = psoutput.PSoutput(psfilename)

        display = display.Display()
        fill = display.add_method(
            displaymethods.CenterFillDisplay(outputClones.posOutput, rscl))
        fill.set_param('colormap', color.SpectralMap(saturation=0.9))
        display.draw(mesh, psdriver)

    
except ErrSetupError, s:
    print "Caught ErrSetupError."
    print "Message string: " + s.message()
    
Пример #8
0
        thermalOutput = outputClones.ScalarFieldOutput.clone()
        thermalOutput.plugParameter(temperature, "field")

        # create a display object
        import display
        display = display.Display()

        import contourdisplay
        import displaymethods
        import color

        funcOutput = outputClones.FunctionOutput.clone()
        funcOutput.plugParameter(function, 'f')

        contourdisp = display.add_method(
            contourdisplay.FilledContourDisplay(outputClones.posOutput,
                                                funcOutput))
        contourdisp.set_param('levels', nlevels)
        contourdisp.set_param('nbins', contourbins)
        #    contourdisp.set_param('colormap', color.SpectralMap(saturation=0.9))

        if do_edges:
            edgedisp = display.add_method(
                displaymethods.EdgeDisplay(outputClones.posOutput))
            edgedisp.set_param('width', 0.001)
            edgedisp.set_param('color', color.Gray(0.5))

        if do_contours:
            cdisp = display.add_method(
                contourdisplay.PlainContourDisplay(outputClones.posOutput,
                                                   funcOutput))
Пример #9
0
        positionSum.plugInput(outputClones.posOutput)

        thermalOutput = output.outputTypes['scalar field'].clone()
        thermalOutput.plugParameter(temperature, "field")
        rscl = outputClones.RescaleOutput.clone()
        rscl.plugInput(thermalOutput)
        rscl.plugParameter(0.0, "minimum")
        rscl.plugParameter(0.95, "maximum")

        # create a display object
        import display
        display = display.Display()

        import displaymethods
        import color
        fill = display.add_method(
            displaymethods.CenterFillDisplay(positionSum, rscl))
        fill.set_param('colormap', color.HSVMap(saturation=0.9))
        display.add_method(displaymethods.EdgeDisplay(positionSum))
        display.add_method(displaymethods.EdgeDisplay(outputClones.posOutput))
        
        # get an output device
        import psoutput
        device = psoutput.PSoutput(psfilename)

        display.draw(mesh, device)

    else:
        for node in mesh.funcnode_iterator():
            pos = node.position()
            print displacement.value(mesh, node, 0), \
                  displacement.value(mesh, node, 1)
Пример #10
0
    thermalOutput = outputClones.ScalarFieldOutput.clone()
    thermalOutput.plugParameter(temperature, "field")

    # create a display object
    import display
    display = display.Display()

    import contourdisplay
    import displaymethods
    import color

    funcOutput = outputClones.FunctionOutput.clone()
    funcOutput.plugParameter(function, 'f')

    contourdisp = display.add_method(
        contourdisplay.FilledContourDisplay(outputClones.posOutput,
                                            funcOutput))
    contourdisp.set_param('levels', nlevels)
    contourdisp.set_param('nbins', contourbins)
    #    contourdisp.set_param('colormap', color.SpectralMap(saturation=0.9))

    if do_colors:
        colordisp = display.add_method(
            displaymethods.CenterFillDisplay(outputClones.posOutput,
                                             outputClones.MaterialColorOutput))
        colordisp.set_param('colormap', color.graymap)

    if do_edges:
        edgedisp = display.add_method(
            displaymethods.EdgeDisplay(outputClones.posOutput))
        edgedisp.set_param('width', 0.001)