Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow solvers parameters to be modified after construction of the solver. May revisit how solver builder works - may not need to take parameters at construction time. #621

Closed
Tracked by #211
mattldawson opened this issue Aug 9, 2024 · 0 comments · Fixed by #668
Assignees
Labels
good first issue Good for newcomers

Comments

@mattldawson
Copy link
Collaborator

mattldawson commented Aug 9, 2024

Users currently have to access the solver parameters something like: solver.solver_.parameters_.h_start_ = 3 to modify solver parameters after construction. Allow users to modify these parameters without having to access nested data members.

Acceptance Criteria

  • Users can modify solver parameters using Solver functions directly
  • Remove all accesses of solver.solver_.parameters_ from tests

Ideas

  • Overload Solver::Solve() with a version of the function that takes a set of solver parameters as an argument.
  • If a user doesn't pass parameters to the solve function, then the current parameters are used.
  • If someone does pass a set of parameters, the internal solver parameters are set to the provided values. These values will be used for any subsequent calls to Solver::Solve() that don't provide parameters
  • Tolerances
    • Move the absolute and relative tolerance(s) to the StateParameters struct.
    • Save these tolerances as data members of the State class.
    • Update the solver builder to store the tolerance(s) on the StateParameters struct that gets created in the Build function

Ideas
Start with moving
std::vector absolute_tolerance_;
double relative_tolerance_{ 1e-6 }; from rosenbrock_solver_parameter.hpp to solver.hpp or solvr_builder.hpp
ideas to start doing the above and fix whats broken and go from there.

@mattldawson mattldawson added the good first issue Good for newcomers label Aug 9, 2024
@mattldawson mattldawson added this to the MICM, TUV-x in CAM-SIMA milestone Aug 9, 2024
@mattldawson mattldawson linked a pull request Aug 21, 2024 that will close this issue
@mattldawson mattldawson linked a pull request Aug 21, 2024 that will close this issue
@K20shores K20shores self-assigned this Nov 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants