예제 #1
0
파일: testbcs.py 프로젝트: anilkunwar/OOF2
    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)