Skip to content

Commit

Permalink
TrilinosCouplings: Adding coordinate dump option to Tpetra Poisson ex…
Browse files Browse the repository at this point in the history
…ample
  • Loading branch information
csiefer2 committed Apr 1, 2020
1 parent d909d97 commit cba550d
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ main (int argc, char *argv[])
cmdp.setOption ("matrixFilename", &matrixFilename, "If nonempty, dump the "
"generated matrix to that file in MatrixMarket format.");

// If coordsFilename is nonempty, dump the coords to that file
// in MatrixMarket format.
std::string coordsFilename;
cmdp.setOption ("coordsFilename", &coordsFilename, "If nonempty, dump the "
"generated coordinates to that file in MatrixMarket format.");

// If rowMapFilename is nonempty, dump the matrix's row Map to
// that file in MatrixMarket format.
std::string rowMapFilename;
Expand All @@ -191,8 +197,8 @@ main (int argc, char *argv[])
bool exitAfterAssembly = false;
cmdp.setOption ("exitAfterAssembly", "dontExitAfterAssembly",
&exitAfterAssembly, "If true, exit after building the "
"sparse matrix and dense right-hand side vector. If either"
" --matrixFilename or --rowMapFilename are nonempty strings"
"sparse matrix and dense right-hand side vector. If "
" --matrixFilename --coordsFilename or --rowMapFilename are nonempty strings"
", dump the matrix resp. row Map to their respective files "
"before exiting.");

Expand All @@ -202,9 +208,7 @@ main (int argc, char *argv[])
&exitAfterPrecond, "If true, exit after building the "
"preconditioner.");


// If matrixFilename is nonempty, dump the matrix to that file
// in MatrixMarket format.
// Number of rebuilds of the MueLu hierarchy
int numMueluRebuilds=0;
cmdp.setOption ("rebuild", &numMueluRebuilds, "Number of times to rebuild the MueLu hierarchy.");

Expand Down Expand Up @@ -280,6 +284,9 @@ main (int argc, char *argv[])
if (matrixFilename != "") {
writer_type::writeSparseFile (matrixFilename, A);
}
if (coordsFilename != "") {
writer_type::writeDenseFile (coordsFilename, coords);
}
if (rowMapFilename != "") {
writer_type::writeMapFile (rowMapFilename, * (A->getRowMap ()));
}
Expand Down

0 comments on commit cba550d

Please sign in to comment.