linear_system#

class LinearSystem(G, withRBC=0, invivo=0, dMin_empirical=3.5, htdMax_empirical=0.6, verbose=True, **kwargs)[source]#

Bases: object

solve(method, dest_file_path='sampledict.pkl', **kwargs)[source]#

Solves the linear system A x = b for the vector of unknown pressures x, either using a direct solver (obsolete) or an iterative GMRES solver. From the pressures, the flow field is computed.

Parameters:
  • method (str) – This can be either ‘direct’ or ‘iterative2’

  • dest_file_path (str) – The path to save the output file

Returns

None - G is modified in place. G_final.pkl & G_final.vtp: are save as output sampledict.pkl: is saved as output

update()[source]#

Constructs the linear system A x = b where the matrix A contains the conductance information of the vascular graph, the vector b specifies the boundary conditions and the vector x holds the pressures at the vertices (for which the system needs to be solved).

Returns

matrix A and vector b