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

Commit

Permalink
Fixed issues getting the rotation variables set
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jan 9, 2023
1 parent 72f9df2 commit dde82e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions python/swiftest/swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,10 @@ def vec2xr(param: Dict, **kwargs: Any):

# Check for valid keyword arguments
kwargs = {k:kwargs[k] for k,v in kwargs.items() if v is not None}
if param['ROTATION']:
if "rot" not in kwargs and "Gmass" in kwargs:
kwargs['rot'] = np.zeros((len(kwargs['Gmass']),3))
if "Ip" not in kwargs and "Gmass" in kwargs:
kwargs['Ip'] = np.full((len(kwargs['Gmass']),3), 0.4)
if "rot" not in kwargs and "Gmass" in kwargs:
kwargs['rot'] = np.zeros((len(kwargs['Gmass']),3))
if "Ip" not in kwargs and "Gmass" in kwargs:
kwargs['Ip'] = np.full((len(kwargs['Gmass']),3), 0.4)

if "time" not in kwargs:
kwargs["time"] = np.array([0.0])
Expand Down
4 changes: 2 additions & 2 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,10 @@ def set_parameter(self, verbose: bool = True, **kwargs):
"mtiny": None,
"close_encounter_check": True,
"general_relativity": True,
"collision_model": "MERGE",
"collision_model": "FRAGGLE",
"minimum_fragment_mass": None,
"minimum_fragment_gmass": 0.0,
"rotation": False,
"rotation": True,
"compute_conservation_values": False,
"extra_force": False,
"big_discard": False,
Expand Down

0 comments on commit dde82e5

Please sign in to comment.