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

Set hstart to timestep #679

Merged
merged 2 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/micm/solver/backward_euler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace micm
std::size_t max_iter = parameters_.max_number_of_steps_;
const auto time_step_reductions = parameters_.time_step_reductions_;

double H = time_step;
double H = parameters_.h_start_ == 0.0 ? time_step : parameters_.h_start_;
double t = 0.0;
std::size_t n_successful_integrations = 0;
std::size_t n_convergence_failures = 0;
Expand Down
1 change: 1 addition & 0 deletions include/micm/solver/backward_euler_solver_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace micm
std::vector<double> absolute_tolerance_;
double relative_tolerance_{ 1.0e-8 };
double small_{ 1.0e-40 };
double h_start_{ 0.0 };
size_t max_number_of_steps_{ 11 };
// The time step reductions are used to determine the time step after a failed solve
// This default set of time step reductions is used by CAM-Chem
Expand Down
2 changes: 1 addition & 1 deletion include/micm/solver/rosenbrock.inl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace micm
auto& K = derived_class_temporary_variables->K_;
auto& Yerror = derived_class_temporary_variables->Yerror_;
const double h_max = parameters_.h_max_ == 0.0 ? time_step : std::min(time_step, parameters_.h_max_);
const double h_start =
const double h_start =
parameters_.h_start_ == 0.0 ? std::max(parameters_.h_min_, DELTA_MIN) : std::min(h_max, parameters_.h_start_);

SolverStats stats;
Expand Down
Loading