def __sizeof__(self):
    'Return the size in memory of the object (including all subobject)'
    S = 0
    S += getsizeof(self.mat_type)
    S += getsizeof(self.type_magnetization)
    S += getsizeof(self.Lmag)
    return S
Return the size in memory of the object (including all subobject)
def __sizeof__(self):
    
    S = 0
    S += getsizeof(self.mat_type)
    S += getsizeof(self.type_magnetization)
    S += getsizeof(self.Lmag)
    return S