doc Posted August 14, 2008 Share Posted August 14, 2008 a couple of particles in my pop sim are reporting nan values for some of their velocities. I was wondering if there's a way to identify these points and change their velocities to 0? thanks L Quote Link to comment Share on other sites More sharing options...
SpencerL Posted August 18, 2008 Share Posted August 18, 2008 Hey Luca, Not sure if you found a solution to this yet, but you could just group the particles usint strmatch() and then set that group Veloctiy to 0. strmatch($VX, "inf") Quote Link to comment Share on other sites More sharing options...
doc Posted August 18, 2008 Author Share Posted August 18, 2008 thanks spencer, Silvina over at sesi support gave me a nice solution: Since a comparison with a NAN is always false, you can try: if( (testme -testme) != 0) { printf("variable 'testme' is an inf."); } thanks for the help! Quote Link to comment Share on other sites More sharing options...
SpencerL Posted August 18, 2008 Share Posted August 18, 2008 thanks spencer, Silvina over at sesi support gave me a nice solution: Since a comparison with a NAN is always false, you can try: if( (testme -testme) != 0) { printf("variable 'testme' is an inf."); } thanks for the help! Ah yes, thats a good one to know. Thanks! Quote Link to comment Share on other sites More sharing options...
silvina Posted August 18, 2008 Share Posted August 18, 2008 Ah yes, thats a good one to know.Thanks! if( (testme -testme) != 0) { printf("variable 'testme' is an inf."); } Jason, does the above look familiar to you? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.