0

Do I get the linear system from caching the Matrix and RHS and running solve/sweep for 1 iteration? Also, is it possible to manually set the Matrix being utilised?

Thanks

Markiv
  • 1

1 Answers1

0

If all you want is the matrix and RHS, you can call Term._prepareLinearSystem() on your equation.

While it is possible to build your own matrix with SparseMatrix.put() and SparseMatrix.addAt(), FiPy's not really intended to work that way. If all you want to do is build and solve your own linear systems, you're better off using the underlying solver libraries directly.

jeguyer
  • 2,379
  • 1
  • 11
  • 15
  • Thank you for your reply. I have a hyperbolic system with stiff source terms and I added a linear implicit source term to the equations. The reason I asked the question of putting the matrix back in is because I still have a problem with solving the linear system and wanted to use regularization on the A matrix to try and resolve the issue. – Markiv Jul 06 '22 at 06:21
  • You'll probably want to supply a preconditioner to the `Solver`. Each solver suite handles preconditioning differently, so it's hard to offer general advice. – jeguyer Jul 06 '22 at 13:36