Skip to content

Commit

Permalink
oregonator is too stiff for backward euler
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Jun 25, 2024
1 parent a7f907c commit 4541df7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions test/integration/analytical_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,12 +1780,6 @@ void test_analytical_oregonator(auto& solver, double tolerance = 1e-8)

for (size_t i = 0; i < model_concentrations.size(); ++i)
{
// EXPECT_NEAR(model_concentrations[i][_a], analytical_concentrations[i][0], tolerance)
// << "Arrays differ at index (" << i << ", " << 0 << ")";
// EXPECT_NEAR(model_concentrations[i][_b], analytical_concentrations[i][1], tolerance)
// << "Arrays differ at index (" << i << ", " << 1 << ")";
// EXPECT_NEAR(model_concentrations[i][_c], analytical_concentrations[i][2], tolerance)
// << "Arrays differ at index (" << i << ", " << 2 << ")";
double rel_diff = relative_difference(model_concentrations[i][_a], analytical_concentrations[i][0]);
EXPECT_NEAR(0, rel_diff, tolerance) << "Arrays differ at index (" << i << ", " << 0 << ")";
rel_diff = relative_difference(model_concentrations[i][_b], analytical_concentrations[i][1]);
Expand Down
6 changes: 5 additions & 1 deletion test/integration/analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ TEST(AnalyticalExamples, Oregonator)
using OregonatorTest = Oregonator<micm::Matrix<double>, SparseMatrixTest>;

auto rosenbrock_solver = OregonatorTest::template CreateSolver<RosenbrockTest<OregonatorTest>, LinearSolverTest>(params, 1);
auto backward_euler_solver = OregonatorTest::template CreateSolver<BackwardEulerTest<OregonatorTest>, LinearSolverTest>(micm::BackwardEulerSolverParameters(), 1);
auto backward_euler_params = micm::BackwardEulerSolverParameters();
double abolute_tolerance = 1e-16;
backward_euler_params.absolute_tolerance_ = { abolute_tolerance, abolute_tolerance, abolute_tolerance };
backward_euler_params.relative_tolerance_ = 1e-10;
auto backward_euler_solver = OregonatorTest::template CreateSolver<BackwardEulerTest<OregonatorTest>, LinearSolverTest>(backward_euler_params, 1);

test_analytical_oregonator(rosenbrock_solver, 1e-3);
// test_analytical_oregonator(backward_euler_solver, 1e-1);
Expand Down

0 comments on commit 4541df7

Please sign in to comment.