diff --git a/examples/Basic_Simulation/param.in b/examples/Basic_Simulation/param.in index 47498726c..03fbfc38f 100644 --- a/examples/Basic_Simulation/param.in +++ b/examples/Basic_Simulation/param.in @@ -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 @@ -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 @@ -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 diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index 50c84751f..8c93e2e7d 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -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', @@ -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 diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 52f9321a2..0143c8fb9 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -342,7 +342,7 @@ def run(self,**kwargs): print(f"Running an integration is not yet supported for {self.codename}") return - print(f"Running a simulation from tstart={self.param['TSTART']} {self.TU_name} to tstop={self.param['TSTOP']} {self.TU_name}") + print(f"Running a {self.codename} {self.integrator} run from tstart={self.param['TSTART']} {self.TU_name} to tstop={self.param['TSTOP']} {self.TU_name}") #term_output = subprocess.run([self.driver_executable, self.integrator, self.param_file], capture_output=True) @@ -436,6 +436,9 @@ def set_simulation_time(self, A dictionary containing the requested parameters """ + if t0 is None and tstart is None and dt is None and istep_out is None and \ + tstep_out is None and istep_dump is None: + return {} update_list = [] @@ -2289,6 +2292,7 @@ def write_param(self, param_file = self.param_file if param is None: param = self.param + print(f"Writing parameter inputs to file {param_file}") # Check to see if the parameter type matches the output type. If not, we need to convert if codename == "Swifter" or codename == "Swiftest": @@ -2302,8 +2306,7 @@ def write_param(self, elif codename == "Swift": io.write_swift_param(param, param_file) else: - print( - 'Cannot process unknown code type. Call the read_param method with a valid code name. Valid options are "Swiftest", "Swifter", or "Swift".') + print( 'Cannot process unknown code type. Call the read_param method with a valid code name. Valid options are "Swiftest", "Swifter", or "Swift".') return def convert(self, param_file, newcodename="Swiftest", plname="pl.swiftest.in", tpname="tp.swiftest.in",