Commit a938036f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Add tests for divergence and partial derivative interpolation

parent 7b42394e
......@@ -92,7 +92,8 @@ void test(HostGrid& hostGrid)
AMDIS_TEST((integrate(v_0 - partialDerivativeOf(u_0,0), gridView)) < 0.05);
AMDIS_TEST((integrate(v_1 - partialDerivativeOf(u_1,1), gridView)) < 0.05);
{
{ // test the gradient interpolation
using namespace Dune::Functions::BasisFactory;
DOFVector U0{gridView, lagrange<p>()};
DOFVector gradU0{gridView, power<HostGrid::dimensionworld>(lagrange<p>())};
......@@ -100,6 +101,25 @@ void test(HostGrid& hostGrid)
valueOf(gradU0) << gradientOf(U0);
[[maybe_unused]] auto integral1 = integrate(valueOf(gradU0,0), gridView);
}
{ // test the divergence interpolation
using namespace Dune::Functions::BasisFactory;
DOFVector divU{gridView, lagrange<p>()};
valueOf(divU) << divergenceOf(uVector);
[[maybe_unused]] auto integral1 = integrate(valueOf(divU), gridView);
}
{ // test the partial derivative interpolation
using namespace Dune::Functions::BasisFactory;
DOFVector U0{gridView, lagrange<p>()};
DOFVector partialU0{gridView, lagrange<p>()};
valueOf(U0) << valueOf(uVector,0);
valueOf(partialU0) << partialDerivativeOf(U0,0);
[[maybe_unused]] auto integral1 = integrate(valueOf(partialU0), gridView);
}
}
int main(int argc, char** argv)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment