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 #100

Closed benmagruder closed 1 year ago

benmagruder commented 1 year ago

This pull request updates the thin film examples to ensure that they all work properly, and makes a few small structural changes to the examples. numpy is no longer used in the python files that generate the initial guesses, only the math module. The initial guess generation now has its own executable in each example, called "generate_guess", rather than having the "run" executable generate the initial guess before it calls pscf. The initial guess generators also needed a few small updates to properly read the newly restructured param files.

One of the examples was failing to work because of a bug in FilmIteratorBase.tpp that I fixed. The bug occurs when a sweep is performed in chi_bottom or chi_top starting from a value of zero. If the initial state of the sweep does not have an external field (chi_bottom and chi_top contain only zeros), then the external field needs to be allocated, computed, and stored between steps 0 and 1 of the sweep, but this was not implemented correctly (the external field was not being allocated, leading to an error). This was fixed.

The only other change is to the command_fd documentation, where I fixed the order of the input parameters for WRITE_VERTEX_Q to match the order that they need to be input.

All examples now run without error, and none require the numpy module. Unit tests for pspc all pass.