Open
Description
Using flags to set many of the options for Laplacian solvers is cryptic, and not consistent with the way options are handled everywhere else. Could we replace them with something nicer? For example:
// Global options
bool zero_dc = false; /// Zero the DC (constant in Z) component of the solution
bool start_new = false; /// Iterative method start from solution=0. Has no effect for direct solvers
bool kx_zero = false; /// Zero the kx=0, n = 0 component
// Boundary options
std::string inner_boundary_condition; /// possible values "dirichlet", "neumann", "laplacian" or "cylinder"
std::string inner_boundary_condition_dc; /// default to same as inner_boundary_condition, possible values "dirichlet", "neumann", "laplacian", "cylinder", "gradpar", "gradparinv"
std::string inner_set; /// "zero", "initial_guess" or "rhs" [no flag, INVERT_SET or INVERT_RHS respectively]
bool inner_one_point = false; /// Only use one boundary point
... same for outer_* [except no "cylinder" option, as this is only needed for the inner boundary that could be the axis of the cylinder]
- Don't need replacement for
INVERT_BOTH_BOUNDARY_ONE
, can be set with boundary options - Not sure
INVERT_4th_ORDER
option is needed - theserial_band
solver is always 4th order anyway, the PETSc solver made an attempt at a 4th order implementation, but that's experimental/untested and I suspect the boundary conditions may not be correct (also the PETSc solver ignores the flag and reads abool fourth_order
option already) - '
kx_zero
'/INVERT_KX_ZERO
is only supported by serial_tri and serial_band, maybe we can deprecate/remove? INVERT_SYM
can be removed as it is not implemented anywhere (made redundant by re-definition of boundary conditions in 552c109)- I think '
*_one_point
'/INVERT_BNDRY_ONE
is not a sensible thing to have - if it is set then changingMXG
changes the boundary condition. I'd suggest deprecating/removing this option. I don't know what it was originally for?
See also #91.