Skip to content
Snippets Groups Projects

Update cooling with Grackle3

Merged Loic Hausammann requested to merge init into master
1 file
+ 4
7
Compare changes
  • Side-by-side
  • Inline
+ 4
7
@@ -152,10 +152,11 @@ class SwiftStruct(struct.Struct):
txt = tab + "%s:\n" % type(self)
for name in self.struct_name:
d = getattr(self, name)
txt += tab + "\t%s: " % name
if isinstance(d, SwiftStruct):
txt += d.__str__(tab+"\t")
else:
txt += tab + "\t%s: %s\n" % (name, d)
txt += "%s\n" % d
return txt
def __getattr__(self, name):
@@ -252,7 +253,7 @@ class ArrayStruct(SwiftStruct):
def __str__(self, tab=""):
data = self.unpack(self.data)
data = self._clean(data)
return tab + str(data)
return tab + str(data) + "\n"
def getArray(self):
@@ -431,10 +432,7 @@ class GrackleUnits(SwiftStruct):
super().__init__(self.struct_format, data, parent)
class GrackleChemistryData(SwiftStruct):
"""
WARNING, class quickly done, may contain error when accessing it directly
"""
_format = "iiiiipidiidiiiiiiidddiiddiddiiddddddiiiiiid"
_format = "iiiiiPidiidiiiiiiidddiiddiddiiddddddiiiiii"
_name = [
'use_grackle',
'with_radiative_cooling',
@@ -478,7 +476,6 @@ class GrackleChemistryData(SwiftStruct):
'radiative_transfer_hydrogen_only',
'self_shielding_method',
'H2_self_shielding',
"omp"
]
def __init__(self, data, parent=None):
Loading