示例#1
0
 def __init__(self, vol):
     _custom_volume.__init__(self, vol)
     mat = material(steel.density, self._vol2cost(vol))
     s = self.cylS(vol)
     h = self._vol2mass(vol) / mat.density / s
     mat.cost = mat.cost / s / h * surface.unit_h
     volume.__init__(self, vol, self._name, C=0, D=0, S=surface(s, h, mat))
示例#2
0
 def __init__(self, vol):
     _custom_volume.__init__(self, vol)
     mat = material(steel.density, self._vol2cost(vol))
     s = self.cylS(vol)
     h = self._vol2mass(vol)/mat.density/s
     mat.cost = mat.cost/s/h*surface.unit_h
     volume.__init__(self, vol, self._name, C=0, D=0,
                     S=surface(s, h, mat))
示例#3
0
 def __init__(self, **kwargs):
     V = kwargs.get('V', -1.0)
     T = kwargs.get('T', -1.0)
     if V < 0 and T < 0: 
         raise ValueError("%s: either volume or torque should be provided." % self._name)
     if V < 0: V = self.S2V(T/(self._thickness*self._material.density*self._spec_torque))
     _custom_volume.__init__(self, V)
     volume.__init__(self, V, self._name, C=0, D=0,
                     S=surface(self.cylS(V), self._thickness, self._material))
示例#4
0
 def __init__(self, **kwargs):
     V = kwargs.get('V', -1.0)
     T = kwargs.get('T', -1.0)
     if V < 0 and T < 0:
         raise ValueError(
             "%s: either volume or torque should be provided." % self._name)
     if V < 0:
         V = self.S2V(
             T /
             (self._thickness * self._material.density * self._spec_torque))
     _custom_volume.__init__(self, V)
     volume.__init__(self,
                     V,
                     self._name,
                     C=0,
                     D=0,
                     S=surface(self.cylS(V), self._thickness,
                               self._material))
示例#5
0
 def __init__(self, vol):
     volume.__init__(self,
                     vol,
                     self._name,
                     C=self._cost_density,
                     D=self._density)
示例#6
0
 def __init__(self, vol):
     volume.__init__(self, vol, self._name, C=self._cost_density, D=self._density)