Le 9 févr. 2011 à 17:45, Bruno Chareyre a écrit : > >> Oh simply cubic. Say that you divide the main cell into 8 cubic parts >> and then you get the average of stress in each of them (I simply want >> to compare them). > Here is the algorithm : > > foreach sphere: > cubeStress+=bodyStress(sphere.id)*volumeInsideCube > cubeStress/=cubeVolume > > Then if you have N cubes, sum_N(cubeStress)/N will be exactly the stress > in the cell. > > Probably similar to what Vincent suggests. I don't think it is > equivalent with weighting by branch length, since volumeInsideCube is a > non linear function of position. > > Writing the volumeInsideCube function will be the boring part... > > Bruno
I agree with you Bruno. Your 3-line algorithm is what I suggest in a more readable way (less words = easier to understand) Chiara, I have no reference about it. Just some discussions with JJ Moreau when I was in Montpellier. I can scan and send you some explanations if you want, but I think Bruno's mail is clear enough. I don't know if you use sphere bodies. If yes, computing a local mean stress could be easier with a function volumeSphereInsideSphere (instead of volumeInsideCube), but sum_N(sphereStress)/N will NOT be the mean stress in the cell... Vincent _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

