59 const std::vector<int> °ree,
const int numMin)
61 const int nm = exp->GetNcoeffs();
62 const int nq = exp->GetTotPoints();
64 BOOST_REQUIRE_EQUAL(ortho->GetNcoeffs(), nm);
65 BOOST_REQUIRE_EQUAL(ortho->GetTotPoints(), nq);
66 BOOST_REQUIRE_EQUAL(
static_cast<int>(degree.size()), nm);
70 for (
int mode = 0; mode < nm; ++mode)
73 orthoCoeffs[mode] = 1.0;
76 ortho->BwdTrans(orthoCoeffs, phys);
77 exp->FwdTrans(phys, coeffs);
78 exp->ReduceOrderCoeffs(numMin, coeffs, reduced);
79 exp->BwdTrans(reduced, back);
81 const bool kept = degree[mode] < numMin;
83 for (
int q = 0; q < nq; ++q)
85 const NekDouble expected = kept ? phys[q] : 0.0;
86 diff = std::max(diff, std::abs(back[q] - expected));
88 BOOST_CHECK_MESSAGE(diff < tol,
89 "mode " << mode <<
" of degree " << degree[mode]
90 << (kept ?
" changed by " :
" left ")
91 << diff <<
" with numMin " << numMin);
void CheckReduceOrderCoeffs(const StdRegions::StdExpansionSharedPtr &exp, const StdRegions::StdExpansionSharedPtr &ortho, const std::vector< int > °ree, const int numMin)
Check ReduceOrderCoeffs mode by mode.