Exemplo n.º 1
0
#
# tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow
# Copyright 2018 You Xie, Erik Franz, Mengyu Chu, Nils Thuerey
#
# Plume data generation, 2D
# 
from manta import *
import os, shutil, math, sys
import numpy as np
sys.path.append("../tools")
import paramhelpers as ph

simId = 2006
simPath = '../2ddata_sim/'
simPath,simId = ph.getNextSimPath(simId, simPath)

# how much to reduce target sim size
targetFac = 0.25
savenpz = 1

# source solver params
dim = 2
#res = 128
res = 512
gs  = vec3(res,int(1.0*res),res)
if (dim==2): gs.z = 1  # 2D

sm = Solver(name='main', gridSize = gs, dim=dim)
sm.timestep = 1.5 
sm.timestep = 0.75 
Exemplo n.º 2
0
showGui = int(ph.getParam("gui", showGui))
res = int(ph.getParam("res", res))
scaleFactor = int(ph.getParam("fac", scaleFactor))
steps = int(ph.getParam("steps", steps))
timeOffset = int(ph.getParam("warmup",
                             20))  # skip certain no of steps at beginning
ph.checkUnusedParams()

doRecenter = False  # re-center densities , disabled for now

setDebugLevel(1)
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)
Exemplo n.º 3
0
# tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow
# Copyright 2018 You Xie, Erik Franz, Mengyu Chu, Nils Thuerey
#
# Plume data generation, 3D
#

from manta import *
import os, shutil, math, sys, time
from datetime import datetime
sys.path.append("../tools")
import paramhelpers as ph
import uniio

outputpath = "../3ddata_sim_test/"  # default target, but actual path set by getNextSimPath below
simNo = 3006
outputpath, simNo = ph.getNextSimPath(simNo, outputpath)
basePath = ph.getParam("basePath", "../data/")
savedata = int(ph.getParam("savedata", 1)) > 0


def cubeSetup(len, setupFactor, dim):
    res = int(setupFactor * len)
    gs = vec3(res, res, res)
    if (dim == 2): gs.z = 1  # 2D test

    mainDt = 0.5
    s = FluidSolver(name='main', gridSize=gs, dim=dim)
    s.timestep = mainDt / int(setupFactor)

    vel = s.create(MACGrid)
    flags = s.create(FlagGrid)