PMEAL / OpenPNM

A Python package for performing pore network modeling of porous media
http://openpnm.org
MIT License
442 stars 175 forks source link

A Small Revision on The "find_cluster2" attribute in DEF IP.apply_trapping (which seems to be a bug) #1320

Closed HongyangWangUniversityofRegina closed 4 years ago

HongyangWangUniversityofRegina commented 5 years ago

Hi Dear Prof Gostick,

Thank you for the OpenPNM sharing, and I have learnt a lot and benefited a lot. In the processing of understanding the code, I found that the find_cluster2(~invadedPs) in IP code has some problem. I have corrected the code by importing Topotools and then instead of:

clusters = net.find_clusters2(~invaded_ps)

I changed to this:

clusters = tp.find_clusters(network=net,mask=~invaded_ps)[0]

And the code works perfectly.

Thank you again for the coding, sincerely.

If I have made it right, I think this could be a correction to the code. If I am wrong, I would like to know how to run the find_clusters2.

Sincerely, Hongyang Wang Ph.D Student in University of Regina

jgostick commented 4 years ago

Hi @HongyangWangUniversityofRegina find_clusters2 is not in the OpenPNM V2 package. When we moved to V2 we removed some redundant functions and fixed all sorts of bugs and issues. Transporting your code to V2 is probably not that much work so you should consider it.