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

Add a print_matrix generator helpful for debugging

parent ee199813
No related branches found
No related tags found
No related merge requests found
......@@ -619,6 +619,18 @@ def name_vtkfile():
return "vtkfile"
@preamble
def print_matrix():
t_go = type_gridoperator()
n_go = name_gridoperator()
v = name_vector()
return ["typedef typename {}::Traits::Jacobian M;".format(t_go),
"M m({});".format(n_go),
"{}.jacobian({},m);".format(n_go, v),
"using Dune::PDELab::Backend::native;",
"Dune::printmatrix(std::cout, native(m),\"global stiffness matrix\",\"row\",9,1);"]
@preamble
def vtkoutput():
include_file("dune/pdelab/gridfunctionspace/vtk.hh", filetag="driver")
......@@ -627,5 +639,6 @@ def vtkoutput():
vec = name_vector()
vtkfile = name_vtkfile()
dune_solve()
print_matrix()
return ["Dune::PDELab::addSolutionToVTKWriter({}, {}, {});".format(vtkwriter, gfs, vec),
"{}.write({}, Dune::VTK::appendedraw);".format(vtkwriter, vtkfile)]
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