From: Sebastian Proell Date: Mon, 1 Feb 2021 12:13:41 +0000 (+0100) Subject: ARKode with L:d:(Block)Vector X-Git-Tag: v9.3.0-rc1~528^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f2dd602f5990a41b1ae164c4d88742e8a13a31e;p=dealii.git ARKode with L:d:(Block)Vector --- diff --git a/doc/news/changes/minor/20210131Proell b/doc/news/changes/minor/20210131Proell new file mode 100644 index 0000000000..9a77648faf --- /dev/null +++ b/doc/news/changes/minor/20210131Proell @@ -0,0 +1,5 @@ +New: SUNDIALS N_Vector module now directly operates on different deal.II vectors without internally +creating copies. +In particular, ARKode can now also be used with LinearAlgebra::distributed::(Block)Vector. +
+(Sebastian Proell, 2021/01/31) diff --git a/source/sundials/arkode.cc b/source/sundials/arkode.cc index 7cf6d94a4d..3d0187c6d5 100644 --- a/source/sundials/arkode.cc +++ b/source/sundials/arkode.cc @@ -24,6 +24,8 @@ # include # include +# include +# include # ifdef DEAL_II_WITH_TRILINOS # include # include @@ -1016,12 +1018,22 @@ namespace SUNDIALS template class ARKode>; template class ARKode>; + template class ARKode>; + template class ARKode>; + # if DEAL_II_SUNDIALS_VERSION_GTE(4, 0, 0) template struct SundialsOperator>; template struct SundialsOperator>; + template struct SundialsOperator>; + template struct SundialsOperator< + LinearAlgebra::distributed::BlockVector>; template struct SundialsPreconditioner>; template struct SundialsPreconditioner>; + template struct SundialsPreconditioner< + LinearAlgebra::distributed::Vector>; + template struct SundialsPreconditioner< + LinearAlgebra::distributed::BlockVector>; # endif # ifdef DEAL_II_WITH_MPI @@ -1045,11 +1057,11 @@ namespace SUNDIALS template class ARKode; # if DEAL_II_SUNDIALS_VERSION_GTE(4, 0, 0) - template class SundialsOperator; - template class SundialsOperator; + template struct SundialsOperator; + template struct SundialsOperator; - template class SundialsPreconditioner; - template class SundialsPreconditioner; + template struct SundialsPreconditioner; + template struct SundialsPreconditioner; # endif # endif // PETSC_USE_COMPLEX # endif // DEAL_II_WITH_PETSC diff --git a/tests/sundials/arkode_03.cc b/tests/sundials/arkode_03.cc index db0a27ce60..63f591339e 100644 --- a/tests/sundials/arkode_03.cc +++ b/tests/sundials/arkode_03.cc @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include "../tests.h" -// Test implicit-explicit time stepper, no jacobian. +// Test implicit-explicit time stepper, no jacobian. Use L:d:V (in serial) // Brusselator benchmark /** @@ -54,7 +54,7 @@ main(int argc, char **argv) Utilities::MPI::MPI_InitFinalize mpi_initialization( argc, argv, numbers::invalid_unsigned_int); - typedef Vector VectorType; + using VectorType = LinearAlgebra::distributed::Vector; ParameterHandler prm; SUNDIALS::ARKode::AdditionalData data; @@ -108,7 +108,7 @@ main(int argc, char **argv) return 0; }; - Vector y(3); + VectorType y(3); y[0] = u0; y[1] = v0; y[2] = w0;