vice.multizone.migration¶
Type : migration.specs
Default : No migration of either gas or stars.
An object which stores the migration specifications of the multizone model.
Attributes¶
- gas
mig_matrix
A matrix describing how gas moves between zones.
- stars<function>
The migration settings for star particles.
See also
vice.multizone.migration.gas
vice.multizone.migration.stars
Example Code¶
>>> import vice
>>> mz = vice.multizone(name = "example")
>>> mz.migration.gas[1][0] = 0.05
>>> mz.migration.gas[0][1] = 0.05
>>> def f(zone, tform, time):
'''
stars born in zone 0 and 1 swap positions when they're more
than 1 Gyr old.
'''
if zone == 0:
if time - tform > 1:
return 1
else:
return 0
elif zone == 1:
if time - tform > 1:
return 0
else:
return 1
else:
return zone
>>> mz.migration.stars = f