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
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
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