예제 #1
0
def RequestDataDescription(datadescription):
    phactori.myDebugPrint3("PhactoriDriver.RequestDataDescription entered: " +
                           str(gDoCoProcessingCount) + "\n")

    phactori.TestUserDataForBypassScript(datadescription)

    if phactori.GetBypassUserDataFlag() == False:
        fd = datadescription.GetUserData()

        if fd == None:
            phactori.myDebugPrint2("no user data, returning {}\n")
            returnViewMapC = {}
            return returnViewMapC

    global gCatchAllExceptionsAndPassUpFlag
    if gCatchAllExceptionsAndPassUpFlag:
        try:
            return RequestDataDescriptionSub(datadescription)
        except:
            import traceback
            tb = traceback.format_exc()
            phactori.IssueErrorOrWarningThroughSierraIO(
                datadescription, tb, True)
    else:
        return RequestDataDescriptionSub(datadescription)
예제 #2
0
def RequestDataDescriptionSub(datadescription):
    phactori.myDebugPrint("PhactoriDriver.RequestDataDescriptionSub entered\n")
    "Callback to populate the request for current timestep"

    phactori.TestUserDataForBypassScript(datadescription)

    if phactori.GetBypassUserDataFlag() == False:
        fd = datadescription.GetUserData()

        if fd == None:
            phactori.myDebugPrint2("no user data, returning {}\n")
            returnViewMapC = {}
            return returnViewMapC

    global coprocessor

    global gFirstTimeInDoCoProcessing
    global gSkipCountdown

    if gFirstTimeInDoCoProcessing == True:
        phactori.myDebugPrint2(
            "RequestDataDescription doing gFirstTimeInDoCoProcessing\n")
        phactori.myDebugPrint2(" skip countdown is " + str(gSkipCountdown) +
                               "\n")
        if gSkipCountdown > 0:
            gSkipCountdown = gSkipCountdown - 1
            return 0
        coprocessor = CreateCoProcessor()
        coprocessor.EnableLiveVisualization(False)
        gFirstTimeInDoCoProcessing = False

    #import pdb
    #pdb.set_trace()

    phactori.InitializePerPipeRoot(datadescription, coprocessor)

    if datadescription.GetForceOutput() == True:
        # We are just going to request all fields and meshes from the simulation
        # code/adaptor.
        for i in range(datadescription.GetNumberOfInputDescriptions()):
            datadescription.GetInputDescription(i).AllFieldsOn()
            datadescription.GetInputDescription(i).GenerateMeshOn()
        return 1

    # setup requests for all inputs based on the requirements of the
    # pipeline.
    coprocessor.LoadRequestedData(datadescription)
    return 1