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

Commit

Permalink
Merge branch 'Simulation_API_improvements' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 15, 2022
2 parents d820924 + dcc13e0 commit 66addcc
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 61 deletions.
4 changes: 3 additions & 1 deletion examples/Basic_Simulation/initial_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,6 @@
sim.add_body(name_tp, a_tp, e_tp, inc_tp, capom_tp, omega_tp, capm_tp)

# Save everything to a set of initial conditions files
sim.save('param.in')
sim.run()

print("All done!")
20 changes: 10 additions & 10 deletions examples/Basic_Simulation/param.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
! VERSION Swiftest parameter input
T0 0.0
TSTART 0.0
TSTOP 10.0
DT 0.005
ISTEP_OUT 200
ISTEP_DUMP 200
NC_IN init_cond.nc
IN_TYPE NETCDF_DOUBLE
IN_FORM EL
BIN_OUT bin.nc
OUT_FORM XVEL
OUT_TYPE NETCDF_DOUBLE
OUT_STAT REPLACE
IN_TYPE NETCDF_DOUBLE
BIN_OUT bin.nc
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 10000.0
Expand All @@ -18,9 +21,10 @@ CHK_QMIN_RANGE 0.004650467260962157 10000.0
MU2KG 1.988409870698051e+30
TU2S 31557600.0
DU2M 149597870700.0
GMTINY 9.869231602224408e-07
MIN_GMFRAG 9.869231602224408e-10
RESTART NO
INTERACTION_LOOPS TRIANGULAR
ENCOUNTER_CHECK TRIANGULAR
TIDES NO
CHK_CLOSE YES
GR YES
FRAGMENTATION YES
Expand All @@ -29,9 +33,5 @@ ENERGY NO
EXTRA_FORCE NO
BIG_DISCARD NO
RHILL_PRESENT NO
TIDES NO
IN_FORM EL
NC_IN init_cond.nc
TSTART 0.0
GMTINY 1e-06
MIN_GMFRAG 1e-09
INTERACTION_LOOPS TRIANGULAR
ENCOUNTER_CHECK TRIANGULAR
13 changes: 9 additions & 4 deletions python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,21 @@ def write_labeled_param(param, param_file_name):
outfile = open(param_file_name, 'w')
keylist = ['! VERSION',
'T0',
'TSTART',
'TSTOP',
'DT',
'ISTEP_OUT',
'ISTEP_DUMP',
'OUT_FORM',
'OUT_TYPE',
'OUT_STAT',
'IN_TYPE',
'NC_IN',
'PL_IN',
'TP_IN',
'CB_IN',
'IN_TYPE',
'IN_FORM',
'BIN_OUT',
'OUT_FORM',
'OUT_TYPE',
'OUT_STAT',
'CHK_QMIN',
'CHK_RMIN',
'CHK_RMAX',
Expand All @@ -425,6 +428,8 @@ def write_labeled_param(param, param_file_name):
'MU2KG',
'TU2S',
'DU2M',
'GMTINY',
'MIN_GMFRAG',
'RESTART']
ptmp = param.copy()
# Print the list of key/value pairs in the preferred order
Expand Down
Loading

0 comments on commit 66addcc

Please sign in to comment.