#-------------------------------------------------------------------------------
# NAV Equation of state
# Here we construct equation-of-state objects, one per node list. In this case,
# one each for the target and impactor. The choice of eos is determined by the 
# material string (see <pcs>MATERIALS.md for available options).
#-------------------------------------------------------------------------------
eosTarget, eosImpactor = None, None

# Most eos constructors need to know about units. We usually use MKS.
units = PhysicalConstants(1.0, # unit length in meters
                          1.0, # unit mass in kilograms
                          1.0) # unit time in seconds

# Construct and verify target eos
eosTarget = shelpers.construct_eos_for_material(matTarget,units)
assert eosTarget is not None
assert eosTarget.valid()

# Construct and verify impactor eos
eosImpactor = shelpers.construct_eos_for_material(matImpactor,units)
assert eosImpactor is not None
assert eosImpactor.valid()

# Optionally, provide non-default values to the following
eosTarget.etamin_solid = 0.94 # default is 0.94
eosTarget.minimumPressure = 0.0 # default is P(etamin_solid*rho0, 0)
eosImpactor.etamin_solid = 0.94 # default is 0.94
eosImpactor.minimumPressure = 0.0 # default is P(etamin_solid*rho0, 0)

#-------------------------------------------------------------------------------
Example #2
0
#-------------------------------------------------------------------------------
# NAV Equation of state
# Here we construct equation-of-state objects, one per node list. In this case,
# one each for the target and impactor. The choice of eos is determined by the
# material string (see <pcs>MATERIALS.md for available options).
#-------------------------------------------------------------------------------
eosTarget, eosImpactor = None, None

# Most eos constructors need to know about units. We usually use MKS.
units = PhysicalConstants(
    1.0,  # unit length in meters
    1.0,  # unit mass in kilograms
    1.0)  # unit time in seconds

# Construct and verify target eos
eosTarget = shelpers.construct_eos_for_material(matTarget, units)
assert eosTarget is not None
assert eosTarget.valid()

# Construct and verify impactor eos
eosImpactor = shelpers.construct_eos_for_material(matImpactor, units)
assert eosImpactor is not None
assert eosImpactor.valid()

#-------------------------------------------------------------------------------
# NAV Prepare strength and damage models for target and impactor
#-------------------------------------------------------------------------------
strengthTarget = ConstantStrength(muTarget, Y0Target)
strengthImpactor = ConstantStrength(muImpactor, Y0Impactor)

# Optionally, provide non-default values to the following
Example #3
0
fKern = 1.0/3.0

#-------------------------------------------------------------------------------
# NAV Equation of state
# Here we construct equation-of-state objects, one per node list. The choice of 
# eos is determined by the  material string (see <pcs>MATERIALS.md for options).
#-------------------------------------------------------------------------------
eosPlanet = None

# Most eos constructors need to know about units. We usually use MKS.
units = PhysicalConstants(1.0, # unit length in meters
                          1.0, # unit mass in kilograms
                          1.0) # unit time in seconds

# Construct and verify planet eos
eosPlanet = shelpers.construct_eos_for_material(matPlanet,units)
assert eosPlanet is not None
assert eosPlanet.valid()

# Optionally, provide non-default values to the following
#eosPlanet.etamin_solid = 0.94 # default is 0.94
#eosPlanet.minimumPressure = 0.0 # default is P(etamin_solid*rho0, 0)

#-------------------------------------------------------------------------------
# NAV Restarts and output directories
# Here we create the output directories, and deal with restarted runs if any.
#-------------------------------------------------------------------------------
# Name directories and files.
jobDir = os.path.join(baseDir, 
                       'mPlanet=%0.2g' % mPlanet,
                       'eosPlanet=%d' % eosPlanet.uid,
rigorousBoundaries = False

#-------------------------------------------------------------------------------
# NAV Equation of state
# Here we construct equation-of-state objects, one per node list. The choice of 
# eos is determined by the  material string (see <pcs>MATERIALS.md for options).
#-------------------------------------------------------------------------------
eosCore, eosMantle = None, None

# Most eos constructors need to know about units. We usually use MKS.
units = PhysicalConstants(1.0, # unit length in meters
                          1.0, # unit mass in kilograms
                          1.0) # unit time in seconds

# Construct and verify core eos
eosCore = shelpers.construct_eos_for_material(matCore,units)
assert eosCore is not None
assert eosCore.valid()

# Construct and verify mantle eos
eosMantle = shelpers.construct_eos_for_material(matMantle,units)
assert eosMantle is not None
assert eosMantle.valid()

# Optionally, provide non-default values to the following
eosCore.etamin_solid = 0.94 # default is 0.94
eosCore.minimumPressure = 0.0 # default is 1e-200
eosMantle.etamin_solid = 0.94 # default is 0.94
eosMantle.minimumPressure = 0.0 # default is 1e-200

#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# NAV Equation of state
# Here we construct equation-of-state objects, one per node list. The choice of
# eos is determined by the  material string (see <pcs>MATERIALS.md for options).
#-------------------------------------------------------------------------------
eosCore, eosMantle = None, None

# Most eos constructors need to know about units. We usually use MKS.
units = PhysicalConstants(
    1.0,  # unit length in meters
    1.0,  # unit mass in kilograms
    1.0)  # unit time in seconds

# Construct and verify core eos
eosCore = shelpers.construct_eos_for_material(matCore, units)
assert eosCore is not None
assert eosCore.valid()

# Construct and verify mantle eos
eosMantle = shelpers.construct_eos_for_material(matMantle, units)
assert eosMantle is not None
assert eosMantle.valid()

# Optionally, provide non-default values to the following
eosCore.etamin_solid = 0.94  # default is 0.94
eosCore.minimumPressure = 0.0  # default is 1e-200
eosMantle.etamin_solid = 0.94  # default is 0.94
eosMantle.minimumPressure = 0.0  # default is 1e-200

#-------------------------------------------------------------------------------
import SolidSpheral3d as sph  # The top-level spheral module importer
from GenerateNodeDistribution3d import GenerateNodeDistribution3d  # basic nl-gens
from VoronoiDistributeNodes import distributeNodes3d  # the load distributer

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))
import SolidSpheral3d as sph # The top-level spheral module importer
from GenerateNodeDistribution3d import GenerateNodeDistribution3d # basic nl-gens
from VoronoiDistributeNodes import distributeNodes3d # the load distributer

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()