26#ifndef dealii_sundials_backport_h
27#define dealii_sundials_backport_h
31#ifdef DEAL_II_WITH_SUNDIALS
33# include <sundials/sundials_nvector.h>
43 N_Vector v =
new _generic_N_Vector;
44 N_Vector_Ops ops =
new _generic_N_Vector_Ops;
49 ops->nvgetvectorid =
nullptr;
50 ops->nvclone =
nullptr;
51 ops->nvcloneempty =
nullptr;
52 ops->nvdestroy =
nullptr;
53 ops->nvspace =
nullptr;
54 ops->nvgetarraypointer =
nullptr;
55 ops->nvsetarraypointer =
nullptr;
56# if DEAL_II_SUNDIALS_VERSION_GTE(5, 0, 0)
57 ops->nvgetcommunicator =
nullptr;
58 ops->nvgetlength =
nullptr;
62 ops->nvlinearsum =
nullptr;
63 ops->nvconst =
nullptr;
64 ops->nvprod =
nullptr;
66 ops->nvscale =
nullptr;
69 ops->nvaddconst =
nullptr;
70 ops->nvdotprod =
nullptr;
71 ops->nvmaxnorm =
nullptr;
72 ops->nvwrmsnormmask =
nullptr;
73 ops->nvwrmsnorm =
nullptr;
75 ops->nvwl2norm =
nullptr;
76 ops->nvl1norm =
nullptr;
77 ops->nvcompare =
nullptr;
78 ops->nvinvtest =
nullptr;
79 ops->nvconstrmask =
nullptr;
80 ops->nvminquotient =
nullptr;
82# if DEAL_II_SUNDIALS_VERSION_GTE(5, 0, 0)
84 ops->nvlinearcombination =
nullptr;
85 ops->nvscaleaddmulti =
nullptr;
86 ops->nvdotprodmulti =
nullptr;
89 ops->nvlinearsumvectorarray =
nullptr;
90 ops->nvscalevectorarray =
nullptr;
91 ops->nvconstvectorarray =
nullptr;
92 ops->nvwrmsnormvectorarray =
nullptr;
93 ops->nvwrmsnormmaskvectorarray =
nullptr;
94 ops->nvscaleaddmultivectorarray =
nullptr;
95 ops->nvlinearcombinationvectorarray =
nullptr;
98 ops->nvdotprodlocal =
nullptr;
99 ops->nvmaxnormlocal =
nullptr;
100 ops->nvminlocal =
nullptr;
101 ops->nvl1normlocal =
nullptr;
102 ops->nvinvtestlocal =
nullptr;
103 ops->nvconstrmasklocal =
nullptr;
104 ops->nvminquotientlocal =
nullptr;
105 ops->nvwsqrsumlocal =
nullptr;
106 ops->nvwsqrsummasklocal =
nullptr;
108# if DEAL_II_SUNDIALS_VERSION_GTE(5, 4, 0)
110 ops->nvbufsize =
nullptr;
111 ops->nvbufpack =
nullptr;
112 ops->nvbufunpack =
nullptr;
115# if DEAL_II_SUNDIALS_VERSION_GTE(5, 3, 0)
117 ops->nvprint =
nullptr;
118 ops->nvprintfile =
nullptr;
124 v->content =
nullptr;
152 if (
w ==
nullptr || v ==
nullptr)
154 if (
w->ops ==
nullptr || v->ops ==
nullptr)
160 v->ops->nvgetvectorid =
w->ops->nvgetvectorid;
161 v->ops->nvclone =
w->ops->nvclone;
162 v->ops->nvcloneempty =
w->ops->nvcloneempty;
163 v->ops->nvdestroy =
w->ops->nvdestroy;
164 v->ops->nvspace =
w->ops->nvspace;
165 v->ops->nvgetarraypointer =
w->ops->nvgetarraypointer;
166 v->ops->nvsetarraypointer =
w->ops->nvsetarraypointer;
167# if DEAL_II_SUNDIALS_VERSION_GTE(5, 0, 0)
168 v->ops->nvgetcommunicator =
w->ops->nvgetcommunicator;
169 v->ops->nvgetlength =
w->ops->nvgetlength;
173 v->ops->nvlinearsum =
w->ops->nvlinearsum;
174 v->ops->nvconst =
w->ops->nvconst;
175 v->ops->nvprod =
w->ops->nvprod;
176 v->ops->nvdiv =
w->ops->nvdiv;
177 v->ops->nvscale =
w->ops->nvscale;
178 v->ops->nvabs =
w->ops->nvabs;
179 v->ops->nvinv =
w->ops->nvinv;
180 v->ops->nvaddconst =
w->ops->nvaddconst;
181 v->ops->nvdotprod =
w->ops->nvdotprod;
182 v->ops->nvmaxnorm =
w->ops->nvmaxnorm;
183 v->ops->nvwrmsnormmask =
w->ops->nvwrmsnormmask;
184 v->ops->nvwrmsnorm =
w->ops->nvwrmsnorm;
185 v->ops->nvmin =
w->ops->nvmin;
186 v->ops->nvwl2norm =
w->ops->nvwl2norm;
187 v->ops->nvl1norm =
w->ops->nvl1norm;
188 v->ops->nvcompare =
w->ops->nvcompare;
189 v->ops->nvinvtest =
w->ops->nvinvtest;
190 v->ops->nvconstrmask =
w->ops->nvconstrmask;
191 v->ops->nvminquotient =
w->ops->nvminquotient;
193# if DEAL_II_SUNDIALS_VERSION_GTE(5, 0, 0)
195 v->ops->nvlinearcombination =
w->ops->nvlinearcombination;
196 v->ops->nvscaleaddmulti =
w->ops->nvscaleaddmulti;
197 v->ops->nvdotprodmulti =
w->ops->nvdotprodmulti;
200 v->ops->nvlinearsumvectorarray =
w->ops->nvlinearsumvectorarray;
201 v->ops->nvscalevectorarray =
w->ops->nvscalevectorarray;
202 v->ops->nvconstvectorarray =
w->ops->nvconstvectorarray;
203 v->ops->nvwrmsnormvectorarray =
w->ops->nvwrmsnormvectorarray;
204 v->ops->nvwrmsnormmaskvectorarray =
w->ops->nvwrmsnormmaskvectorarray;
205 v->ops->nvscaleaddmultivectorarray =
w->ops->nvscaleaddmultivectorarray;
206 v->ops->nvlinearcombinationvectorarray =
207 w->ops->nvlinearcombinationvectorarray;
210 v->ops->nvdotprodlocal =
w->ops->nvdotprodlocal;
211 v->ops->nvmaxnormlocal =
w->ops->nvmaxnormlocal;
212 v->ops->nvminlocal =
w->ops->nvminlocal;
213 v->ops->nvl1normlocal =
w->ops->nvl1normlocal;
214 v->ops->nvinvtestlocal =
w->ops->nvinvtestlocal;
215 v->ops->nvconstrmasklocal =
w->ops->nvconstrmasklocal;
216 v->ops->nvminquotientlocal =
w->ops->nvminquotientlocal;
217 v->ops->nvwsqrsumlocal =
w->ops->nvwsqrsumlocal;
218 v->ops->nvwsqrsummasklocal =
w->ops->nvwsqrsummasklocal;
220# if DEAL_II_SUNDIALS_VERSION_GTE(5, 4, 0)
222 v->ops->nvbufsize =
w->ops->nvbufsize;
223 v->ops->nvbufpack =
w->ops->nvbufpack;
224 v->ops->nvbufunpack =
w->ops->nvbufunpack;
227# if DEAL_II_SUNDIALS_VERSION_GTE(5, 3, 0)
229 v->ops->nvprint =
w->ops->nvprint;
230 v->ops->nvprintfile =
w->ops->nvprintfile;
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
int N_VCopyOps(N_Vector w, N_Vector v)
void N_VFreeEmpty(N_Vector v)