Skip to content

Commit

Permalink
add tests of BE solver with CSC matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattldawson committed Dec 7, 2024
1 parent adec9b3 commit a1523db
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/integration/test_analytical_backward_euler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ template<std::size_t L>
using VectorStateTypeDoolittle =
micm::State<micm::VectorMatrix<double, L>, micm::SparseMatrix<double, micm::SparseMatrixVectorOrdering<L>>, micm::LuDecompositionDoolittle>;

template<std::size_t L>
using VectorBackwardEulerDolittleCSC = micm::CpuSolverBuilder<
micm::BackwardEulerSolverParameters,
micm::VectorMatrix<double, L>,
micm::SparseMatrix<double, micm::SparseMatrixVectorOrderingCompressedSparseColumn<L>>,
micm::LuDecompositionDoolittle>;

template<std::size_t L>
using VectorStateTypeDoolittleCSC =
micm::State<micm::VectorMatrix<double, L>, micm::SparseMatrix<double, micm::SparseMatrixVectorOrderingCompressedSparseColumn<L>>, micm::LuDecompositionDoolittle>;

template<std::size_t L>
using VectorBackwardEulerMozart = micm::CpuSolverBuilder<
micm::BackwardEulerSolverParameters,
Expand All @@ -38,6 +49,16 @@ template<std::size_t L>
using VectorStateTypeMozart =
micm::State<micm::VectorMatrix<double, L>, micm::SparseMatrix<double, micm::SparseMatrixVectorOrdering<L>>, micm::LuDecompositionMozart>;

template<std::size_t L>
using VectorBackwardEulerMozartCSC = micm::CpuSolverBuilder<
micm::BackwardEulerSolverParameters,
micm::VectorMatrix<double, L>,
micm::SparseMatrix<double, micm::SparseMatrixVectorOrderingCompressedSparseColumn<L>>, micm::LuDecompositionMozart>;

template<std::size_t L>
using VectorStateTypeMozartCSC =
micm::State<micm::VectorMatrix<double, L>, micm::SparseMatrix<double, micm::SparseMatrixVectorOrderingCompressedSparseColumn<L>>, micm::LuDecompositionMozart>;

auto backward_euler = micm::CpuSolverBuilder<micm::BackwardEulerSolverParameters>(micm::BackwardEulerSolverParameters());
auto backard_euler_vector_1 = VectorBackwardEuler<1>(micm::BackwardEulerSolverParameters());
auto backard_euler_vector_2 = VectorBackwardEuler<2>(micm::BackwardEulerSolverParameters());
Expand All @@ -48,10 +69,19 @@ auto backward_euler_vector_doolittle_1 = VectorBackwardEulerDoolittle<1>(micm::B
auto backward_euler_vector_doolittle_2 = VectorBackwardEulerDoolittle<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_3 = VectorBackwardEulerDoolittle<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_4 = VectorBackwardEulerDoolittle<4>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_csc_1 = VectorBackwardEulerDolittleCSC<1>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_csc_2 = VectorBackwardEulerDolittleCSC<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_csc_3 = VectorBackwardEulerDolittleCSC<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_doolittle_csc_4 = VectorBackwardEulerDolittleCSC<4>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_1 = VectorBackwardEulerMozart<1>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_2 = VectorBackwardEulerMozart<2>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_3 = VectorBackwardEulerMozart<3>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_4 = VectorBackwardEulerMozart<4>(micm::BackwardEulerSolverParameters());
auto backward_euler_vector_mozart_csc_1 = VectorBackwardEulerMozartCSC<1>(micm::BackwardEulerSolverParameters());
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());


TEST(AnalyticalExamples, Troe)
{
Expand All @@ -64,10 +94,18 @@ TEST(AnalyticalExamples, Troe)
test_analytical_troe<VectorBackwardEulerDoolittle<2>, VectorStateTypeDoolittle<2>>(backward_euler_vector_doolittle_2, 1e-6);
test_analytical_troe<VectorBackwardEulerDoolittle<3>, VectorStateTypeDoolittle<3>>(backward_euler_vector_doolittle_3, 1e-6);
test_analytical_troe<VectorBackwardEulerDoolittle<4>, VectorStateTypeDoolittle<4>>(backward_euler_vector_doolittle_4, 1e-6);
test_analytical_troe<VectorBackwardEulerDolittleCSC<1>, VectorStateTypeDoolittleCSC<1>>(backward_euler_vector_doolittle_csc_1, 1e-6);
test_analytical_troe<VectorBackwardEulerDolittleCSC<2>, VectorStateTypeDoolittleCSC<2>>(backward_euler_vector_doolittle_csc_2, 1e-6);
test_analytical_troe<VectorBackwardEulerDolittleCSC<3>, VectorStateTypeDoolittleCSC<3>>(backward_euler_vector_doolittle_csc_3, 1e-6);
test_analytical_troe<VectorBackwardEulerDolittleCSC<4>, VectorStateTypeDoolittleCSC<4>>(backward_euler_vector_doolittle_csc_4, 1e-6);
test_analytical_troe<VectorBackwardEulerMozart<1>, VectorStateTypeMozart<1>>(backward_euler_vector_mozart_1, 1e-6);
test_analytical_troe<VectorBackwardEulerMozart<2>, VectorStateTypeMozart<2>>(backward_euler_vector_mozart_2, 1e-6);
test_analytical_troe<VectorBackwardEulerMozart<3>, VectorStateTypeMozart<3>>(backward_euler_vector_mozart_3, 1e-6);
test_analytical_troe<VectorBackwardEulerMozart<4>, VectorStateTypeMozart<4>>(backward_euler_vector_mozart_4, 1e-6);
test_analytical_troe<VectorBackwardEulerMozartCSC<1>, VectorStateTypeMozartCSC<1>>(backward_euler_vector_mozart_csc_1, 1e-6);
test_analytical_troe<VectorBackwardEulerMozartCSC<2>, VectorStateTypeMozartCSC<2>>(backward_euler_vector_mozart_csc_2, 1e-6);
test_analytical_troe<VectorBackwardEulerMozartCSC<3>, VectorStateTypeMozartCSC<3>>(backward_euler_vector_mozart_csc_3, 1e-6);
test_analytical_troe<VectorBackwardEulerMozartCSC<4>, VectorStateTypeMozartCSC<4>>(backward_euler_vector_mozart_csc_4, 1e-6);
}

TEST(AnalyticalExamples, TroeSuperStiffButAnalytical)
Expand Down

0 comments on commit a1523db

Please sign in to comment.