Python Forum
Trying to replace for loops with numpy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to replace for loops with numpy
#4
Are you speaking about the minimum distance between 2 meshes (nodes and elements)?
(if so, you can probably reduce the number of calculations by looking if the element normal is well oriented for example; just an idea)

I guess the floor is not flat and that's why you've to calculate the "mutual" distance between each element of each part (ball vs floor); I would say that we may certainly improve your code, but more information's are needed: can you provide some extract of the ball elements and the floor ones (few number of each)?

Paul
Reply


Messages In This Thread
RE: Trying to replace for loops with numpy - by paul18fr - Jul-31-2019, 01:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 635 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,643 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  replace sets of values in an array without using loops paul18fr 7 1,763 Jun-20-2022, 08:15 PM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 3,010 Apr-09-2019, 04:54 PM
Last Post: PhysChem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020