[yt-users] Calculation of enclosed mass for a given radius

Latif latifne at gmail.com
Thu Jul 19 05:41:23 PDT 2012


Hi Guys,
I want to compute the enclosed mass for a given radius to make use of it
for computing other quantities. I would like  to define a new field like
EnclosedMass. How can i use accumulation flag in combination with new
defined field to compute the enclosed mass(like in prof.add_fields case).
Unfortunately, add_field does not accept it. May be there be there is
another way to do this.  Any help in this regard will appreciated.

prof.add_fields("CellMass",weight=None,accumulation=True)

def EnclosedMass(field,data):
    return data["Density"]*data["CellVolume"]

add_field("EnclosedMass",
function=EnclosedMass,weight=None,accumulation=True)

Thanks in advance!
Cheers
Latif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120719/95776ef9/attachment.htm>


More information about the yt-users mailing list