Exemplo n.º 1
0
 def force(self):
     """ Get the force the link enacts """
     if self.broken:
         return 0
     if self.calculation_necessary:
         ext = self.extension
         disp = self.disp
         self._cached_disp = disp
         force = -self.k * (ext - self.L) * unitize(disp)
         self._cached_force = force
         return force
     else:
         return self._cached_force
Exemplo n.º 2
0
 def force(self):
     """ Get the force the link enacts """
     if self.broken:
         return 0
     if self.calculation_necessary:
         ext = self.extension
         disp = self.disp
         self._cached_disp = disp
         force = -self.k * ( ext - self.L ) * unitize(disp)
         self._cached_force = force
         return force
     else:
         return self._cached_force
Exemplo n.º 3
0
 def force(self):
     """ Get the force the link enacts """
     average_cell_radius = self.L/2.0
     if self.broken:
         return 0
     if self.calculation_necessary:
         stress = self.stress
         disp = self.disp
         self._cached_disp = disp
         force = stress * average_cell_radius * average_cell_radius * unitize(disp)
         self._cached_force = force
         return force
     else:
         return self._cached_force