2 #include <deal.II/lac/precondition.h>
5 #include <athena/athena.hpp>
11 : fourth_order_(fourth_order),
15 rowsh_(rows + 2 * GhostZoneSize),
16 colsh_(cols + 2 * GhostZoneSize),
17 rankh_(rowsh_ * colsh_),
18 skh_(rank_, rankh_, 9),
19 skk_(rank_, rank_, 9),
20 shk_(rankh_, rank_, 1),
24 control_(1000, 1
e-12),
28 for (
int i = 0; i <
cols_; ++i) {
48 for (
int i = 0; i <
cols_; ++i) {
57 if (j < rows_ - 1 && i > 0)
skk_.add(k,
global(
j + 1, i - 1));
67 for (
int i = 0; i <
cols_; ++i) {
74 for (
int i = 0; i <
cols_; ++i) {
87 for (
int i = 0; i <
cols_; ++i) {
101 for (
int i = 0; i <
cols_; ++i) {
116 for (
int i = 0; i <
cols_; ++i) {
118 int j1 =
j + GhostZoneSize;
119 int i1 = i + GhostZoneSize;
121 -streamf(j1, i1 - 1) + streamf(j1 - 1, i1));
124 -streamf(j1 - 1, i1 - 1) - streamf(j1, i1 - 1) +
125 streamf(j1 - 1, i1 + 1) + streamf(j1, i1 + 1));
128 +streamf(j1, i1 + 1) - streamf(j1 - 1, i1));
131 -streamf(j1 + 1, i1 - 1) - streamf(j1 + 1, i1) +
132 streamf(j1 - 1, i1 - 1) + streamf(j1 - 1, i1));
135 +streamf(j1 + 1, i1) + streamf(j1 + 1, i1 + 1) -
136 streamf(j1 - 1, i1) - streamf(j1 - 1, i1 + 1));
139 -streamf(j1 + 1, i1) + streamf(j1, i1 - 1));
142 +streamf(j1, i1 - 1) + streamf(j1 + 1, i1 - 1) -
143 streamf(j1, i1 + 1) - streamf(j1 + 1, i1 + 1));
146 +streamf(j1 + 1, i1) - streamf(j1, i1 + 1));
166 for (
int i = 0; i <
colsh_; ++i) {
167 int j1 =
j - GhostZoneSize;
168 int i1 = i - GhostZoneSize;
177 for (
int i = 0; i <
cols_; ++i) {
179 int j1 =
j + GhostZoneSize;
180 int i1 = i + GhostZoneSize;
181 (*q)(j1, i1) +=
dqvec_(k);
dealii::Vector< Real > dqvec_
void evolve(AthenaArray< Real > *q, Real dt, Real theta=1.)
void setAdvectionMatrix(AthenaArray< Real > const &streamf, Real dx)
dealii::SparseMatrix< Real > bneumann_
dealii::SparsityPattern skk_
dealii::Vector< Real > rhs_
void setDiffusionMatrix(Real kdiff, Real dx)
dealii::Vector< Real > qvec_
dealii::SparseMatrix< Real > KmJ_
dealii::SparseMatrix< Real > mass_
dealii::SparseMatrix< Real > KmJmN_
dealii::SolverGMRES solver_
dealii::SparseMatrix< Real > diffusion_
int64_t globalh(int i, int j) const
dealii::SparsityPattern skh_
int64_t global(int i, int j) const
void assembleSystem(Real dt, Real theta)
StreamTransport(int rows, int cols, bool fourth_order=true)
dealii::SparsityPattern shk_
dealii::SparseMatrix< Real > advection_