tmweigand / PMMoTo

Porous Media Morphological and Topological Analysis Toolkit
1 stars 0 forks source link

Create serialTrimAndPath #19

Closed rileyvickers closed 1 year ago

rileyvickers commented 1 year ago

Forgive me if this shouldn't be a pull, but moved all the functionality of global trimming and path identification created to a serial function.

Path ID generation is technically new, but as we discussed in meeting it might be smarter to revisit your localized version going forward.

rileyvickers commented 1 year ago

Okay so here's the new deal:

Within sets, organizePathAndSets, serial analysis of connections between sets required to define paths is already performed, negating the need for a serial path determination function later. I accordingly removed that portion of the code that I had written, favoring the version you had already prepared as it also collects information about the paths themselves (constituent sets, inlet and outlet flags, correct numbering for unconnected paths, etc.).

However, a function used to collect the information about sets required initialization of a np array with a set number of entries, typically performed easily when numProcesses > 1, as initialization was performed via compilation of correct information for boundary sets. In the case of numProcesses = 1, there are currently no boundary sets identified, and thus the array is never correctly initialized. I have thus changed that portion of the code to initialize the path information if it does not exist (i.e. when boundaries are not present).

In sum: pathID is now correctly set, and can be done with a single process (though it takes a while for a single processor)