Skip to content
Snippets Groups Projects
Commit 59e0aa9e authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Initialize solution when printing matrix

Otherwise debugging of nonlinear problems becomes hard.
parent 92aba8d7
No related branches found
No related tags found
No related merge requests found
...@@ -229,6 +229,12 @@ def print_matrix(): ...@@ -229,6 +229,12 @@ def print_matrix():
t_v = type_vector(formdata) t_v = type_vector(formdata)
return ["if ({}.get<bool>(\"printmatrix\", false)) {{".format(ini), return ["if ({}.get<bool>(\"printmatrix\", false)) {{".format(ini),
" // Setup random input",
" std::size_t seed = 0;",
" auto rng = std::mt19937_64(seed);",
" auto dist = std::uniform_real_distribution<>(1., 10.);",
" for (auto& v : {})".format(v),
" v = dist(rng);",
" using M = typename {}::Traits::Jacobian;".format(t_go), " using M = typename {}::Traits::Jacobian;".format(t_go),
" M m({});".format(n_go), " M m({});".format(n_go),
" {}.jacobian({},m);".format(n_go, v), " {}.jacobian({},m);".format(n_go, v),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment