50 const auto dim = exp->GetCoordim(0);
51 const unsigned int nDiffCoeff = dim * (dim + 1) / 2;
52 const auto nphys = exp->GetTotPoints() / modes;
54 for (
auto &component :
values)
60 for (
size_t p = 0; p < nphys; ++p)
62 const double b[3] = {1.0 + 0.01 * p, 0.7 + 0.003 * p,
65 for (
int d = 0; d < dim; ++d)
69 for (
int j = 0, c = 0; j < dim; ++j)
71 for (
int i = 0; i <= j; ++i, ++c)
73 values[c][p] = (i == j ? 0.8 + 0.001 * p : 0.0) +
74 (2.0 + 0.002 * p) * b[i] * b[j] / norm;
78 field = std::make_unique<LibUtilities::Field<TData, FieldState::Phys>>(
80 MultiRegions::GetBlockAttributes<TData, FieldState::Phys>(
81 exp, MultiRegions::UnitInterleaveWidths(exp)),
115 auto expansion = exp->GetExp(element);
116 const auto nq = expansion->GetTotPoints();
117 const auto nm = expansion->GetNcoeffs();
118 const auto dim = expansion->GetCoordim();
119 const auto offset = exp->GetPhys_Offset(element);
121 std::vector<Array<OneD, double>> gradient(dim);
122 expansion->BwdTrans(in, phys);
124 StdRegions::eVarCoeffVelX, StdRegions::eVarCoeffVelY,
125 StdRegions::eVarCoeffVelZ};
126 for (
int p = 0;
p < nq; ++
p)
128 source[
p] = lambda * phys[
p];
130 for (
int d = 0;
d < dim; ++
d)
133 expansion->PhysDeriv(d, phys, gradient[d]);
134 auto velocity = vel.find(velocities[d]);
135 if (velocity != vel.end())
137 for (
int p = 0;
p < nq; ++
p)
139 source[
p] += velocity->second[
p] * gradient[
d][
p];
143 expansion->IProductWRTBase(source, out);
144 for (
int d = 0;
d < dim; ++
d)
147 for (
int k = 0; k < dim; ++k)
149 const int i = std::min(d, k), j = std::max(d, k);
150 const auto &coefficient =
values[j * (j + 1) / 2 + i];
151 for (
int p = 0;
p < nq; ++
p)
153 flux[
p] += coefficient[offset +
p] * gradient[k][
p];
156 expansion->IProductWRTDerivBase(d, flux, tmp);