diff --git a/include/micm/solver/backward_euler.inl b/include/micm/solver/backward_euler.inl index 064c81517..9efd98d81 100644 --- a/include/micm/solver/backward_euler.inl +++ b/include/micm/solver/backward_euler.inl @@ -109,7 +109,7 @@ namespace micm { jac *= -1; } - for (std::size_t i_block = 0; i_block < state.jacobian_.Size(); ++i_block) + for (std::size_t i_block = 0; i_block < state.jacobian_.NumberOfBlocks(); ++i_block) { auto jacobian_vector = std::next(state.jacobian_.AsVector().begin(), i_block * state.jacobian_.FlatBlockSize()); for (const auto& i_elem : jacobian_diagonal_elements) diff --git a/test/unit/solver/test_backward_euler.cpp b/test/unit/solver/test_backward_euler.cpp index 6ad4d6692..bdf06bafd 100644 --- a/test/unit/solver/test_backward_euler.cpp +++ b/test/unit/solver/test_backward_euler.cpp @@ -22,20 +22,20 @@ TEST(BackwardEuler, CanCallSolve) micm::Phase gas_phase{ std::vector{ a, b, c } }; - micm::Process r1 = micm::Process::create() - .reactants({ a }) - .products({ yields(b, 1) }) - .rate_constant(micm::ArrheniusRateConstant({ .A_ = 2.15e-11, .B_ = 0, .C_ = 110 })) - .phase(gas_phase); - - micm::Process r2 = micm::Process::create() - .reactants({ b }) - .products({ yields(c, 1) }) - .rate_constant(micm::ArrheniusRateConstant( + micm::Process r1 = micm::Process::Create() + .SetReactants({ a }) + .SetProducts({ micm::Yields(b, 1) }) + .SetRateConstant(micm::ArrheniusRateConstant({ .A_ = 2.15e-11, .B_ = 0, .C_ = 110 })) + .SetPhase(gas_phase); + + micm::Process r2 = micm::Process::Create() + .SetReactants({ b }) + .SetProducts({ micm::Yields(c, 1) }) + .SetRateConstant(micm::ArrheniusRateConstant( micm::ArrheniusRateConstantParameters{ .A_ = 3.3e-11, .B_ = 0, .C_ = 55 })) - .phase(gas_phase); + .SetPhase(gas_phase); - auto options = micm::RosenbrockSolverParameters::three_stage_rosenbrock_parameters(); + auto options = micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters(); options.ignore_unused_species_ = true; micm::RosenbrockSolver<> rosenbrock{ micm::System(micm::SystemParameters{ .gas_phase_ = gas_phase }),