public void update(particleSystem pS) { vector load = FriedChiken.getLoad(); foreach (elements.node n in nodeList) { load[FriedChiken.index[pS.globalIndex[n.el[0]], 0]] += this.forceX; load[FriedChiken.index[pS.globalIndex[n.el[0]], 1]] += this.forceY; load[FriedChiken.index[pS.globalIndex[n.el[0]], 2]] += this.forceZ; } }
public void update(particleSystem pS) { vector grad = FriedChiken.getGradient(); vector load = FriedChiken.getLoad(); System.Threading.Tasks.Parallel.For(0, elemList.Count, (i) => { elements.element e = elemList[i]; e.copyFrom(pS.particles); e.Update(); } ); for (int i = 0; i < elemList.Count; i++) { elements.element e = elemList[i]; e.Merge(pS, grad, load, ref FriedChiken.energy); } }