pcsbase = '' # Edit this with full path to <pcs> if you see an ImportError. sys.path += ['..', pcsbase, os.getenv('PCSBASE', '')] import shelpers # My module of some helper functions #------------------------------------------------------------------------------- # Construct a minimal spheral simulation structure, consisting of a node list, a # node lists generator, a node list distributer, a physics package, an integrator, # and a controller. #------------------------------------------------------------------------------- # First, create an equation of state. units = sph.PhysicalConstants(1.0, 1.0, 1.0) eos = shelpers.construct_eos_for_material('h2oice', units) # Create an empty node list. nodes = sph.makeFluidNodeList('nodelist', eos) # Create a stock generator. 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)
pcsbase = '' # Edit this with full path to <pcs> if you see an ImportError. sys.path += ['..',pcsbase,os.getenv('PCSBASE','')] import shelpers # My module of some helper functions #------------------------------------------------------------------------------- # Construct a minimal spheral simulation structure, consisting of a node list, a # node lists generator, a node list distributer, a physics package, an integrator, # and a controller. #------------------------------------------------------------------------------- # First, create an equation of state. units = sph.PhysicalConstants(1.0,1.0,1.0) eos = shelpers.construct_eos_for_material('h2oice',units) # Create an empty node list. nodes = sph.makeFluidNodeList('nodelist', eos) # Create a stock generator. 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.