Skip to content

Commit

Permalink
Merge branch 'main' into develop-reorder-jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
mattldawson committed Jan 9, 2025
2 parents 68250d7 + faf21bd commit e7effcb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/micm/solver/lu_decomposition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#pragma once

#include "lu_decomposition_doolittle.hpp"
#include "lu_decomposition_mozart.hpp"
#include "lu_decomposition_doolittle_in_place.hpp"
#include "lu_decomposition_mozart.hpp"
#include "lu_decomposition_mozart_in_place.hpp"

#include <micm/util/sparse_matrix.hpp>
Expand Down
8 changes: 4 additions & 4 deletions include/micm/solver/lu_decomposition_doolittle_in_place.inl
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ namespace micm
const std::size_t ALU_BlockSize = ALU.NumberOfBlocks();
constexpr std::size_t ALU_GroupVectorSize = SparseMatrixPolicy::GroupVectorSize();
const std::size_t ALU_GroupSizeOfFlatBlockSize = ALU.GroupSize();

// Loop over groups of blocks
for (std::size_t i_group = 0; i_group < ALU.NumberOfGroups(ALU_BlockSize); ++i_group)
{
auto ALU_vector = std::next(ALU.AsVector().begin(), i_group * ALU_GroupSizeOfFlatBlockSize);
auto ALU_vector = std::next(ALU.AsVector().begin(), i_group * ALU_GroupSizeOfFlatBlockSize);
const std::size_t n_cells = std::min(ALU_GroupVectorSize, ALU_BlockSize - i_group * ALU_GroupVectorSize);
auto aik_njk = aik_njk_.begin();
auto aij_ajk = aij_ajk_.begin();
auto aki_nji = aki_nji_.begin();
auto akj_aji = akj_aji_.begin();
auto akj_aji = akj_aji_.begin();
for (const auto& nik_nki_aii : nik_nki_aii_)
{
for (std::size_t ik = 0; ik < std::get<0>(nik_nki_aii); ++ik)
Expand All @@ -213,7 +213,7 @@ namespace micm
ALU_vector[aki_nji->first + i] /= ALU_vector[std::get<2>(nik_nki_aii) + i];
++aki_nji;
}
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/micm/solver/solver_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace micm
State<DenseMatrixPolicy, SparseMatrixPolicy, LuDecompositionPolicy, LMatrixPolicy, UMatrixPolicy>>;

/// @brief Builder of CPU-based general solvers with in-place LU decomposition
/// @tparam SolverParametersPolicy Parameters for the ODE solver
/// @tparam SolverParametersPolicy Parameters for the ODE solver
/// @tparam DenseMatrixPolicy Policy for dense matrices
/// @tparam SparseMatrixPolicy Policy for sparse matrices
/// @tparam LuDecompositionPolicy Policy for the LU decomposition
Expand Down
13 changes: 8 additions & 5 deletions test/integration/test_analytical_backward_euler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,19 @@ auto backward_euler_vector_mozart_csc_1 = VectorBackwardEulerMozartCSC<1>(micm::
auto backward_euler_vector_mozart_csc_2 = VectorBackwardEulerMozartCSC<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_csc_3 = VectorBackwardEulerMozartCSC<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_csc_4 = VectorBackwardEulerMozartCSC<4>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_1 = VectorBackwardEulerDoolittleInPlace<1>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_2 = VectorBackwardEulerDoolittleInPlace<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_3 = VectorBackwardEulerDoolittleInPlace<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_4 = VectorBackwardEulerDoolittleInPlace<4>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_1 =
VectorBackwardEulerDoolittleInPlace<1>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_2 =
VectorBackwardEulerDoolittleInPlace<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_3 =
VectorBackwardEulerDoolittleInPlace<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_in_place_4 =
VectorBackwardEulerDoolittleInPlace<4>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_in_place_1 = VectorBackwardEulerMozartInPlace<1>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_in_place_2 = VectorBackwardEulerMozartInPlace<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_in_place_3 = VectorBackwardEulerMozartInPlace<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_in_place_4 = VectorBackwardEulerMozartInPlace<4>(micm::BackwardEulerSolverParameters());


TEST(AnalyticalExamples, Troe)
{
test_analytical_troe(backward_euler, 1e-6);
Expand Down

0 comments on commit e7effcb

Please sign in to comment.