Skip to content
Snippets Groups Projects
Commit 1ba68264 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

removed obsolete helper functions

parent 78ab6415
No related branches found
No related tags found
1 merge request!58Add generalized derivative and local-to-global adapter to handle the global derivatives uniformly
...@@ -367,41 +367,6 @@ public: ...@@ -367,41 +367,6 @@ public:
return dy; return dy;
} }
private:
template <class T, class J, class RG>
void test_partial(std::vector<T> const& partial, std::size_t comp, J const& jacobian, RG const& referenceGradients) const
{
for (std::size_t i = 0; i < referenceGradients.size(); ++i) { // J^(-T) * D[phi] -> grad^T
auto grad = jacobian * Dune::MatVec::as_vector(referenceGradients[i]);
auto grad_ = Dune::Functions::flatVectorView(grad);
if (std::abs(grad_[comp] - partial[i]) > 1.e-10) {
print_error(partial[i], comp, grad, jacobian, referenceGradients[i][0]);
error_exit("wrong partial derivatives");
}
}
}
template <class T, class G, class J, class RG>
void print_error(T const& partial_i, std::size_t comp, G const& grad_i, J const& jacobian, RG const& referenceGradient) const
{
msg(__PRETTY_FUNCTION__);
msg("jacobian = {}", jacobian);
auto&& jacobian_mat = Dune::MatVec::as_matrix(jacobian);
msg("jacobian_ = [");
for (std::size_t i = 0; i < jacobian_mat.N(); ++i) {
for (std::size_t j = 0; j < jacobian_mat.M(); ++j) {
msg_("{} ",jacobian_mat[i][j]);
}
msg(";");
}
msg("]");
msg("ref-grad = {}", referenceGradient);
auto grad_ = Dune::Functions::flatVectorView(grad_i);
msg("comp = {}, grad_ = ({}, {}), partial = {}", comp, grad_[0], grad_[1], partial_i);
}
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment