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

Commit

Permalink
Merge branch 'debug'
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 4, 2023
2 parents 4dbe12a + 824813b commit 01af903
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 61 deletions.
88 changes: 36 additions & 52 deletions README.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion README_tables/param_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
| ```GR``` | General relativity. | ```YES```, ```NO``` | all
| ```RHILL_PRESENT``` | Hill Radius present in massive body input file. | ```YES```, ```NO``` | SyMBA
| ```ENERGY``` | Track and report the total energy, angular momentum, and mass of the system. | ```YES```, ```NO``` | SyMBA
| ```FRAGMENTATION``` | Resolve collisions with fragmentation. | ```YES```, ```NO``` | SyMBA
| ```COLLISION_MODEL``` | Resolve collisions. | ```MERGE```, ```BOUNCE```, ```FRAGGLE``` | SyMBA
| ```ROTATION``` | Rotation of massive bodies. Requires rotation vectors, radii, and moments of inertia to be provided in initial conditions. | ```YES```, ```NO``` | SyMBA
| ```GMTINY``` | Mass cutoff between fully and semi-interacting massive bodies in gravitational mass units. | floating point (ex. ```4e-06```) | SyMBA
| ```MIN_GMFRAG``` | Minimum fragment mass in gravitational mass units. | floating point (ex. ```1e-09```) | SyMBA
Expand All @@ -50,5 +50,8 @@ In the above list, the following are defined as:
- ```XVEL``` - Heliocentric position and velocity components and osculating orbital elements for ```OUT_FORM```
- ```NETCDF_FLOAT``` - Single precision NetCDF format for ```OUT_TYPE```
- ```NETCDF_DOUBLE``` - Double precision NetCDF format for ```OUT_TYPE```
- ```MERGE``` - Perfectly conserve the mass of all colliding bodies into a single resultant body
- ```BOUNCE``` - Perfectly-elastic collision in which all bodies reverse trajectory after the collision
- ```FRAGGLE``` - Collisional fragments are generated as a result of a collision

For more details on the ```INTERACTION_LOOPS``` and ```ENCOUNTER_CHECK``` options, see the **Updates to Swifter SyMBA** section below.
7 changes: 7 additions & 0 deletions README_tables/save_kwargs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# swiftest.save(**kwargs)
| Key Word Name | Key Word Description | Options |
|-----------------|-------------------------------------------------------------------------------------------------------|--------------------------------------------|
|```codename``` | Name of the N-body code to use. Default is ```Swiftest```. | ```Swiftest```, ```Swifter```, ```Swift```
|```param_file``` | Alternative name of the parameter input file. | string (ex. ```myparam.in```)
|```param``` | Alternative parameter dictionary. | dictionary
|```framenum``` | Time frame from which to generate initial conditions. Default is -1 or the last frame in the dataset. | integer (ex. ```10```)
15 changes: 12 additions & 3 deletions README_tables/simulation_kwargs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
|```simdir``` | Path to subdirectory in which to store data. Default is ```/simdir```. | pathlike string (ex. ```path/to/directory```) | all
|```read_param``` | Read in a pre-existing parameter input file. Default is ```False```. | ```True```, ```False``` | all
|```param_file``` | Name of the pre-existing parameter input file. Only used if ```read_param``` is set to ```True```. | string (ex. ```param.in```) | all
|```read_old_output``` | Read in a pre-existing simulation output file. Default is ```False```. | ```True```, ```False``` | all
|```read_data``` | Read in a pre-existing simulation output file. Default is ```False```. | ```True```, ```False``` | all
|```codename``` | Name of the N-body code to use. Default is ```Swiftest```. | ```Swiftest```, ```Swifter```, ```Swift``` | all
|```integrator``` | Name of the N-body integrator to use. Default is ```symba```. | ```symba```, ```helio```, ```rmvs```, ```whm``` | all
|```t0``` | The reference time for the start of the simulation in time units. Default is ```0.0```. | floating point (ex. ```0.0```) | all
Expand All @@ -23,6 +23,9 @@
|```MU``` | Mass unit system to use in the simulation. Default is ```Msun```. | ```Msun```, ```Mearth```, ```kg```, ```g``` (case-insensitive) | all
|```DU``` | Distance unit system to use in the simulation. Default is ```AU```. | ```AU```, ```Rearth```, ```m```, ```cm``` (case-insensitive) | all
|```TU``` | Time unit system to use in the simulation. Default is ```Y```. | ```Y```, ```YR```, ```DAY``` (Julian day), ```d``` (Julian day), ```JD``` (Julian day), ```s``` (case-insensitive) | all
|```MU_name``` | The name of the mass unit. Overrides ```MU```. | string (ex. ```kilograms```) | all
|```DU_name``` | The name of the distance unit. Overrides ```DU```. | string (ex. ```meters```) | all
|```TU_name``` | The name of the time unit. Overrides ```TU```. | string (ex. ```seconds```) | all
|```MU2KG``` | Mass units to kilogram conversion factor. Overrides ```MU```. | floating point (ex. ```1.988409870698051e+30```) | all
|```DU2M``` | Distance units to meters conversion factor. Overrides ```DU```. | floating point (ex. ```31557600.0```) | all
|```TU2S``` | Time units to seconds conversion factor. Overrides ```TU```. | floating point (ex. ```149597870700.0```) | all
Expand All @@ -32,8 +35,9 @@
|```mtiny``` | Mass cutoff between fully and semi-interacting massive bodies in mass units. Either ```mtiny``` **OR** ```gmtiny``` may be set. | floating point (ex. ```1e23```) | all
|```gmtiny``` | Mass cutoff between fully and semi-interacting massive bodies in gravitational mass units. Default is ```0.0```. Either ```mtiny``` **OR** ```gmtiny``` may be set. | floating point (ex. ```4e-6```) | all
|```close_encounter_check``` | Check for close encounters. Default is ```True```. Requires radius of massive bodies to be provided in initial conditions. | ```True```, ```False``` | all
|```encounter_save``` | Save data for each close encounter to a file. Warning! This can generate very large files! | ```TRAJECTORY```, ```CLOSEST```, ```BOTH``` | SyMBA
|```general_relativity``` | General relativity. Default is ```True```. | ```True```, ```False``` | all
|```fragmentation``` | Resolve collisions with fragmentation. Default is ```False```. | ```True```, ```False``` | SyMBA
|```collision_model``` | Resolve collisions. Default is ```MERGE```. | ```MERGE```, ```BOUNCE```, ```FRAGGLE``` | SyMBA
|```minimum_fragment_gmass``` | Minimum fragment mass in gravitational mass units. Default is ```0.0```. Either ```minimum_fragment_gmass``` **OR** ```minimum_fragment_mass``` may be set. | floating point (ex. ```1e-9```) | SyMBA
|```minimum_fragment_mass``` | Minimum fragment mass in mass units. Either ```minimum_fragment_gmass``` **OR** ```minimum_fragment_mass``` may be set. | floating point (ex. ```1e20```) | SyMBA
|```rotation``` | Rotation of massive bodies. Requires rotation vectors, radii, and moments of inertia to be provided in initial conditions. Default is ```False```. | ```True```, ```False``` | SyMBA
Expand All @@ -56,4 +60,9 @@ In the above list, the following are defined as:
- ```REAL4``` - Single precision 4-byte native Fortran binary format (Swifter/Swift only)
- ```REAL8``` - Double precision 8-byte native Fortran binary format (Swifter/Swift only)
- ```XDR4``` - Single precision 4-byte XDR format (Swifter/Swift only)
- ```XDR8``` - Double precision 8-byte XDR format (Swifter/Swift only)
- ```XDR8``` - Double precision 8-byte XDR format (Swifter/Swift only)
- ```TRAJECTORY``` - Save the position and velocity vectors of all bodies involved in the close encounter at each intermediary step of the encounter
- ```CLOSEST``` - Save the position and velocity vectors of all bodies involved in the close encounter at the point of closest approach
- ```MERGE``` - Perfectly conserve the mass of all colliding bodies into a single resultant body
- ```BOUNCE``` - Perfectly-elastic collision in which all bodies reverse trajectory after the collision
- ```FRAGGLE``` - Collisional fragments are generated as a result of a collision
6 changes: 6 additions & 0 deletions README_tables/write_param_kwargs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# swiftest.write_param(**kwargs)
| Key Word Name | Key Word Description | Options |
|-----------------|----------------------------------------------------------------------------------------------------|--------------------------------------------|
|```codename``` | Name of the N-body code to use. Default is ```Swiftest```. | ```Swiftest```, ```Swifter```, ```Swift```
|```param_file``` | Alternative name of the parameter input file. | string (ex. ```myparam.in```)
|```param``` | Alternative parameter dictionary. | dictionary
2 changes: 1 addition & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ affiliations:
index: 1
- name: Independent Researcher, USA
index: 2
date: 31 October 2022
date: 03 February 2023
bibliography: paper.bib
---

Expand Down
2 changes: 1 addition & 1 deletion src/fraggle/fraggle_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end subroutine fraggle_generate_disrupt

module subroutine fraggle_generate_hitandrun(self, nbody_system, param, t)
implicit none
class(collision_fraggle), intent(inout) :: self !! Collision system object
class(collision_fraggle), intent(inout) :: self !! Collision system object
class(base_nbody_system), intent(inout) :: nbody_system !! Swiftest nbody system object
class(base_parameters), intent(inout) :: param !! Current run configuration parameters with SyMBA additions
real(DP), intent(in) :: t !! Time of collision
Expand Down
8 changes: 5 additions & 3 deletions src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ module subroutine swiftest_io_netcdf_get_t0_values_system(self, param)
integer(I4B) :: itmax, idmax, tslot
real(DP), dimension(:), allocatable :: vals
real(DP), dimension(1) :: rtemp
real(DP), dimension(NDIM) :: rot0, Ip0
real(DP), dimension(NDIM) :: rot0, Ip0, L
real(DP) :: mass0

associate (nc => self%system_history%nc, cb => self%cb)
Expand Down Expand Up @@ -628,6 +628,8 @@ module subroutine swiftest_io_netcdf_get_t0_values_system(self, param)
rot0(:) = rot0(:) * DEG2RAD
call netcdf_io_check( nf90_get_var(nc%id, nc%Ip_varid, Ip0, start=[1,1,tslot], count=[NDIM,1,1]), "netcdf_io_get_t0_values_system Ip_varid" )
cb%L0(:) = Ip0(3) * mass0 * cb%R0**2 * rot0(:)
L(:) = cb%Ip(3) * cb%mass * cb%radius**2 * cb%rot(:)
cb%dL(:) = L(:) - cb%L0
end if

! Retrieve the current bookkeeping variables
Expand Down Expand Up @@ -2400,8 +2402,8 @@ module subroutine swiftest_io_param_writer(self, unit, iotype, v_list, iostat, i
end if
call io_param_writer_one("FIRSTKICK",param%lfirstkick, unit)

if (param%GMTINY > 0.0_DP) call io_param_writer_one("GMTINY",param%GMTINY, unit)
if (param%min_GMfrag > 0.0_DP) call io_param_writer_one("MIN_GMFRAG",param%min_GMfrag, unit)
if (param%GMTINY >= 0.0_DP) call io_param_writer_one("GMTINY",param%GMTINY, unit)
if (param%min_GMfrag >= 0.0_DP) call io_param_writer_one("MIN_GMFRAG",param%min_GMfrag, unit)
call io_param_writer_one("COLLISION_MODEL",param%collision_model, unit)
if (param%collision_model == "FRAGGLE" ) then
nseeds = size(param%seed)
Expand Down

0 comments on commit 01af903

Please sign in to comment.