Reference documentation for deal.II version GIT relicensing-437-g81ec864850 2024-04-19 07:30:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
arkode.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2017 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15
16
17#include <deal.II/base/config.h>
18
20
21#ifdef DEAL_II_WITH_SUNDIALS
22
25
29# ifdef DEAL_II_WITH_TRILINOS
32# endif
33# ifdef DEAL_II_WITH_PETSC
36# endif
37
41
42# include <arkode/arkode_arkstep.h>
43# include <sunlinsol/sunlinsol_spgmr.h>
44# include <sunnonlinsol/sunnonlinsol_fixedpoint.h>
45
46# include <iostream>
47
49
50namespace SUNDIALS
51{
52 template <typename VectorType>
54 : ARKode(data, MPI_COMM_SELF)
55 {}
56
57
58 template <typename VectorType>
60 const MPI_Comm mpi_comm)
61 : data(data)
62 , arkode_mem(nullptr)
64 , arkode_ctx(nullptr)
65# endif
66 , mpi_communicator(mpi_comm)
67 , last_end_time(data.initial_time)
68 , pending_exception(nullptr)
69 {
71
72 // SUNDIALS will always duplicate communicators if we provide them. This
73 // can cause problems if SUNDIALS is configured with MPI and we pass along
74 // MPI_COMM_SELF in a serial application as MPI won't be
75 // initialized. Hence, work around that by just not providing a
76 // communicator in that case.
77# if DEAL_II_SUNDIALS_VERSION_GTE(7, 0, 0)
78 const int status =
79 SUNContext_Create(mpi_communicator == MPI_COMM_SELF ? SUN_COMM_NULL :
81 &arkode_ctx);
82 (void)status;
83 AssertARKode(status);
84# elif DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
85 const int status =
86 SUNContext_Create(mpi_communicator == MPI_COMM_SELF ? nullptr :
88 &arkode_ctx);
89 (void)status;
90 AssertARKode(status);
91# endif
92 }
93
94
95
96 template <typename VectorType>
98 {
99 ARKStepFree(&arkode_mem);
100
101# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
102 const int status = SUNContext_Free(&arkode_ctx);
103 (void)status;
104 AssertARKode(status);
105# endif
106
107 Assert(pending_exception == nullptr, ExcInternalError());
108 }
109
110
111
112 template <typename VectorType>
113 unsigned int
114 ARKode<VectorType>::solve_ode(VectorType &solution)
115 {
116 DiscreteTime time(data.initial_time,
117 data.final_time,
118 data.initial_step_size);
119
120 return do_evolve_time(solution, time, /* force_solver_restart = */ true);
121 }
122
123
124
125 template <typename VectorType>
126 unsigned int
128 const double intermediate_time,
129 const bool reset_solver)
130 {
132 intermediate_time > last_end_time,
134 "The requested intermediate time is smaller than the last requested "
135 "intermediate time."));
136
137 const bool do_reset = reset_solver || arkode_mem == nullptr;
138 DiscreteTime time(last_end_time, intermediate_time, data.initial_step_size);
139 return do_evolve_time(solution, time, do_reset);
140 }
141
142
143
144 template <typename VectorType>
145 int
147 DiscreteTime &time,
148 const bool do_reset)
149 {
150 if (do_reset)
151 {
152 reset(time.get_current_time(), time.get_next_step_size(), solution);
153 if (output_step)
154 output_step(time.get_current_time(),
155 solution,
156 time.get_step_number());
157 }
158 else
159 {
160 // If we don't do a full reset then we still need to fix the end time.
161 // In SUNDIALS 6 and later, SUNDIALS will not do timesteps if the
162 // current time is past the set end point (i.e., ARKStepEvolve will
163 // return ARK_TSTOP_RETURN).
164 const int status = ARKStepSetStopTime(arkode_mem, time.get_end_time());
165 (void)status;
166 AssertARKode(status);
167 }
168
169 auto solution_nvector = internal::make_nvector_view(solution
171 ,
172 arkode_ctx
173# endif
174 );
175
176 while (!time.is_at_end())
177 {
178 time.set_desired_next_step_size(data.output_period);
179
180 // Having set up all of the ancillary things, finally call the main
181 // ARKode function. One we return, check that what happened:
182 // - If we have a pending recoverable exception, ignore it if SUNDIAL's
183 // return code was zero -- in that case, SUNDIALS managed to indeed
184 // recover and we no longer need the exception
185 // - If we have any other exception, rethrow it
186 // - If no exception, test that SUNDIALS really did successfully return
187 Assert(pending_exception == nullptr, ExcInternalError());
188 double actual_next_time;
189 const auto status = ARKStepEvolve(arkode_mem,
190 time.get_next_time(),
191 solution_nvector,
192 &actual_next_time,
193 ARK_NORMAL);
194 if (pending_exception)
195 {
196 try
197 {
198 std::rethrow_exception(pending_exception);
199 }
200 catch (const RecoverableUserCallbackError &exc)
201 {
202 pending_exception = nullptr;
203 if (status == 0)
204 /* just eat the exception */;
205 else
206 throw;
207 }
208 catch (...)
209 {
210 pending_exception = nullptr;
211 throw;
212 }
213 }
214
215 AssertARKode(status);
216
217 // Then reflect this time advancement in our own DiscreteTime object:
218 time.set_next_step_size(actual_next_time - time.get_current_time());
219 time.advance_time();
220
221 // Finally check whether resets or output calls are desired at this
222 // time:
223 while (solver_should_restart(time.get_current_time(), solution))
224 reset(time.get_current_time(),
226 solution);
227
228 if (output_step)
229 output_step(time.get_current_time(),
230 solution,
231 time.get_step_number());
232 }
233 last_end_time = time.get_current_time();
234 return time.get_step_number();
235 }
236
237
238
239 template <typename VectorType>
240 void
241 ARKode<VectorType>::reset(const double current_time,
242 const double current_time_step,
243 const VectorType &solution)
244 {
245 last_end_time = current_time;
246 int status;
247 (void)status;
248
249# if DEAL_II_SUNDIALS_VERSION_GTE(7, 0, 0)
250 status = SUNContext_Free(&arkode_ctx);
251 AssertARKode(status);
252
253 // Same comment applies as in class constructor:
254 status =
255 SUNContext_Create(mpi_communicator == MPI_COMM_SELF ? SUN_COMM_NULL :
256 mpi_communicator,
257 &arkode_ctx);
258 AssertARKode(status);
259# elif DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
260 status = SUNContext_Free(&arkode_ctx);
261 AssertARKode(status);
262
263 // Same comment applies as in class constructor:
264 status =
265 SUNContext_Create(mpi_communicator == MPI_COMM_SELF ? nullptr :
266 &mpi_communicator,
267 &arkode_ctx);
268 AssertARKode(status);
269# endif
270
271 if (arkode_mem)
272 {
273 ARKStepFree(&arkode_mem);
274 // Initialization is version-dependent: do that in a moment
275 }
276
277 // just a view on the memory in solution, all write operations on yy by
278 // ARKODE will automatically be mirrored to solution
279 auto initial_condition_nvector = internal::make_nvector_view(solution
281 ,
282 arkode_ctx
283# endif
284 );
285
286 Assert(explicit_function || implicit_function,
287 ExcFunctionNotProvided("explicit_function || implicit_function"));
288
289 auto explicit_function_callback = [](SUNDIALS::realtype tt,
290 N_Vector yy,
291 N_Vector yp,
292 void *user_data) -> int {
293 Assert(user_data != nullptr, ExcInternalError());
294 ARKode<VectorType> &solver =
295 *static_cast<ARKode<VectorType> *>(user_data);
296
297 auto *src_yy = internal::unwrap_nvector_const<VectorType>(yy);
298 auto *dst_yp = internal::unwrap_nvector<VectorType>(yp);
299
301 solver.explicit_function,
302 solver.pending_exception,
303 tt,
304 *src_yy,
305 *dst_yp);
306 };
307
308
309 auto implicit_function_callback = [](SUNDIALS::realtype tt,
310 N_Vector yy,
311 N_Vector yp,
312 void *user_data) -> int {
313 Assert(user_data != nullptr, ExcInternalError());
314 ARKode<VectorType> &solver =
315 *static_cast<ARKode<VectorType> *>(user_data);
316
317 auto *src_yy = internal::unwrap_nvector_const<VectorType>(yy);
318 auto *dst_yp = internal::unwrap_nvector<VectorType>(yp);
319
321 solver.implicit_function,
322 solver.pending_exception,
323 tt,
324 *src_yy,
325 *dst_yp);
326 };
327
328 arkode_mem = ARKStepCreate(explicit_function ? explicit_function_callback :
329 ARKRhsFn(nullptr),
330 implicit_function ? implicit_function_callback :
331 ARKRhsFn(nullptr),
332 current_time,
333 initial_condition_nvector
334# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
335 ,
336 arkode_ctx
337# endif
338 );
339 Assert(arkode_mem != nullptr, ExcInternalError());
340
341 if (get_local_tolerances)
342 {
343 const auto abs_tols = internal::make_nvector_view(get_local_tolerances()
345 ,
346 arkode_ctx
347# endif
348 );
349 status =
350 ARKStepSVtolerances(arkode_mem, data.relative_tolerance, abs_tols);
351 AssertARKode(status);
352 }
353 else
354 {
355 status = ARKStepSStolerances(arkode_mem,
356 data.relative_tolerance,
357 data.absolute_tolerance);
358 AssertARKode(status);
359 }
360
361 // for version 4.0.0 this call must be made before solver settings
362 status = ARKStepSetUserData(arkode_mem, this);
363 AssertARKode(status);
364
365 setup_system_solver(solution);
366
367 setup_mass_solver(solution);
368
369 status = ARKStepSetInitStep(arkode_mem, current_time_step);
370 AssertARKode(status);
371
372 status = ARKStepSetStopTime(arkode_mem, data.final_time);
373 AssertARKode(status);
374
375 status = ARKStepSetOrder(arkode_mem, data.maximum_order);
376 AssertARKode(status);
377
378 if (custom_setup)
379 custom_setup(arkode_mem);
380 }
381
382
383
384 template <typename VectorType>
385 void
386 ARKode<VectorType>::setup_system_solver(const VectorType &solution)
387 {
388 // no point in setting up a solver when there is no linear system
389 if (!implicit_function)
390 return;
391
392 int status;
393 (void)status;
394 // Initialize solver
395 // currently only iterative linear solvers are supported
396 if (jacobian_times_vector)
397 {
398 SUNLinearSolver sun_linear_solver;
399 if (solve_linearized_system)
400 {
401 linear_solver =
402 std::make_unique<internal::LinearSolverWrapper<VectorType>>(
403 solve_linearized_system,
404 pending_exception
405# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
406 ,
407 arkode_ctx
408# endif
409 );
410 sun_linear_solver = *linear_solver;
411 }
412 else
413 {
414 // use default solver from SUNDIALS
415 // TODO give user options
416 auto y_template = internal::make_nvector_view(solution
418 ,
419 arkode_ctx
420# endif
421 );
422# if DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
423 sun_linear_solver =
424 SUNLinSol_SPGMR(y_template,
425 PREC_NONE,
426 0 /*krylov subvectors, 0 uses default*/);
427# else
428 sun_linear_solver =
429 SUNLinSol_SPGMR(y_template,
430 SUN_PREC_NONE,
431 0 /*krylov subvectors, 0 uses default*/,
432 arkode_ctx);
433# endif
434 }
435 status = ARKStepSetLinearSolver(arkode_mem, sun_linear_solver, nullptr);
436 AssertARKode(status);
437
438 auto jacobian_times_vector_callback = [](N_Vector v,
439 N_Vector Jv,
441 N_Vector y,
442 N_Vector fy,
443 void *user_data,
444 N_Vector) -> int {
445 Assert(user_data != nullptr, ExcInternalError());
446 ARKode<VectorType> &solver =
447 *static_cast<ARKode<VectorType> *>(user_data);
448
449 auto *src_v = internal::unwrap_nvector_const<VectorType>(v);
450 auto *src_y = internal::unwrap_nvector_const<VectorType>(y);
451 auto *src_fy = internal::unwrap_nvector_const<VectorType>(fy);
452
453 auto *dst_Jv = internal::unwrap_nvector<VectorType>(Jv);
454
457 solver.pending_exception,
458 *src_v,
459 *dst_Jv,
460 t,
461 *src_y,
462 *src_fy);
463 };
464
465 auto jacobian_times_vector_setup_callback = [](SUNDIALS::realtype t,
466 N_Vector y,
467 N_Vector fy,
468 void *user_data) -> int {
469 Assert(user_data != nullptr, ExcInternalError());
470 ARKode<VectorType> &solver =
471 *static_cast<ARKode<VectorType> *>(user_data);
472
473 auto *src_y = internal::unwrap_nvector_const<VectorType>(y);
474 auto *src_fy = internal::unwrap_nvector_const<VectorType>(fy);
475
478 solver.pending_exception,
479 t,
480 *src_y,
481 *src_fy);
482 };
483 status = ARKStepSetJacTimes(arkode_mem,
484 jacobian_times_setup ?
485 jacobian_times_vector_setup_callback :
486 ARKLsJacTimesSetupFn(nullptr),
487 jacobian_times_vector_callback);
488 AssertARKode(status);
489 if (jacobian_preconditioner_solve)
490 {
491 auto solve_with_jacobian_callback = [](SUNDIALS::realtype t,
492 N_Vector y,
493 N_Vector fy,
494 N_Vector r,
495 N_Vector z,
496 SUNDIALS::realtype gamma,
497 SUNDIALS::realtype delta,
498 int lr,
499 void *user_data) -> int {
500 Assert(user_data != nullptr, ExcInternalError());
501 ARKode<VectorType> &solver =
502 *static_cast<ARKode<VectorType> *>(user_data);
503
504 auto *src_y = internal::unwrap_nvector_const<VectorType>(y);
505 auto *src_fy = internal::unwrap_nvector_const<VectorType>(fy);
506 auto *src_r = internal::unwrap_nvector_const<VectorType>(r);
507
508 auto *dst_z = internal::unwrap_nvector<VectorType>(z);
509
512 solver.pending_exception,
513 t,
514 *src_y,
515 *src_fy,
516 *src_r,
517 *dst_z,
518 gamma,
519 delta,
520 lr);
521 };
522
523 auto jacobian_solver_setup_callback =
525 N_Vector y,
526 N_Vector fy,
528 SUNDIALS::booltype *jcurPtr,
529 SUNDIALS::realtype gamma,
530 void *user_data) -> int {
531 Assert(user_data != nullptr, ExcInternalError());
532 ARKode<VectorType> &solver =
533 *static_cast<ARKode<VectorType> *>(user_data);
534
535 auto *src_y = internal::unwrap_nvector_const<VectorType>(y);
536 auto *src_fy = internal::unwrap_nvector_const<VectorType>(fy);
537
540 solver.pending_exception,
541 t,
542 *src_y,
543 *src_fy,
544 jok,
545 *jcurPtr,
546 gamma);
547 };
548
549 status = ARKStepSetPreconditioner(arkode_mem,
550 jacobian_preconditioner_setup ?
551 jacobian_solver_setup_callback :
552 ARKLsPrecSetupFn(nullptr),
553 solve_with_jacobian_callback);
554 AssertARKode(status);
555 }
556 if (data.implicit_function_is_linear)
557 {
558 status = ARKStepSetLinear(
559 arkode_mem, data.implicit_function_is_time_independent ? 0 : 1);
560 AssertARKode(status);
561 }
562 }
563 else
564 {
565 auto y_template = internal::make_nvector_view(solution
567 ,
568 arkode_ctx
569# endif
570 );
571
572# if DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
573 SUNNonlinearSolver fixed_point_solver =
574 SUNNonlinSol_FixedPoint(y_template,
575 data.anderson_acceleration_subspace);
576# else
577 SUNNonlinearSolver fixed_point_solver =
578 SUNNonlinSol_FixedPoint(y_template,
579 data.anderson_acceleration_subspace,
580 arkode_ctx);
581# endif
582
583 status = ARKStepSetNonlinearSolver(arkode_mem, fixed_point_solver);
584 AssertARKode(status);
585 }
586
587 status =
588 ARKStepSetMaxNonlinIters(arkode_mem, data.maximum_non_linear_iterations);
589 AssertARKode(status);
590 }
591
592
593
594 template <typename VectorType>
595 void
596 ARKode<VectorType>::setup_mass_solver(const VectorType &solution)
597 {
598 int status;
599 (void)status;
600
601 if (mass_times_vector)
602 {
603 SUNLinearSolver sun_mass_linear_solver;
604 if (solve_mass)
605 {
606 mass_solver =
607 std::make_unique<internal::LinearSolverWrapper<VectorType>>(
608 solve_mass,
609
610 pending_exception
611# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
612 ,
613 arkode_ctx
614# endif
615 );
616 sun_mass_linear_solver = *mass_solver;
617 }
618 else
619 {
620 auto y_template = internal::make_nvector_view(solution
622 ,
623 arkode_ctx
624# endif
625 );
626# if DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
627 sun_mass_linear_solver =
628 SUNLinSol_SPGMR(y_template,
629 PREC_NONE,
630 0 /*krylov subvectors, 0 uses default*/);
631# else
632 sun_mass_linear_solver =
633 SUNLinSol_SPGMR(y_template,
634 SUN_PREC_NONE,
635 0 /*krylov subvectors, 0 uses default*/,
636 arkode_ctx);
637# endif
638 }
639
640 SUNDIALS::booltype mass_time_dependent =
641 data.mass_is_time_independent ? SUNFALSE : SUNTRUE;
642
643 status = ARKStepSetMassLinearSolver(arkode_mem,
644 sun_mass_linear_solver,
645 nullptr,
646 mass_time_dependent);
647 AssertARKode(status);
648
649 auto mass_matrix_times_vector_setup_callback =
650 [](SUNDIALS::realtype t, void *mtimes_data) -> int {
651 Assert(mtimes_data != nullptr, ExcInternalError());
652 ARKode<VectorType> &solver =
653 *static_cast<ARKode<VectorType> *>(mtimes_data);
654
656 solver.mass_times_setup, solver.pending_exception, t);
657 };
658
659 auto mass_matrix_times_vector_callback = [](N_Vector v,
660 N_Vector Mv,
662 void *mtimes_data) -> int {
663 Assert(mtimes_data != nullptr, ExcInternalError());
664 ARKode<VectorType> &solver =
665 *static_cast<ARKode<VectorType> *>(mtimes_data);
666
667 auto *src_v = internal::unwrap_nvector_const<VectorType>(v);
668 auto *dst_Mv = internal::unwrap_nvector<VectorType>(Mv);
669
671 solver.mass_times_vector,
672 solver.pending_exception,
673 t,
674 *src_v,
675 *dst_Mv);
676 };
677
678 status = ARKStepSetMassTimes(arkode_mem,
679 mass_times_setup ?
680 mass_matrix_times_vector_setup_callback :
681 ARKLsMassTimesSetupFn(nullptr),
682 mass_matrix_times_vector_callback,
683 this);
684 AssertARKode(status);
685
686 if (mass_preconditioner_solve)
687 {
688 auto mass_matrix_solver_setup_callback =
689 [](SUNDIALS::realtype t, void *user_data) -> int {
690 Assert(user_data != nullptr, ExcInternalError());
691 ARKode<VectorType> &solver =
692 *static_cast<ARKode<VectorType> *>(user_data);
693
696 };
697
698 auto solve_with_mass_matrix_callback = [](SUNDIALS::realtype t,
699 N_Vector r,
700 N_Vector z,
701 SUNDIALS::realtype delta,
702 int lr,
703 void *user_data) -> int {
704 Assert(user_data != nullptr, ExcInternalError());
705 ARKode<VectorType> &solver =
706 *static_cast<ARKode<VectorType> *>(user_data);
707
708 auto *src_r = internal::unwrap_nvector_const<VectorType>(r);
709 auto *dst_z = internal::unwrap_nvector<VectorType>(z);
710
713 solver.pending_exception,
714 t,
715 *src_r,
716 *dst_z,
717 delta,
718 lr);
719 };
720
721 status =
722 ARKStepSetMassPreconditioner(arkode_mem,
723 mass_preconditioner_setup ?
724 mass_matrix_solver_setup_callback :
725 ARKLsMassPrecSetupFn(nullptr),
726 solve_with_mass_matrix_callback);
727 AssertARKode(status);
728 }
729 }
730 }
731
732
733
734 template <typename VectorType>
735 void
737 {
738 solver_should_restart = [](const double, VectorType &) -> bool {
739 return false;
740 };
741 }
742
743
744
745 template <typename VectorType>
746 void *
748 {
749 return arkode_mem;
750 }
751
752 template class ARKode<Vector<double>>;
753 template class ARKode<BlockVector<double>>;
754
757
758# ifdef DEAL_II_WITH_MPI
759
760# ifdef DEAL_II_WITH_TRILINOS
763
764# endif // DEAL_II_WITH_TRILINOS
765
766# ifdef DEAL_II_WITH_PETSC
767# ifndef PETSC_USE_COMPLEX
770# endif // PETSC_USE_COMPLEX
771# endif // DEAL_II_WITH_PETSC
772
773# endif // DEAL_II_WITH_MPI
774
775} // namespace SUNDIALS
776
778
779#endif
#define AssertARKode(code)
Definition arkode.h:61
double get_next_step_size() const
void set_desired_next_step_size(const double time_step_size)
unsigned int get_step_number() const
bool is_at_end() const
double get_current_time() const
void set_next_step_size(const double time_step_size)
double get_next_time() const
double get_previous_step_size() const
void advance_time()
double get_end_time() const
void setup_mass_solver(const VectorType &solution)
Definition arkode.cc:596
std::function< void(const double t)> mass_preconditioner_setup
Definition arkode.h:943
std::function< void(const double t, const VectorType &y, VectorType &explicit_f)> explicit_function
Definition arkode.h:594
std::exception_ptr pending_exception
Definition arkode.h:1097
std::function< void(const double t, const VectorType &y, const VectorType &fy, const VectorType &r, VectorType &z, const double gamma, const double tol, const int lr)> jacobian_preconditioner_solve
Definition arkode.h:833
ARKode(const AdditionalData &data=AdditionalData())
Definition arkode.cc:53
void * get_arkode_memory() const
Definition arkode.cc:747
std::function< void(const double t, const VectorType &y, VectorType &res)> implicit_function
Definition arkode.h:613
std::function< void(const double t, const VectorType &r, VectorType &z, const double tol, const int lr)> mass_preconditioner_solve
Definition arkode.h:917
int do_evolve_time(VectorType &solution, ::DiscreteTime &time, const bool do_reset)
Definition arkode.cc:146
MPI_Comm mpi_communicator
Definition arkode.h:1082
void reset(const double t, const double h, const VectorType &y)
Definition arkode.cc:241
SUNContext arkode_ctx
Definition arkode.h:1075
std::function< void(const double t, const VectorType &y, const VectorType &fy, const int jok, int &jcur, const double gamma)> jacobian_preconditioner_setup
Definition arkode.h:883
std::function< void(const double t)> mass_times_setup
Definition arkode.h:669
void set_functions_to_trigger_an_assert()
Definition arkode.cc:736
std::function< void(const double t, const VectorType &v, VectorType &Mv)> mass_times_vector
Definition arkode.h:633
std::function< void(const double t, const VectorType &y, const VectorType &fy)> jacobian_times_setup
Definition arkode.h:740
unsigned int solve_ode(VectorType &solution)
Definition arkode.cc:114
void setup_system_solver(const VectorType &solution)
Definition arkode.cc:386
unsigned int solve_ode_incrementally(VectorType &solution, const double intermediate_time, const bool reset_solver=false)
Definition arkode.cc:127
std::function< void(const VectorType &v, VectorType &Jv, const double t, const VectorType &y, const VectorType &fy)> jacobian_times_vector
Definition arkode.h:702
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_SUNDIALS_VERSION_GTE(major, minor, patch)
Definition config.h:403
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
static ::ExceptionBase & ExcFunctionNotProvided(std::string arg1)
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & RecoverableUserCallbackError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
int call_and_possibly_capture_exception(const F &f, std::exception_ptr &eptr, Args &&...args)
Definition utilities.h:45
sunbooleantype booltype
::sunrealtype realtype