summaryrefslogtreecommitdiffstats
path: root/DiskRTZ.py
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2013-05-14 09:12:14 +0200
committerVolker Hoffmann <volker@cheleb.net>2013-05-14 09:12:20 +0200
commit7d0d414a712e847cf44decb81126a5a916c6a587 (patch)
tree158a78cd6072ef3c0707930e662070b0d41466aa /DiskRTZ.py
parent83f1097d6cf633ed2f378dc3879ebbac7de7c19e (diff)
compute total total mass
Diffstat (limited to 'DiskRTZ.py')
-rw-r--r--DiskRTZ.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/DiskRTZ.py b/DiskRTZ.py
index e31aed4..2972bba 100644
--- a/DiskRTZ.py
+++ b/DiskRTZ.py
@@ -43,6 +43,7 @@ class DiskBase():
self.mdotr_rz = None; self.mdotr_r = None
self.rho_rz = None; self.rho_r = None
self.mass_r = None
+ self.total_mass = None
# MinMax Holders
self.rho_rz_min = None; self.rho_rz_max = None
self.mdotr_rz_g0_min = None; self.mdotr_rz_g0_max = None
@@ -103,6 +104,7 @@ class DiskIo(DiskBase):
self.rho_rz = npz["rho_rz"]
self.rho_r = npz["rho_r"]
self.mass_r = npz["mass_r"]
+ self.total_mass = npz["total_mass"]
self.mdotr_rz_g0_max = npz["mdotr_rz_g0_max"]
self.mdotr_rz_g0_min = npz["mdotr_rz_g0_min"]
self.mdotr_rz_l0_max = npz["mdotr_rz_l0_max"]
@@ -139,6 +141,7 @@ class DiskIo(DiskBase):
rho_rz = self.rho_rz, \
rho_r = self.rho_rz, \
mass_r = self.mass_r, \
+ total_mass = self.total_mass, \
mdotr_rz_g0_max = self.mdotr_rz_g0_max, \
mdotr_rz_g0_min = self.mdotr_rz_g0_min, \
mdotr_rz_l0_max = self.mdotr_rz_l0_max, \
@@ -235,11 +238,16 @@ class DiskReduce(DiskReduceBase):
"""Compute Mass in Radial Bins."""
self.mass_r = self.rho_r * self.dl["dr"]
+ def add_to_total_mass(self):
+ """Add Mass per Radial To Get Total Mass."""
+ self.total_mass = np.sum(self.mass_r)
+
def reduce_all(self):
self.compute_mdotr_rz()
self.integrate_rho_to_rz()
self.integrate_rho_to_r()
self.compute_mass_r()
+ self.add_to_total_mass()
self.add_mdotr_to_r()
class DiskPlots(DiskReduce):