Пример #1
0
                              (loadModelTest, currModel)):
                loadModelNo = currModel
        if loadModelNo == -1:
            print(
                'ERROR: Model with id below 200 does not exist. Please specify model id as "loadModelNo".'
            )
            exit()
        # print('Latest model: %d.' % loadModelNo)

    load_path = basePath + 'test_%04d/model_%04d.ckpt' % (loadModelTest,
                                                          loadModelNo)

(test_path, test_folder_no) = ph.getNextTestPath(testPathStartNo, basePath)
if not outputOnly: uniio.backupFile(__file__, test_path)

sys.stdout = ph.Logger(test_path)


# print Variables to log
def print_variables():
    print('\nUsing variables:')
    print('fromSim: {}'.format(fromSim))
    print('toSim: {}'.format(toSim))
    print('simSizeLow: {}'.format(simSizeLow))
    print('tileSizeLow: {}'.format(tileSizeLow))
    print('cropOverlap: {}'.format(cropOverlap))
    print('cropTileSizeLow: {}'.format(cropTileSizeLow))
    print('upRes: {}'.format(upRes))
    print('emptyTileValue: {}'.format(emptyTileValue))
    print('learningRate: {}'.format(learningRate))
    print('trainingEpochs: {}'.format(trainingEpochs))
Пример #2
0
if not basePath.endswith("/"): basePath = basePath + "/"

if savenpz or saveuni or saveppm:
    folderNo = simNo
    simPath, simNo = ph.getNextSimPath(simNo, basePath)

    # add some more info for json file
    ph.paramDict["simNo"] = simNo
    ph.paramDict["type"] = "smoke"
    ph.paramDict["name"] = "gen6combined"
    ph.paramDict["version"] = printBuildInfo()
    ph.paramDict["creation_date"] = datetime.now().strftime(
        "%Y-%m-%d %H:%M:%S")
    ph.writeParams(simPath + "description.json")  # export sim parameters

    sys.stdout = ph.Logger(simPath)
    print("Called on machine '" + os.uname()[1] + "' with: " +
          str(" ".join(sys.argv)))
    print("Saving to " + simPath + ", " + str(simNo))
    # optional , backupFile(__file__, simPath)

if (npSeed < 0):
    npSeed = np.random.randint(0, 2**32 - 1)
print("Random seed %d" % npSeed)
np.random.seed(npSeed)

# Init solvers -------------------------------------------------------------------#
sm_gs = vec3(res, res, res)
xl_gs = sm_gs * float(scaleFactor)
if (dim == 2): xl_gs.z = sm_gs.z = 1  # 2D
Пример #3
0
    folderNo = simNo
    outputpath, simNo = ph.getNextSimPath(simNo, basePath)

    # add some more info for json file
    ph.paramDict["res"] = baseRes
    ph.paramDict["fac"] = setupFactor
    ph.paramDict["simNo"] = simNo
    ph.paramDict["dim"] = dim
    ph.paramDict["type"] = "smoke"
    ph.paramDict["name"] = "plume3006"
    ph.paramDict["version"] = printBuildInfo()
    ph.paramDict["creation_date"] = datetime.now().strftime(
        "%Y-%m-%d %H:%M:%S")
    ph.writeParams(outputpath + "description.json")  # export sim parameters

    sys.stdout = ph.Logger(outputpath)
    print("Called on machine '" + os.uname()[1] + "' with: " +
          str(" ".join(sys.argv)))
    print("Saving to " + outputpath + ", " + str(simNo))
    uniio.backupFile(__file__, outputpath)

#if(not os.path.exists(outputpath)):
#	os.mkdir( outputpath )
#nowtstr = time.strftime('%Y%m%d_%H%M%S')
#logfilepath = '%sscene_%s.py' % (outputpath, nowtstr)
#shutil.copyfile( sys.argv[0], logfilepath )

for t in range(400):

    mantaMsg('\nFrame %i, simulation time %f' % (targs.frame, targs.timeTotal))