Skip to content

Commit

Permalink
using same calling convention for analytical tests
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Nov 11, 2024
1 parent f3c71f7 commit 59460c6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 126 deletions.
86 changes: 25 additions & 61 deletions test/integration/jit/test_jit_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,6 @@ TEST(AnalyticalExamplesJitRosenbrock, BranchedSuperStiffButAnalytical)
test_analytical_stiff_branched<BuilderType<NUM_CELLS>, StateType<NUM_CELLS>>(BuilderType<NUM_CELLS>(param_six_da), 2e-3);
}

TEST(AnalyticalExamplesJitRosenbrock, Robertson)
{
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType<1>, StateType<1>>(solver, 1e-1);
}

TEST(AnalyticalExamplesJitRosenbrock, SurfaceRxn)
{
test_analytical_surface_rxn<BuilderType<1>, StateType<1>>(two, 1e-4);
Expand All @@ -171,56 +153,38 @@ TEST(AnalyticalExamplesJitRosenbrock, SurfaceRxn)
test_analytical_surface_rxn<BuilderType<1>, StateType<1>>(six_da, 1e-5);
}

TEST(AnalyticalExamplesJitRosenbrock, E5)
TEST(AnalyticalExamplesJitRosenbrock, Robertson)
{
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);
test_analytical_robertson<BuilderType<1>, StateType<1>>(BuilderType<1>(param_two), 1e-1);
test_analytical_robertson<BuilderType<1>, StateType<1>>(BuilderType<1>(param_three), 1e-1);
test_analytical_robertson<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four), 1e-1);
test_analytical_robertson<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four_da), 1e-1);
test_analytical_robertson<BuilderType<1>, StateType<1>>(BuilderType<1>(param_six_da), 1e-1);
}

solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType<1>, StateType<1>>(solver, 1e-3);
TEST(AnalyticalExamplesJitRosenbrock, E5)
{
test_analytical_e5<BuilderType<1>, StateType<1>>(BuilderType<1>(param_two), 1e-3);
test_analytical_e5<BuilderType<1>, StateType<1>>(BuilderType<1>(param_three), 1e-3);
test_analytical_e5<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four), 1e-3);
test_analytical_e5<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four_da), 1e-3);
test_analytical_e5<BuilderType<1>, StateType<1>>(BuilderType<1>(param_six_da), 1e-3);
}

TEST(AnalyticalExamplesJitRosenbrock, Oregonator)
{
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<BuilderType<1>, StateType<1>>(solver, 4e-4);
test_analytical_oregonator<BuilderType<1>, StateType<1>>(BuilderType<1>(param_two), 4e-4);
test_analytical_oregonator<BuilderType<1>, StateType<1>>(BuilderType<1>(param_three), 4e-4);
test_analytical_oregonator<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four), 4e-4);
test_analytical_oregonator<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four_da), 4e-4);
test_analytical_oregonator<BuilderType<1>, StateType<1>>(BuilderType<1>(param_six_da), 4e-4);
}

TEST(AnalyticalExamplesJitRosenbrock, HIRES)
{
auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-6);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-7);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-7);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-6);

solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<BuilderType<1>, StateType<1>>(solver, 1e-6);
}
test_analytical_hires<BuilderType<1>, StateType<1>>(BuilderType<1>(param_two), 1e-6);
test_analytical_hires<BuilderType<1>, StateType<1>>(BuilderType<1>(param_three), 1e-7);
test_analytical_hires<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four), 1e-7);
test_analytical_hires<BuilderType<1>, StateType<1>>(BuilderType<1>(param_four_da), 1e-6);
test_analytical_hires<BuilderType<1>, StateType<1>>(BuilderType<1>(param_six_da), 1e-6);
}
94 changes: 29 additions & 65 deletions test/integration/test_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,83 +194,47 @@ TEST(AnalyticalExamples, BranchedSuperStiffButAnalytical)
test_analytical_stiff_branched<VectorRosenbrock<4>, VectorStateType<4>>(rosenbrock_vector_4, 2e-3);
}

TEST(AnalyticalExamples, Robertson)
TEST(AnalyticalExamples, SurfaceRxn)
{
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);

solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<BuilderType, StateType>(solver, 1e-1);
test_analytical_surface_rxn(rosenbrock_2stage, 1e-2);
test_analytical_surface_rxn(rosenbrock_3stage, 1e-5);
test_analytical_surface_rxn(rosenbrock_4stage, 1e-6);
test_analytical_surface_rxn(rosenbrock_4stage_da, 1e-5);
test_analytical_surface_rxn(rosenbrock_6stage_da, 1e-7);
}

TEST(AnalyticalExamples, E5)
TEST(AnalyticalExamples, Robertson)
{
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);

solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<BuilderType, StateType>(solver, 1e-3);
test_analytical_robertson(rosenbrock_2stage, 1e-1);
test_analytical_robertson(rosenbrock_3stage, 1e-1);
test_analytical_robertson(rosenbrock_4stage, 1e-1);
test_analytical_robertson(rosenbrock_4stage_da, 1e-1);
test_analytical_robertson(rosenbrock_6stage_da, 1e-1);
}

TEST(AnalyticalExamples, Oregonator)
TEST(AnalyticalExamples, E5)
{
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);

solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator(solver, 4e-6);
test_analytical_e5(rosenbrock_2stage, 1e-3);
test_analytical_e5(rosenbrock_3stage, 1e-3);
test_analytical_e5(rosenbrock_4stage, 1e-3);
test_analytical_e5(rosenbrock_4stage_da, 1e-3);
test_analytical_e5(rosenbrock_6stage_da, 1e-3);
}

TEST(AnalyticalExamples, SurfaceRxn)
TEST(AnalyticalExamples, Oregonator)
{
test_analytical_surface_rxn(rosenbrock_2stage, 1e-2);
test_analytical_surface_rxn(rosenbrock_3stage, 1e-5);
test_analytical_surface_rxn(rosenbrock_4stage, 1e-6);
test_analytical_surface_rxn(rosenbrock_4stage_da, 1e-5);
test_analytical_surface_rxn(rosenbrock_6stage_da, 1e-7);
test_analytical_oregonator(rosenbrock_2stage, 4e-6);
test_analytical_oregonator(rosenbrock_3stage, 4e-6);
test_analytical_oregonator(rosenbrock_4stage, 4e-6);
test_analytical_oregonator(rosenbrock_4stage_da, 4e-6);
test_analytical_oregonator(rosenbrock_6stage_da, 4e-6);
}

TEST(AnalyticalExamples, HIRES)
{
auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_hires(solver, 1e-6);

solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_hires(solver, 1e-7);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_hires(solver, 1e-7);

solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires(solver, 1e-6);

solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires(solver, 1e-6);
test_analytical_hires(rosenbrock_2stage, 1e-6);
test_analytical_hires(rosenbrock_3stage, 1e-7);
test_analytical_hires(rosenbrock_4stage, 1e-7);
test_analytical_hires(rosenbrock_4stage_da, 1e-6);
test_analytical_hires(rosenbrock_6stage_da, 1e-6);
}

0 comments on commit 59460c6

Please sign in to comment.