Skip to content

Commit

Permalink
Merge branch 'main' of github.com:/hannorein/rebound
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Jan 11, 2023
2 parents 7bd589d + 55db3d3 commit ca6fe3b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rebound/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1919,13 +1919,30 @@ def move_to_com(self):
clibrebound.reb_move_to_com(byref(self))

def calculate_energy(self):
"""
Returns the sum of potential and kinetic energy of all particles in the simulation.
"""
warnings.warn( "sim.calculate_energy() is deprecated and will be removed in the future. Use sim.energy() instead", FutureWarning)
clibrebound.reb_tools_energy.restype = c_double
return clibrebound.reb_tools_energy(byref(self))

def energy(self):
"""
Returns the sum of potential and kinetic energy of all particles in the simulation.
"""
clibrebound.reb_tools_energy.restype = c_double
return clibrebound.reb_tools_energy(byref(self))

def calculate_angular_momentum(self):
"""
Returns a list of the three (x,y,z) components of the total angular momentum of all particles in the simulation.
"""
warnings.warn( "sim.calculate_angular_momentum() is deprecated and will be removed in the future. Use sim.angular_momentum() instead", FutureWarning)
clibrebound.reb_tools_angular_momentum.restype = Vec3d
L = clibrebound.reb_tools_angular_momentum(byref(self))
return [L.x, L.y, L.z]

def angular_momentum(self):
"""
Returns a list of the three (x,y,z) components of the total angular momentum of all particles in the simulation.
"""
Expand Down

0 comments on commit ca6fe3b

Please sign in to comment.