8#include <autodiff/forward/dual.hpp>
9#include <autodiff/forward/real.hpp>
10#include <deal.II/base/point.h>
11#include <deal.II/base/tensor.h>
12#include <deal.II/lac/full_matrix.h>
13#include <deal.II/lac/vector.h>
20 using namespace dealii;
28 template <u
int n,
typename Vector>
static std::array<autodiff::dual, n>
vector_to_AD(
const Vector &v)
30 std::array<autodiff::dual, n> x;
31 for (
uint i = 0; i < n; ++i) {
39 template <u
int n,
typename Container>
static auto ten_to_AD(
const Container &v)
41 using TensorType = std::decay_t<
decltype(v[0])>;
42 constexpr int r =
static_cast<int>(TensorType::rank);
43 constexpr int dim =
static_cast<int>(TensorType::dimension);
44 static_assert(r >= 1 && r <= 2,
"Only rank 1 and 2 tensors are supported.");
45 std::array<dealii::Tensor<r, dim, autodiff::dual>, n> x;
46 for (
uint i = 0; i < n; ++i) {
48 for (
uint d = 0; d < dim; ++d)
50 else if constexpr (r == 2)
51 for (
uint d1 = 0; d1 < dim; ++d1)
52 for (
uint d2 = 0; d2 < dim; ++d2) {
53 x[i][d1][d2] = v[i][d1][d2];
61 template <u
int n,
typename Vector>
static std::array<autodiff::real, n>
vector_to_AD(
const Vector &v)
63 std::array<autodiff::real, n> x;
64 for (
uint i = 0; i < n; ++i)
71 template <u
int n,
typename Container>
static auto ten_to_AD(
const Container &v)
73 using TensorType = std::decay_t<
decltype(v[0])>;
74 constexpr int r =
static_cast<int>(TensorType::rank);
75 constexpr int dim =
static_cast<int>(TensorType::dimension);
76 static_assert(r >= 1 && r <= 2,
"Only rank 1 and 2 tensors are supported.");
77 std::array<dealii::Tensor<r, dim, autodiff::real>, n> x;
78 for (
uint i = 0; i < n; ++i) {
79 if constexpr (r == 1) {
80 for (
uint d = 0; d < dim; ++d)
82 }
else if constexpr (r == 2) {
83 for (
uint d1 = 0; d1 < dim; ++d1)
84 for (
uint d2 = 0; d2 < dim; ++d2) {
85 x[i][d1][d2] = v[i][d1][d2];
94 template <
typename Model,
typename AD_type = autodiff::real>
class ADjacobian_flux
96 Model &
asImp() {
return static_cast<Model &
>(*this); }
97 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
101 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
103 const Vector &sol)
const
105 using Components =
typename Model::Components;
106 static_assert(n_to == Components::count_fe_functions(),
107 "jacobian_flux_grad: n_to must equal count_fe_functions()");
108 static_assert(n_from == Components::count_fe_functions(),
109 "jacobian_flux_grad: n_from must equal count_fe_functions()");
112 auto du = AD_tools::template ten_to_AD<n_from>(u);
115 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
116 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
117 for (
uint d = 0; d < dim; ++d) {
120 asImp().flux(res, p, Vector::as(ad_sol));
121 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
122 for (
uint dd = 0; dd < dim; ++dd) {
123 jF(i, j)[dd][d] = grad(res[i][dd]);
131 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
133 const Vector &sol)
const
135 using Components =
typename Model::Components;
136 static_assert(n_to == Components::count_fe_functions(),
137 "jacobian_flux_hess: n_to must equal count_fe_functions()");
138 static_assert(n_from == Components::count_fe_functions(),
139 "jacobian_flux_hess: n_from must equal count_fe_functions()");
142 auto du = AD_tools::template ten_to_AD<n_from>(u);
145 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
146 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
147 for (
uint d1 = 0; d1 < dim; ++d1)
148 for (
uint d2 = 0; d2 < dim; ++d2) {
151 asImp().flux(res, p, Vector::as(ad_sol));
152 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
153 for (
uint d = 0; d < dim; ++d) {
154 jF(i, j)[d][d1][d2] = grad(res[i][d]);
157 unseed(du[j][d1][d2]);
162 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
164 const Vector &sol)
const
166 using Components =
typename Model::Components;
167 static_assert(n_to == Components::count_fe_functions(),
168 "jacobian_flux_extr: n_to must equal count_fe_functions()");
169 static_assert(n_from == Components::count_extractors(),
170 "jacobian_flux_extr: n_from must equal count_extractors()");
173 auto de = AD_tools::template vector_to_AD<n_from>(e);
176 for (
uint j = 0; j < Components::count_extractors(); ++j) {
177 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
179 asImp().flux(res, p, Vector::as(ad_sol));
180 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
181 for (
uint d = 0; d < dim; ++d) {
182 jF(i, j)[d] = grad(res[i][d]);
189 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
191 const Vector &sol)
const
193 using Components =
typename Model::Components;
194 static_assert(n_to == Components::count_fe_functions(to),
195 "jacobian_flux: n_to must equal count_fe_functions(to)");
196 static_assert(n_from == Components::count_fe_functions(from),
197 "jacobian_flux: n_from must equal count_fe_functions(from)");
199 if constexpr (to == 0) {
201 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(u);
204 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
205 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
207 asImp().flux(res, p, Vector::as(ad_sol));
208 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
209 for (
uint d = 0; d < dim; ++d) {
210 jF(i, j)[d] = grad(res[i][d]);
216 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(sol);
217 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
218 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
221 asImp().template ldg_flux<to>(res, p, du);
222 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
223 for (
uint d = 0; d < dim; ++d) {
224 jF(i, j)[d] = grad(res[i][d]);
235 Model &
asImp() {
return static_cast<Model &
>(*this); }
236 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
240 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
242 const Vector &sol)
const
244 using Components =
typename Model::Components;
245 static_assert(n_to == Components::count_fe_functions(),
246 "jacobian_source_grad: n_to must equal count_fe_functions()");
247 static_assert(n_from == Components::count_fe_functions(),
248 "jacobian_source_grad: n_from must equal count_fe_functions()");
251 auto du = AD_tools::template ten_to_AD<n_from>(u);
254 std::array<AD_type, Components::count_fe_functions()> res{{}};
255 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
256 for (
uint d = 0; d < dim; ++d) {
259 asImp().source(res, p, Vector::as(ad_sol));
260 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
261 jS(i, j)[d] = grad(res[i]);
268 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
270 const Vector &sol)
const
272 using Components =
typename Model::Components;
273 static_assert(n_to == Components::count_fe_functions(),
274 "jacobian_source_hess: n_to must equal count_fe_functions()");
275 static_assert(n_from == Components::count_fe_functions(),
276 "jacobian_source_hess: n_from must equal count_fe_functions()");
279 auto du = AD_tools::template ten_to_AD<n_from>(u);
282 std::array<AD_type, Components::count_fe_functions()> res{{}};
283 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
284 for (
uint d1 = 0; d1 < dim; ++d1) {
285 for (
uint d2 = 0; d2 < dim; ++d2) {
288 asImp().source(res, p, Vector::as(ad_sol));
289 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
290 jS(i, j)[d1][d2] = grad(res[i]);
292 unseed(du[j][d1][d2]);
298 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
301 using Components =
typename Model::Components;
302 static_assert(n_to == Components::count_fe_functions(),
303 "jacobian_source_extr: n_to must equal count_fe_functions()");
304 static_assert(n_from == Components::count_extractors(),
305 "jacobian_source_extr: n_from must equal count_extractors()");
308 auto de = AD_tools::template vector_to_AD<n_from>(e);
311 for (
uint j = 0; j < n_from; ++j) {
312 std::array<AD_type, Components::count_fe_functions()> res{{}};
314 asImp().source(res, p, Vector::as(ad_sol));
315 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
316 jS(i, j) = grad(res[i]);
322 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
325 using Components =
typename Model::Components;
326 static_assert(n_to == Components::count_fe_functions(to),
327 "jacobian_source: n_to must equal count_fe_functions(to)");
328 static_assert(n_from == Components::count_fe_functions(from),
329 "jacobian_source: n_from must equal count_fe_functions(from)");
331 if constexpr (to == 0) {
333 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(u);
336 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
337 std::array<AD_type, Components::count_fe_functions(to)> res{{}};
339 asImp().source(res, p, Vector::as(ad_sol));
340 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
341 jS(i, j) = grad(res[i]);
346 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(sol);
347 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
348 std::array<AD_type, Components::count_fe_functions(to)> res{{}};
351 asImp().template ldg_source<to>(res, p, du);
352 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
353 jS(i, j) = grad(res[i]);
363 Model &
asImp() {
return static_cast<Model &
>(*this); }
364 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
368 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
370 const Point<dim> &p,
const Vector &sol)
const
372 using Components =
typename Model::Components;
373 static_assert(n_to == Components::count_fe_functions(to),
374 "jacobian_flux_source: n_to must equal count_fe_functions(to)");
375 static_assert(n_from == Components::count_fe_functions(from),
376 "jacobian_flux_source: n_from must equal count_fe_functions(from)");
378 if constexpr (to == 0) {
380 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(u);
383 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
384 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res_flux{{}};
385 std::array<AD_type, Components::count_fe_functions(to)> res_source{{}};
387 asImp().flux(res_flux, p, Vector::as(ad_sol));
388 asImp().source(res_source, p, Vector::as(ad_sol));
389 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
390 for (
uint d = 0; d < dim; ++d)
391 jF(i, j)[d] = grad(res_flux[i][d]);
392 jS(i, j) = grad(res_source[i]);
397 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(sol);
398 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
399 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res_flux{{}};
400 std::array<AD_type, Components::count_fe_functions(to)> res_source{{}};
402 asImp().template ldg_flux<to>(res_flux, p, du);
403 asImp().template ldg_source<to>(res_source, p, du);
404 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
405 for (
uint d = 0; d < dim; ++d)
406 jF(i, j)[d] = grad(res_flux[i][d]);
407 jS(i, j) = grad(res_source[i]);
414 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
416 SimpleMatrix<Tensor<1, dim, NT>, n_to, n_from> &jS,
const Point<dim> &p,
417 const Vector &sol)
const
419 using Components =
typename Model::Components;
420 static_assert(n_to == Components::count_fe_functions(),
421 "jacobian_flux_source_grad: n_to must equal count_fe_functions()");
422 static_assert(n_from == Components::count_fe_functions(),
423 "jacobian_flux_source_grad: n_from must equal count_fe_functions()");
426 auto du = AD_tools::template ten_to_AD<n_from>(u);
429 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res_flux{{}};
430 std::array<AD_type, Components::count_fe_functions()> res_source{{}};
431 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
432 for (
uint d = 0; d < dim; ++d) {
436 asImp().flux(res_flux, p, Vector::as(ad_sol));
437 asImp().source(res_source, p, Vector::as(ad_sol));
438 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
439 for (
uint dd = 0; dd < dim; ++dd)
440 jF(i, j)[dd][d] = grad(res_flux[i][dd]);
441 jS(i, j)[d] = grad(res_source[i]);
448 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
450 SimpleMatrix<Tensor<2, dim, NT>, n_to, n_from> &jS,
const Point<dim> &p,
451 const Vector &sol)
const
453 using Components =
typename Model::Components;
454 static_assert(n_to == Components::count_fe_functions(),
455 "jacobian_flux_source_hess: n_to must equal count_fe_functions()");
456 static_assert(n_from == Components::count_fe_functions(),
457 "jacobian_flux_source_hess: n_from must equal count_fe_functions()");
460 auto du = AD_tools::template ten_to_AD<n_from>(u);
463 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res_flux{{}};
464 std::array<AD_type, Components::count_fe_functions()> res_source{{}};
465 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
466 for (
uint d1 = 0; d1 < dim; ++d1) {
467 for (
uint d2 = 0; d2 < dim; ++d2) {
471 asImp().flux(res_flux, p, Vector::as(ad_sol));
472 asImp().source(res_source, p, Vector::as(ad_sol));
473 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
474 for (
uint d = 0; d < dim; ++d)
475 jF(i, j)[d][d1][d2] = grad(res_flux[i][d]);
476 jS(i, j)[d1][d2] = grad(res_source[i]);
478 unseed(du[j][d1][d2]);
484 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
487 const Vector &sol)
const
489 using Components =
typename Model::Components;
490 static_assert(n_to == Components::count_fe_functions(),
491 "jacobian_flux_source_extr: n_to must equal count_fe_functions()");
492 static_assert(n_from == Components::count_extractors(),
493 "jacobian_flux_source_extr: n_from must equal count_extractors()");
496 auto de = AD_tools::template vector_to_AD<n_from>(e);
499 for (
uint j = 0; j < Components::count_extractors(); ++j) {
500 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res_flux{{}};
501 std::array<AD_type, Components::count_fe_functions()> res_source{{}};
503 asImp().flux(res_flux, p, Vector::as(ad_sol));
504 asImp().source(res_source, p, Vector::as(ad_sol));
505 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
506 for (
uint d = 0; d < dim; ++d)
507 jF(i, j)[d] = grad(res_flux[i][d]);
508 jS(i, j) = grad(res_source[i]);
517 Model &
asImp() {
return static_cast<Model &
>(*this); }
518 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
522 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
524 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector_s &sol_s,
525 const Vector_n &sol_n)
const
527 using Components =
typename Model::Components;
528 static_assert(n_to == Components::count_fe_functions(),
529 "jacobian_numflux_grad: n_to must equal count_fe_functions()");
530 static_assert(n_from == Components::count_fe_functions(),
531 "jacobian_numflux_grad: n_from must equal count_fe_functions()");
536 auto du_s = AD_tools::template ten_to_AD<n_from>(u_s);
539 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
540 for (
uint d = 0; d < dim; ++d) {
541 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
543 asImp().numflux(res, normal, p, Vector_s::as(ad_sol_s), sol_n);
544 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
545 for (
uint dd = 0; dd < dim; ++dd) {
546 jNF[0](i, j)[dd][d] = grad(res[i][dd]);
552 auto du_n = AD_tools::template ten_to_AD<n_from>(u_n);
555 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
556 for (
uint d = 0; d < dim; ++d) {
557 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
559 asImp().numflux(res, normal, p, sol_s, Vector_n::as(ad_sol_n));
560 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
561 for (
uint dd = 0; dd < dim; ++dd) {
562 jNF[1](i, j)[dd][d] = grad(res[i][dd]);
570 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
572 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector_s &sol_s,
573 const Vector_n &sol_n)
const
575 using Components =
typename Model::Components;
576 static_assert(n_to == Components::count_fe_functions(),
577 "jacobian_numflux_hess: n_to must equal count_fe_functions()");
578 static_assert(n_from == Components::count_fe_functions(),
579 "jacobian_numflux_hess: n_from must equal count_fe_functions()");
584 auto du_s = AD_tools::template ten_to_AD<n_from>(u_s);
587 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
588 for (
uint d1 = 0; d1 < dim; ++d1)
589 for (
uint d2 = 0; d2 < dim; ++d2) {
590 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
591 seed(du_s[j][d1][d2]);
592 asImp().numflux(res, normal, p, Vector_s::as(ad_sol_s), sol_n);
593 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
594 for (
uint d = 0; d < dim; ++d) {
595 jNF[0](i, j)[d][d1][d2] = grad(res[i][d]);
598 unseed(du_s[j][d1][d2]);
601 auto du_n = AD_tools::template ten_to_AD<n_from>(u_n);
604 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
605 for (
uint d1 = 0; d1 < dim; ++d1)
606 for (
uint d2 = 0; d2 < dim; ++d2) {
607 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
608 seed(du_n[j][d1][d2]);
609 asImp().numflux(res, normal, p, sol_s, Vector_n::as(ad_sol_n));
610 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
611 for (
uint d = 0; d < dim; ++d) {
612 jNF[1](i, j)[d][d1][d2] = grad(res[i][d]);
615 unseed(du_n[j][d1][d2]);
620 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
622 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector_s &sol_s,
623 const Vector_n &sol_n)
const
625 using Components =
typename Model::Components;
626 static_assert(n_to == Components::count_fe_functions(),
627 "jacobian_numflux_extr: n_to must equal count_fe_functions()");
628 static_assert(n_from == Components::count_extractors(),
629 "jacobian_numflux_extr: n_from must equal count_extractors()");
632 auto de = AD_tools::template vector_to_AD<n_from>(e);
637 for (
uint j = 0; j < n_from; ++j) {
638 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res_s{{}};
639 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res_n{{}};
641 asImp().numflux(res_s, normal, p, Vector_s::as(ad_sol_s), sol_n);
642 asImp().numflux(res_n, normal, p, sol_s, Vector_n::as(ad_sol_n));
643 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
644 for (
uint d = 0; d < dim; ++d) {
645 jNF[0](i, j)[d] = grad(res_s[i][d]);
646 jNF[1](i, j)[d] = grad(res_n[i][d]);
653 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
655 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector_s &sol_s,
656 const Vector_n &sol_n)
const
658 using Components =
typename Model::Components;
659 static_assert(n_to == Components::count_fe_functions(to),
660 "jacobian_numflux: n_to must equal count_fe_functions(to)");
661 static_assert(n_from == Components::count_fe_functions(from),
662 "jacobian_numflux: n_from must equal count_fe_functions(from)");
664 if constexpr (to == 0) {
668 auto du_s = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(u_s);
671 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
672 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
674 asImp().numflux(res, normal, p, Vector_s::as(ad_sol_s), sol_n);
675 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
676 for (
uint d = 0; d < dim; ++d) {
677 jNF[0](i, j)[d] = grad(res[i][d]);
682 auto du_n = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(u_n);
685 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
686 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
688 asImp().numflux(res, normal, p, sol_s, Vector_n::as(ad_sol_n));
689 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
690 for (
uint d = 0; d < dim; ++d) {
691 jNF[1](i, j)[d] = grad(res[i][d]);
697 auto du_s = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(sol_s);
698 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
699 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
702 asImp().template ldg_numflux<to>(res, normal, p, du_s, sol_n);
703 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
704 for (
uint d = 0; d < dim; ++d) {
705 jNF[0](i, j)[d] = grad(res[i][d]);
710 auto du_n = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(sol_n);
711 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
712 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
715 asImp().template ldg_numflux<to>(res, normal, p, sol_s, du_n);
716 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
717 for (
uint d = 0; d < dim; ++d) {
718 jNF[1](i, j)[d] = grad(res[i][d]);
729 Model &
asImp() {
return static_cast<Model &
>(*this); }
730 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
734 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
736 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector &sol)
const
738 using Components =
typename Model::Components;
739 static_assert(n_to == Components::count_fe_functions(),
740 "jacobian_boundary_numflux_grad: n_to must equal count_fe_functions()");
741 static_assert(n_from == Components::count_fe_functions(),
742 "jacobian_boundary_numflux_grad: n_from must equal count_fe_functions()");
745 auto du = AD_tools::template ten_to_AD<n_from>(u);
748 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
749 for (
uint d = 0; d < dim; ++d) {
750 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
752 asImp().boundary_numflux(res, normal, p, Vector::as(ad_sol));
753 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
754 for (
uint dd = 0; dd < dim; ++dd) {
755 jBNF(i, j)[dd][d] = grad(res[i][dd]);
763 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
765 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector &sol)
const
767 using Components =
typename Model::Components;
768 static_assert(n_to == Components::count_fe_functions(),
769 "jacobian_boundary_numflux_hess: n_to must equal count_fe_functions()");
770 static_assert(n_from == Components::count_fe_functions(),
771 "jacobian_boundary_numflux_hess: n_from must equal count_fe_functions()");
774 auto du = AD_tools::template ten_to_AD<n_from>(u);
777 for (
uint j = 0; j < Components::count_fe_functions(); ++j) {
778 for (
uint d1 = 0; d1 < dim; ++d1)
779 for (
uint d2 = 0; d2 < dim; ++d2) {
780 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
782 asImp().boundary_numflux(res, normal, p, Vector::as(ad_sol));
783 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
784 for (
uint d = 0; d < dim; ++d) {
785 jBNF(i, j)[d][d1][d2] = grad(res[i][d]);
788 unseed(du[j][d1][d2]);
793 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
795 const Tensor<1, dim> &normal,
const Point<dim> &p,
const Vector &sol)
const
797 using Components =
typename Model::Components;
798 static_assert(n_to == Components::count_fe_functions(),
799 "jacobian_boundary_numflux_extr: n_to must equal count_fe_functions()");
800 static_assert(n_from == Components::count_extractors(),
801 "jacobian_boundary_numflux_extr: n_from must equal count_extractors()");
804 auto de = AD_tools::template vector_to_AD<n_from>(e);
807 for (
uint j = 0; j < n_from; ++j) {
808 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions()> res{{}};
810 asImp().boundary_numflux(res, normal, p, Vector::as(ad_sol));
811 for (
uint i = 0; i < Components::count_fe_functions(); ++i) {
812 for (
uint d = 0; d < dim; ++d) {
813 jBNF(i, j)[d] = grad(res[i][d]);
820 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
822 const Point<dim> &p,
const Vector &sol)
const
824 using Components =
typename Model::Components;
825 static_assert(n_to == Components::count_fe_functions(to),
826 "jacobian_boundary_numflux: n_to must equal count_fe_functions(to)");
827 static_assert(n_from == Components::count_fe_functions(from),
828 "jacobian_boundary_numflux: n_from must equal count_fe_functions(from)");
830 if constexpr (to == 0) {
832 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(u);
835 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
836 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
838 asImp().boundary_numflux(res, normal, p, Vector::as(ad_sol));
839 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
840 for (
uint d = 0; d < dim; ++d) {
841 jBNF(i, j)[d] = grad(res[i][d]);
847 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(from)>(sol);
848 for (
uint j = 0; j < Components::count_fe_functions(from); ++j) {
849 std::array<Tensor<1, dim, AD_type>, Components::count_fe_functions(to)> res{{}};
852 asImp().template ldg_boundary_numflux<to>(res, normal, p, du);
853 for (
uint i = 0; i < Components::count_fe_functions(to); ++i) {
854 for (
uint d = 0; d < dim; ++d) {
855 jBNF(i, j)[d] = grad(res[i][d]);
866 Model &
asImp() {
return static_cast<Model &
>(*this); }
867 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
871 template <u
int dot, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
873 const Vector &u_dot)
const
875 using Components =
typename Model::Components;
876 static_assert(n_from == Components::count_fe_functions() && n_to == Components::count_fe_functions(),
877 "jacobian_mass: n_from and n_to must both equal count_fe_functions()");
879 if constexpr (
dot == 0) {
880 auto du = AD_tools::template vector_to_AD<Components::count_fe_functions(0)>(u);
881 for (
uint j = 0; j < Components::count_fe_functions(0); ++j) {
882 std::array<AD_type, Components::count_fe_functions(0)> res{{}};
885 asImp().mass(res, p, du, u_dot);
886 for (
uint i = 0; i < Components::count_fe_functions(0); ++i) {
887 jM(i, j) = grad(res[i]);
892 auto du_dot = AD_tools::template vector_to_AD<Components::count_fe_functions(0)>(u_dot);
893 for (
uint j = 0; j < Components::count_fe_functions(0); ++j) {
894 std::array<AD_type, Components::count_fe_functions(0)> res{{}};
897 asImp().mass(res, p, u, du_dot);
898 for (
uint i = 0; i < Components::count_fe_functions(0); ++i) {
899 jM(i, j) = grad(res[i]);
909 Model &
asImp() {
return static_cast<Model &
>(*this); }
910 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
914 template <u
int to,
typename NT,
typename Solution>
917 const auto &variables =
get<0>(sol);
918 const auto &extractors =
get<1>(sol);
919 if constexpr (to == 0) {
920 AssertThrow(jac.m() == variables.size() && jac.n() == variables.size(),
921 ExcMessage(
"Assure that the jacobian has the right dimension!"));
922 }
else if constexpr (to == 1) {
923 AssertThrow(jac.m() == variables.size() && jac.n() == extractors.size(),
924 ExcMessage(
"Assure that the jacobian has the right dimension!"));
927 if constexpr (to == 0) {
928 auto du = AD_tools::template vector_to_AD<Model::Components::count_variables()>(variables);
931 for (
uint j = 0; j < Model::Components::count_variables(); ++j) {
932 std::array<AD_type, Model::Components::count_variables()> res{{}};
934 asImp().dt_variables(res, Solution::as(ad_sol));
935 for (
uint i = 0; i < Model::Components::count_variables(); ++i) {
936 jac(i, j) = grad(res[i]);
940 }
else if constexpr (to == 1) {
941 auto du = AD_tools::template vector_to_AD<Model::Components::count_extractors()>(extractors);
944 for (
uint j = 0; j < Model::Components::count_extractors(); ++j) {
945 std::array<AD_type, Model::Components::count_variables()> res{{}};
947 asImp().dt_variables(res, Solution::as(ad_sol));
948 for (
uint i = 0; i < Model::Components::count_extractors(); ++i) {
949 jac(i, j) = grad(res[i]);
959 Model &
asImp() {
return static_cast<Model &
>(*this); }
960 const Model &
asImp()
const {
return static_cast<const Model &
>(*this); }
964 template <u
int to,
int dim,
typename NT,
typename Solution>
967 static_assert(std::is_same_v<NT, double>,
"Only double is supported for now!");
968 const auto &fe_functions =
get<0>(sol);
969 const auto &fe_derivatives =
get<1>(sol);
970 const auto &fe_hessians =
get<2>(sol);
972 if constexpr (to == 0) {
973 AssertThrow(jac.m() == Model::Components::count_extractors() && jac.n() == fe_functions.size(),
974 ExcMessage(
"Assure that the jacobian has the right dimension!"));
975 }
else if constexpr (to == 1) {
976 AssertThrow(jac.m() == Model::Components::count_extractors() && jac.n() == fe_derivatives.size() * dim,
977 ExcMessage(
"Assure that the jacobian has the right dimension!"));
978 }
else if constexpr (to == 2) {
979 AssertThrow(jac.m() == Model::Components::count_extractors() && jac.n() == fe_derivatives.size() * dim * dim,
980 ExcMessage(
"Assure that the jacobian has the right dimension!"));
983 if constexpr (to == 0) {
984 auto du = AD_tools::template vector_to_AD<Model::Components::count_fe_functions()>(fe_functions);
987 for (
uint j = 0; j < Model::Components::count_fe_functions(); ++j) {
988 std::array<AD_type, Model::Components::count_extractors()> res{{}};
990 asImp().extract(res, x, Solution::as(ad_sol));
991 for (
uint i = 0; i < Model::Components::count_extractors(); ++i) {
992 jac(i, j) = grad(res[i]);
996 }
else if constexpr (to == 1) {
997 auto du = AD_tools::template ten_to_AD<Model::Components::count_fe_functions()>(fe_derivatives);
1000 for (
uint j = 0; j < Model::Components::count_fe_functions(); ++j) {
1001 for (
uint d1 = 0; d1 < dim; ++d1) {
1002 std::array<AD_type, Model::Components::count_extractors()> res{{}};
1004 asImp().extract(res, x, Solution::as(ad_sol));
1005 for (
uint i = 0; i < Model::Components::count_extractors(); ++i) {
1006 jac(i, j * dim + d1) = grad(res[i]);
1011 }
else if constexpr (to == 2) {
1012 auto du = AD_tools::template ten_to_AD<Model::Components::count_fe_functions()>(fe_hessians);
1015 for (
uint j = 0; j < Model::Components::count_fe_functions(); ++j) {
1016 for (
uint d1 = 0; d1 < dim; ++d1)
1017 for (
uint d2 = 0; d2 < dim; ++d2) {
1018 std::array<AD_type, Model::Components::count_extractors()> res{{}};
1019 seed(du[j][d1][d2]);
1020 asImp().extract(res, x, Solution::as(ad_sol));
1021 for (
uint i = 0; i < Model::Components::count_extractors(); ++i) {
1022 jac(i, j * dim * dim + d1 * dim + d2) = grad(res[i]);
1024 unseed(du[j][d1][d2]);
1031 template <
typename Model>
1043 template <
typename Model>
1057 template <
typename Model>
1066 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1068 const Vector &)
const
1071 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1075 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1080 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
1082 const Tensor<1, dim> &,
const Point<dim> &,
const Vector_s &,
const Vector_n &)
const
1085 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1087 const Point<dim> &,
const Vector &)
const
1090 template <u
int to,
int dim,
typename NT,
typename Solution>
1094 template <u
int to,
typename NT,
typename Solution>
1103 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1105 const Vector &)
const
1108 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1110 const Vector &)
const
1113 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1115 const Vector &)
const
1118 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1122 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1124 const Vector &)
const
1127 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1129 const Vector &)
const
1132 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1136 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1140 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1142 const Point<dim> &,
const Vector &)
const
1145 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1147 SimpleMatrix<Tensor<1, dim, NT>, n_to, n_from> &,
const Point<dim> &,
1148 const Vector &)
const
1151 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1153 SimpleMatrix<Tensor<2, dim, NT>, n_to, n_from> &,
const Point<dim> &,
1154 const Vector &)
const
1157 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1162 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
1164 const Tensor<1, dim> &,
const Point<dim> &,
const Vector_s &,
const Vector_n &)
const
1167 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
1169 const Tensor<1, dim> &,
const Point<dim> &,
const Vector_s &,
const Vector_n &)
const
1172 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
1174 const Tensor<1, dim> &,
const Point<dim> &,
const Vector_s &,
const Vector_n &)
const
1177 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector_s,
typename Vector_n>
1179 const Point<dim> &,
const Vector_s &,
const Vector_n &)
const
1182 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1184 const Tensor<1, dim> &,
const Point<dim> &,
const Vector &)
const
1187 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1189 const Tensor<1, dim> &,
const Point<dim> &,
const Vector &)
const
1192 template <u
int tup_
idx, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1194 const Point<dim> &,
const Vector &)
const
1197 template <u
int from, u
int to, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1199 const Point<dim> &,
const Vector &)
const
1202 template <u
int dot, u
int n_from, u
int n_to,
int dim,
typename NT,
typename Vector>
1207 template <u
int to,
int dim,
typename NT,
typename Solution>
1211 template <u
int to,
typename NT,
typename Solution>
A simple NxM-matrix class, which is used for cell-wise Jacobians.
Definition tuples.hh:170
void jacobian_boundary_numflux_grad(SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from > &jBNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:735
void jacobian_boundary_numflux_hess(SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from > &jBNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:764
const Model & asImp() const
Definition ad.hh:730
void jacobian_boundary_numflux_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jBNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:794
Model & asImp()
Definition ad.hh:729
void jacobian_boundary_numflux(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jBNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:821
Model & asImp()
Definition ad.hh:363
void jacobian_flux_source_hess(SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from > &jF, SimpleMatrix< Tensor< 2, dim, NT >, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:449
void jacobian_flux_source(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jF, SimpleMatrix< NT, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:369
void jacobian_flux_source_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jF, SimpleMatrix< NT, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:485
void jacobian_flux_source_grad(SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from > &jF, SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:415
const Model & asImp() const
Definition ad.hh:364
void jacobian_flux_grad(SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from > &jF, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:102
void jacobian_flux_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jF, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:163
void jacobian_flux(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jF, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:190
void jacobian_flux_hess(SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from > &jF, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:132
const Model & asImp() const
Definition ad.hh:97
Model & asImp()
Definition ad.hh:96
void jacobian_mass(SimpleMatrix< NT, n_to, n_from > &jM, const Point< dim > &p, const Vector &u, const Vector &u_dot) const
Definition ad.hh:872
Model & asImp()
Definition ad.hh:866
const Model & asImp() const
Definition ad.hh:867
const Model & asImp() const
Definition ad.hh:518
void jacobian_numflux_extr(std::array< SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from >, 2 > &jNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector_s &sol_s, const Vector_n &sol_n) const
Definition ad.hh:621
Model & asImp()
Definition ad.hh:517
void jacobian_numflux(std::array< SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from >, 2 > &jNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector_s &sol_s, const Vector_n &sol_n) const
Definition ad.hh:654
void jacobian_numflux_grad(std::array< SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from >, 2 > &jNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector_s &sol_s, const Vector_n &sol_n) const
Definition ad.hh:523
void jacobian_numflux_hess(std::array< SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from >, 2 > &jNF, const Tensor< 1, dim > &normal, const Point< dim > &p, const Vector_s &sol_s, const Vector_n &sol_n) const
Definition ad.hh:571
void jacobian_source_grad(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:241
void jacobian_source(SimpleMatrix< NT, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:323
Model & asImp()
Definition ad.hh:235
void jacobian_source_extr(SimpleMatrix< NT, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:299
const Model & asImp() const
Definition ad.hh:236
void jacobian_source_hess(SimpleMatrix< Tensor< 2, dim, NT >, n_to, n_from > &jS, const Point< dim > &p, const Vector &sol) const
Definition ad.hh:269
Model & asImp()
Definition ad.hh:909
void jacobian_variables(FullMatrix< NT > &jac, const Solution &sol) const
Definition ad.hh:915
const Model & asImp() const
Definition ad.hh:910
void jacobian_boundary_numflux_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1086
void jacobian_extractors(FullMatrix< NT > &, const Point< dim > &, const Solution &) const
Definition ad.hh:1091
void jacobian_flux_source_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1076
void jacobian_flux_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1067
void jacobian_variables(FullMatrix< NT > &, const Solution &) const
Definition ad.hh:1095
void jacobian_source_extr(SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1072
void jacobian_numflux_extr(std::array< SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from >, 2 > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector_s &, const Vector_n &) const
Definition ad.hh:1081
void jacobian_boundary_numflux_hess(SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1188
void jacobian_boundary_numflux(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1198
void jacobian_flux_hess(SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1109
void jacobian_mass(SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &, const Vector &) const
Definition ad.hh:1203
void jacobian_numflux_hess(std::array< SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from >, 2 > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector_s &, const Vector_n &) const
Definition ad.hh:1168
void jacobian_flux_source_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1158
void jacobian_source(SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1137
void jacobian_flux_source_hess(SimpleMatrix< Tensor< 1, dim, Tensor< 2, dim, NT > >, n_to, n_from > &, SimpleMatrix< Tensor< 2, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1152
void jacobian_source_grad(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1123
void jacobian_variables(FullMatrix< NT > &, const Solution &) const
Definition ad.hh:1212
void jacobian_source_hess(SimpleMatrix< Tensor< 2, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1128
void jacobian_boundary_numflux_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1193
void jacobian_flux_extr(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1114
void jacobian_extractors(FullMatrix< NT > &, const Point< dim > &, const Solution &) const
Definition ad.hh:1208
void jacobian_numflux_grad(std::array< SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from >, 2 > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector_s &, const Vector_n &) const
Definition ad.hh:1163
void jacobian_flux_grad(SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1104
void jacobian_source_extr(SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1133
void jacobian_numflux_extr(std::array< SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from >, 2 > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector_s &, const Vector_n &) const
Definition ad.hh:1173
void jacobian_flux(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1119
void jacobian_boundary_numflux_grad(SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1183
void jacobian_flux_source(SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, SimpleMatrix< NT, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1141
void jacobian_numflux(std::array< SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from >, 2 > &, const Tensor< 1, dim > &, const Point< dim > &, const Vector_s &, const Vector_n &) const
Definition ad.hh:1178
void jacobian_flux_source_grad(SimpleMatrix< Tensor< 1, dim, Tensor< 1, dim, NT > >, n_to, n_from > &, SimpleMatrix< Tensor< 1, dim, NT >, n_to, n_from > &, const Point< dim > &, const Vector &) const
Definition ad.hh:1146
Definition complex_math.hh:10
constexpr auto tuple_first(const std::tuple< Head, Tail... > &t)
Definition tuples.hh:261
NT dot(const A1 &a1, const A2 &a2)
A dot product which takes the dot product between a1 and a2, assuming each has n entries which can be...
Definition math.hh:220
constexpr auto & get(named_tuple< tuple_type, strSet > &ob)
get a reference to the element with the given name
Definition tuples.hh:125
unsigned int uint
Definition utils.hh:24
KOKKOS_FORCEINLINE_FUNCTION auto real(const autodiff::Real< N, T > &a)
Definition complex_math.hh:96
constexpr auto tuple_last(const std::tuple< Head, Tail... > &t)
Definition tuples.hh:247
Definition complex_math.hh:19