Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Draft PR: Remove solver_.parameters_ #668

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

montythind
Copy link
Contributor

This is just a draft for the PR.

closes #621

@montythind
Copy link
Contributor Author

I do see some calls where solver.solver_.parameters_ is not being modifiedbut rather the value is getting used. Example:

EXPECT_EQ(solver.solver_.parameters_.absolute_tolerance_[state.variable_map_["Ar"]], 1.0e-12);
std::vector atol = gpu_solver.solver_.parameters_.absolute_tolerance_;

I am unsure if we need to change these as well?

@K20shores @mattldawson

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.34%. Comparing base (16ad525) to head (263af07).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #668      +/-   ##
==========================================
+ Coverage   92.69%   93.34%   +0.65%     
==========================================
  Files          53       53              
  Lines        3585     3606      +21     
==========================================
+ Hits         3323     3366      +43     
+ Misses        262      240      -22     
Flag Coverage Δ
93.34% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@K20shores K20shores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right direction, but we still have some more work to do. Any mechanism-specific thing (like tolerances) need to be moved somewhere else. We should spend some time figuring out where they need to go. Also, the parameters need to be any set of paramters (rosenbrock, backward euler, etc.)

Comment on lines +67 to +71
SolverResult Solve(double time_step, StatePolicy& state, RosenbrockSolverParameters params)
{
solver_.parameters_.h_start_ = params.h_start_;
return solver_.Solve(time_step, state);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SolverResult Solve(double time_step, StatePolicy& state, RosenbrockSolverParameters params)
{
solver_.parameters_.h_start_ = params.h_start_;
return solver_.Solve(time_step, state);
}
SolverResult Solve(double time_step, StatePolicy& state, RosenbrockSolverParameters params)
{
solver_.parameters_ = params;
return solver_.Solve(time_step, state);
}

We actually need all of the paramters to be updated. That was the impetus for moving the tolerances off of the params. Also, this needs to work for any set of parameters, not just rosenbrock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants