Skip to content
Snippets Groups Projects
Commit 7d6bd51d authored by René Fritze's avatar René Fritze
Browse files

Merge branch 'master' of gdune:projects/dune-stuff

parents 0c390d42 e99ad9a4
No related branches found
No related tags found
No related merge requests found
......@@ -256,18 +256,6 @@ void printFunctionMinMax(Stream& stream, const Function& func)
<< " max: " << std::sqrt(2.0) * max << std::endl;
}
//! proxy to Stuff::matrixToGnuplotStream that redirects its output to a file
template <class Matrix>
void matrixToGnuplotFile(const Matrix& matrix, std::string filename)
{
std::string dir(Parameters().getParam("fem.io.datadir", std::string("data")) + "/gnuplot/");
testCreateDirectory(dir);
std::ofstream file((dir + filename).c_str());
matrixToGnuplotStream(matrix, file);
file.flush();
file.close();
}
//! useful for visualizing sparsity patterns of matrices
template <class Matrix, class Stream>
void matrixToGnuplotStream(const Matrix& matrix, Stream& stream)
......@@ -284,6 +272,18 @@ void matrixToGnuplotStream(const Matrix& matrix, Stream& stream)
stream << "#total non zeros " << nz << " of " << matrix.rows() * matrix.cols() << " entries\n";
}
//! proxy to Stuff::matrixToGnuplotStream that redirects its output to a file
template <class Matrix>
void matrixToGnuplotFile(const Matrix& matrix, std::string filename)
{
std::string dir(Parameters().getParam("fem.io.datadir", std::string("data")) + "/gnuplot/");
testCreateDirectory(dir);
std::ofstream file((dir + filename).c_str());
matrixToGnuplotStream(matrix, file);
file.flush();
file.close();
}
} // end namespace
#endif
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