The later is much simpler.
*/
void *arkode_mem;
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
/**
* A context object associated with the ARKode solver.
*/
*/
void *ida_mem;
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
/**
* A context object associated with the IDA solver.
*/
*/
void *kinsol_mem;
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
/**
* A context object associated with the KINSOL solver.
*/
* @tparam VectorType Type of the viewed vector. This parameter can be
* deduced automatically and will respect a potential const-qualifier.
* @param vector The vector to view.
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
* @param nvector_context A SUNDIALS context object to be used for the
* operations we want to do on this vector.
# endif
template <typename VectorType>
NVectorView<VectorType>
make_nvector_view(VectorType &vector
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext nvector_context
# endif
* Constructor. Create view of @p vector.
*/
NVectorView(VectorType &vector
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext nvector_context
# endif
template <typename VectorType>
N_Vector
create_nvector(NVectorContent<VectorType> *content
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext nvector_context
# endif
template <typename VectorType>
N_Vector
create_empty_nvector(
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
SUNContext nvector_context
# endif
);
template <typename VectorType>
NVectorView<VectorType>
make_nvector_view(VectorType &vector
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext nvector_context
# endif
)
{
return NVectorView<VectorType>(vector
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
nvector_context
# endif
template <typename VectorType>
NVectorView<VectorType>::NVectorView(VectorType &vector
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext nvector_context
# endif
create_nvector(
new NVectorContent<typename std::remove_const<VectorType>::type>(
&vector)
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
nvector_context
# endif
template <typename VectorType>
N_Vector
create_nvector(NVectorContent<VectorType> *content
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext nvector_context
# endif
template <typename VectorType>
N_Vector
create_empty_nvector(
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
SUNContext nvector_context
# endif
)
{
public:
explicit LinearSolverWrapper(LinearSolveFunction<VectorType> lsolve
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
SUNContext &linsol_ctx
# endif
ARKStepFree(&arkode_mem);
# endif
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
const int status = SUNContext_Free(&arkode_ctx);
(void)status;
AssertARKode(status);
}
auto solution_nvector = internal::make_nvector_view(solution
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
// just a view on the memory in solution, all write operations on yy by
// ARKODE will automatically be mirrored to solution
auto initial_condition_nvector = internal::make_nvector_view(solution
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
if (get_local_tolerances)
{
const auto abs_tols = internal::make_nvector_view(get_local_tolerances()
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
{
ARKStepFree(&arkode_mem);
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
const int status = SUNContext_Free(&arkode_ctx);
(void)status;
AssertARKode(status);
// just a view on the memory in solution, all write operations on yy by
// ARKODE will automatically be mirrored to solution
auto initial_condition_nvector = internal::make_nvector_view(solution
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
if (get_local_tolerances)
{
const auto abs_tols = internal::make_nvector_view(get_local_tolerances()
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
linear_solver =
std::make_unique<internal::LinearSolverWrapper<VectorType>>(
solve_linearized_system
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
// use default solver from SUNDIALS
// TODO give user options
auto y_template = internal::make_nvector_view(solution
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
else
{
auto y_template = internal::make_nvector_view(solution
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
mass_solver =
std::make_unique<internal::LinearSolverWrapper<VectorType>>(
solve_mass
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif
else
{
auto y_template = internal::make_nvector_view(solution
-# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
,
arkode_ctx
# endif