This library registers the matrixExporter
solver in OpenFOAM. When the solver is invoked, it will export the matrix it is supposed to solve to a file in the Matrix Market format.
- Clone the library to any folder. You may clone it into the
$WM_PROJECT_USER_DIR
folder, but you can use any other folder as well. Dont forget to clone the submodules as well (--recursive
) as the library depends on the fast_matrix_market.
git clone --recursive https://github.com/timnoack/openfoam-matrix-export.git
- Build the library. The shared library is automatically copied into the
$FOAM_USER_LIBBIN
folder.
wmake libso path/to/openfoam-matrix-export
- Load the library to your solver application by specifying it in your
system/controlDict
:
libs ("libMatrixExporter");
- Use the
matrixExporter
solver in yoursystem/fvSolution
file:
solvers
{
T // the name of your field
{
solver matrixExporter;
matrixFile "A.mtx";
sourceFile "b.mtx";
initialFieldFile "x.mtx";
exitAfterExport yes;
comment "Please provide a short description of the testcase and its matrix here.";
}
}
- Run your case as usual. The solver will export the matrix, source vector and initial field to the specified filenames.