generator = GenerateNodeDistribution3d(2,
                                       2,
                                       2,
                                       eos.referenceDensity,
                                       distributionType='lattice')

# Distribute nodes to ranks (suppress with any cl arg to speed things up).
if len(sys.argv) == 1:
    distributeNodes3d((nodes, generator))

# Create a DataBase object to hold the node lists.
db = sph.DataBase()
db.appendNodeList(nodes)

# Create the kernel function for SPH.
WT = sph.TableKernel(sph.BSplineKernel(), 1000)

# Create the artificial viscosity object.
q = sph.MonaghanGingoldViscosity(1.0, 1.0)

# Create the hydro package.
hydro = sph.ASPHHydro(W=WT, Q=q)

# Create the time integrator and attach the physics package to it.
integrator = sph.CheapSynchronousRK2Integrator(db)
integrator.appendPhysicsPackage(hydro)

# Create the controller.
control = sph.SpheralController(integrator, WT)
control.vizBaseName = 'test'
control.vizDir = '.'