Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Updated Chambers example with new style
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 28, 2021
1 parent 9292e37 commit 4275b82
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 1,337 deletions.
19 changes: 14 additions & 5 deletions examples/symba_chambers_2013/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
sim.param['CHK_RMAX'] = 1000.0
sim.param['CHK_EJECT'] = 1000.0
sim.param['IN_FORM'] = 'EL'
sim.param['OUT_FORM'] = 'EL'
sim.param['OUT_FORM'] = 'XVEL'
sim.param['OUT_TYPE'] = 'NETCDF_DOUBLE'

# Add central body
sim.add("Sun")
Expand Down Expand Up @@ -78,12 +79,20 @@
Rhs = avals * (GMvals / (3 * GMcb))**(1.0/3.0)

# Give the bodies unique ids
idb = np.arange(100, 100 + Nb)
ids = np.arange(100 + Nb, 100 + Nb + Ns)
idb = np.arange(10, 10 + Nb)
ids = np.arange(11 + Nb, 11 + Nb + Ns)

nameb = []
for i in idb:
nameb.append(f"BigBody{i-10:0.4g}")
names = []
for i in ids:
names.append(f"SmallBody{i-10:0.4g}")


# Populate the simulation object with the two types of bodies
sim.addp(idb, avalb, evalb, incvalb, capomvalb, omegavalb, capmvalb, GMpl=GMvalb, Rpl=Rvalb, rhill=Rhb)
sim.addp(ids, avals, evals, incvals, capomvals, omegavals, capmvals, GMpl=GMvals, Rpl=Rvals, rhill=Rhs)
sim.addp(idb, nameb, avalb, evalb, incvalb, capomvalb, omegavalb, capmvalb, GMpl=GMvalb, Rpl=Rvalb, rhill=Rhb)
sim.addp(ids, names, avals, evals, incvals, capomvals, omegavals, capmvals, GMpl=GMvals, Rpl=Rvals, rhill=Rhs)

# Save everything to a set of initial conditions files
sim.save("param.in")
Expand Down
4 changes: 2 additions & 2 deletions examples/symba_chambers_2013/param.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ TSTOP 300000000.0
DT 0.01642710472279261
ISTEP_OUT 60876
ISTEP_DUMP 60876
OUT_FORM EL
OUT_TYPE REAL8
OUT_FORM XVEL
OUT_TYPE NETCDF_DOUBLE
OUT_STAT REPLACE
IN_TYPE ASCII
PL_IN pl_chambers_2013.in
Expand Down
Loading

0 comments on commit 4275b82

Please sign in to comment.