dmorse / pscfpp

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

Add isSymmetric_ flag to Iterators for periodic systems #145

Closed dmorse closed 8 months ago

dmorse commented 9 months ago

Status: The Pspc::System::iterate function currently requires that w_.isSymmetric be true. This enforces an unstated assumption that the iterator will assume symmetry and modify the symmetry-adapted basis coefficients. The Pspg code instead allows us of an grid iterator that uses the rgrid representation. Both codes should allow iterates that do or do note impose symmetry, but should check preconditions that require the fields to be symmetric if a specific iterator requires it.

Proposal: Each iterator should instead impose its own rules about whether it needs the field to be symmetric in both codes. Define isSymmetric_ as a protected member of the Iterator base class which can be set in constructor of each iterator. Add a public isSymmetric() member function. The System::Iterator can then use this to test if the field needs to be symmetric. This condition can also be tested again within the iterator on entry to the solve function.

dmorse commented 8 months ago

Completed < Nov. 5, 2023