dmorse / pscfpp

Polymer Self-Consistent Field Theory (C++/CUDA version)
https://pscf-home.cems.umn.edu
GNU General Public License v3.0
27 stars 20 forks source link

Fix film examples and unit tests for better robustness #102

Closed benmagruder closed 1 year ago

benmagruder commented 1 year ago

The unit tests and examples for thin films were using wall/polymer interfaces that were unnecessarily narrow, leading to some numerical instability and inaccuracies in the solution. In this pull request I fix that issue and use better examples in the unit tests, which should not be as sensitive to small changes in implementation, etc.

I also made a small change in which System::readCommands() exits when it reaches the end of the command file, even if it did not read "FINISH." This way, if the user forgets to add FINISH then the code will still work properly, rather than endlessly being caught in a while-loop implementing the last command in the command file. This change is added to fd1d, pspc, and pspg.

Finally, I added a bit more detail to the documentation about submodules and how to update them when switching to a different version of PSCF.

All unit tests pass on my Mac and on MSI.

For some reason, the build-cpu test system on GitHub is unable to compile the code when I push a new commit—it is struggling with compiling an archive file in the util submodule. This doesn't have anything to do with the changes I made.