dmorse / pscfpp

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

ImposedFieldsGenerator feature #185

Closed benmagruder closed 2 months ago

benmagruder commented 3 months ago

This pull request contains a variety of new classes that allow greatly increased flexibility for future add-ons that impose geometric confinement (via a mask) and/or external fields on the SCF calculation.

In this new design, an iterator that is able to impose masks and external fields should contain an ImposedFieldsGenerator object that generates the mask and/or external field. A block of the param file for the ImposedFieldsGenerator allows the user to input the necessary parameters to define the mask and/or external field.

The ImposedFieldsGenerator contains two pointers to FieldGenerator objects (one of which may optionally be left empty). FieldGenerator is a base class, and the actual objects that these pointers refer to should be subclasses that define which type of imposed field(s) it will generate, what parameters it needs to generate them, and provides methods that actually create the field(s) and provides the system with access to them.

Currently, this new hierarchy of classes is only used for one type of imposed fields: those that model thin-film confinement. New classes rpc::MaskGenFilm and rpc::ExtGenFilm (which inherit from prdc::MaskGenFilmBase and prdc::ExtGenFilmBase) are implemented to replace the old rpc::FilmIterator class. For the five examples in examples/pc/scf/films/, the new classes provide identical results to the old class, indicating that the implementation here is functional.

New unit tests have not yet been developed for this feature, but all other unit tests still pass. These unit tests will be included in a future pull request. A similar set of classes will be generated to impose thin film confinement in the rpg namespace, which will also be included in a future pull request.

benmagruder commented 2 months ago

Thanks for the feedback. I've made changes to address all of your comments, and will add the changes to this pull request as an additional commit. The changes I made are as follows: