Public Member Functions | |
def | __init__ |
def | __str__ |
Public Attributes | |
theCount | |
theDensity | |
theDescription | |
theL0 | |
theMass | |
theName | |
theType | |
theVolume | |
theX0 |
Definition at line 6 of file twikiExport.py.
def twikiExport::Constituent::__init__ | ( | self, | ||
line, | ||||
predefinedMaterials | ||||
) |
Definition at line 7 of file twikiExport.py.
00007 : 00008 if len(line.split('"')) < 5 or len(line.split('"')[4].split()) < 3: 00009 raise StandardError , "not a well formed Constituent: "+constString 00010 self.theDescription = line.split('"')[1] 00011 self.theName = line.split('"')[3] 00012 self.theCount = float(line.split('"')[4].split()[1]) 00013 self.theVolume = float(line.split('"')[4].split()[0]) * self.theCount 00014 self.theType = line.split('"')[4].split()[2] 00015 self.theDensity = float(predefinedMaterials[self.theName][2]) 00016 self.theX0 = float(predefinedMaterials[self.theName][3]) * self.theDensity 00017 self.theL0 = float(predefinedMaterials[self.theName][4]) * self.theDensity 00018 self.theMass = self.theVolume * self.theDensity 00019 # print "%s\tX0: %.3f\trho: %.3f\tX0': %.3f"%(self.theName, float(predefinedMaterials[self.theName][3]), float(predefinedMaterials[self.theName][2]), self.theX0) def __str__(self):
def twikiExport::Constituent::__str__ | ( | self | ) |
Definition at line 20 of file twikiExport.py.
00020 : 00021 return "Name: "+self.theName+" desc: "+self.theDescription+" mass "+self.theMass+" type "+self.theType+" count "+self.theCount 00022 class Material:
Definition at line 12 of file twikiExport.py.
Definition at line 15 of file twikiExport.py.
Definition at line 10 of file twikiExport.py.
Definition at line 17 of file twikiExport.py.
Definition at line 18 of file twikiExport.py.
Definition at line 11 of file twikiExport.py.
Definition at line 14 of file twikiExport.py.
Definition at line 13 of file twikiExport.py.
Definition at line 16 of file twikiExport.py.