Problems:
-
The Sweep class in each program level namespace is a subclass of a specialization of the Pscf::SweepTmpl. One specific problem with this is that the SweepTmpl requires a template parameter that is the type of the "State" data structure used to store previous states. In code for periodic systems this is chosen to be a BasisFieldState, which make it impossible to create a sweep algorithm that is compatible with use of an grid iterator.
-
The SweepTmpl function is being used to serve two purposes: Langrange extrapolation of previous states and management of specialized ParameterModifiers. These should be separated
Elements of proposed solution:
-
The Sweep class in each program-level namespace should be changed to an abstract base class that defines an interface for use by the main program but only limited information about the algorithm.
-
Divide SweepTmpl into two classes for Lagrange polynomial extrapolation of states and management of specialized parameters. Consider using these by composition rather than inheritance.
-
Put functions that are specific to a particular type of FieldState into either member functions of the field state or overloaded functions of the field state. Consider moving functions to get and set the state into member functions of this class.
-
Create overloaded functions mulVS and eqAddVc for FieldStates that use an interface analogous to that of the VecOp operations, for use in template code that creates linear superpositions of previous states in a form that could use a simple Array for a state.
Problems:
The Sweep class in each program level namespace is a subclass of a specialization of the Pscf::SweepTmpl. One specific problem with this is that the SweepTmpl requires a template parameter that is the type of the "State" data structure used to store previous states. In code for periodic systems this is chosen to be a BasisFieldState, which make it impossible to create a sweep algorithm that is compatible with use of an grid iterator.
The SweepTmpl function is being used to serve two purposes: Langrange extrapolation of previous states and management of specialized ParameterModifiers. These should be separated
Elements of proposed solution:
The Sweep class in each program-level namespace should be changed to an abstract base class that defines an interface for use by the main program but only limited information about the algorithm.
Divide SweepTmpl into two classes for Lagrange polynomial extrapolation of states and management of specialized parameters. Consider using these by composition rather than inheritance.
Put functions that are specific to a particular type of FieldState into either member functions of the field state or overloaded functions of the field state. Consider moving functions to get and set the state into member functions of this class.
Create overloaded functions mulVS and eqAddVc for FieldStates that use an interface analogous to that of the VecOp operations, for use in template code that creates linear superpositions of previous states in a form that could use a simple Array for a state.