yconst/fvlib — Issue #6: Solver on Mac had problem; fixed by changing numCPUs
Author: pmcarlton
Created: 2012-01-11 06:48:06+00:00
State: open

Thanks for this really great library.

I made a simple chain simulation on my Mac PowerBook and it worked as I expected.
On my multi-core mac at work, however, I noticed odd behavior including a net force in the object. The force changed direction (chain corkscrewed and moved in reverse order) when I reversed the order of points in the array so I suspected the verlet updater was bad, and the only difference between machines was the number of CPUs.. Sure enough, when I changed numCPUs to 1 in Solver.java, instead of trying to detect them, it worked again.

```java
< private final int numCPUs=getNumCPUs();
---
> // private final int numCPUs=getNumCPUs();
> private final int numCPUs=1;
```

It would be nice to use all my CPUs, but for now I'll settle for obeying the laws of physics.
Using OSX 10.7.2, 2 Quad-core Xeon processors, Java 1.6.0_29, Processing 1.5.1
-Pete