cb-geo / mpm

CB-Geo High-Performance Material Point Method
https://www.cb-geo.com/research/mpm
Other
243 stars 83 forks source link

Throw or not throw when particles are not found within mesh #623

Closed ezrayst closed 4 years ago

ezrayst commented 4 years ago

Describe the bug Within mpm_explitic.tcc when particles are not found within the current mesh, we throw according to this line

However, we then try to remove the particles in the next line. So is the code trying to remove the unlocatable particles or stop simulation when particles are lost? These few lines of codes are confusing.

Expected behavior Since we are using an if statement already, maybe it's good to flag whether a user wants to remove or continue with unlocatable particles even though mass is not not conserved.

bodhinandach commented 4 years ago

@ezrayst I guess we already have the boolean: this->locate_particles_ to remove the particles which cannot be located automatically. Did you mean that we need the removing option based on a particular criterion? If this->locate_particles_ set false, it will automatically remove the particle when the search unable to find them.

ezrayst commented 4 years ago

Yeah, sorry, was looking at the wrong file. My bad!

kks32 commented 4 years ago

Please see: https://mpm.cb-geo.com/#/user/preprocess/input?id=locate-particles-optional

In JSON analysis section you can specify: "locate_particles": false,