Skip to content

Commit

Permalink
defaulting LU to 0 instead of 1e-30
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Sep 24, 2024
1 parent 3ed3983 commit f204f03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/micm/solver/solver_builder.inl
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ namespace micm
auto jacobian = BuildJacobian<SparseMatrixPolicy>(nonzero_elements, this->number_of_grid_cells_, number_of_species);

rates.SetJacobianFlatIds(jacobian);
LinearSolverPolicy linear_solver(jacobian, 1e-30);
LinearSolverPolicy linear_solver(jacobian, 0);

std::vector<std::string> variable_names{ number_of_species };
for (auto& species_pair : species_map)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/cuda/solver/test_cuda_lu_decomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void testCudaRandomMatrix(size_t n_grids)


micm::CudaLuDecomposition gpu_lud(gpu_A);
auto gpu_LU = micm::CudaLuDecomposition::GetLUMatrices(gpu_A, 1.0e-30);
auto gpu_LU = micm::CudaLuDecomposition::GetLUMatrices(gpu_A, 0);
gpu_A.CopyToDevice();
gpu_LU.first.CopyToDevice();
gpu_LU.second.CopyToDevice();
Expand All @@ -51,7 +51,7 @@ void testCudaRandomMatrix(size_t n_grids)
gpu_A, gpu_LU.first, gpu_LU.second, [&](const double a, const double b) -> void { EXPECT_LT(std::abs((a-b)/b), 1.0e-03); });

micm::LuDecomposition cpu_lud = micm::LuDecomposition::Create<CPUSparseMatrixPolicy>(cpu_A);
auto cpu_LU = micm::LuDecomposition::GetLUMatrices<CPUSparseMatrixPolicy>(cpu_A, 1.0e-30);
auto cpu_LU = micm::LuDecomposition::GetLUMatrices<CPUSparseMatrixPolicy>(cpu_A, 0);
bool singular{ false };
cpu_lud.Decompose<CPUSparseMatrixPolicy>(cpu_A, cpu_LU.first, cpu_LU.second, singular);

Expand Down

0 comments on commit f204f03

Please sign in to comment.