rsachetto / MonoAlg3D_C

Extensible Monodomain simulator
MIT License
16 stars 13 forks source link

GPU linear_system_solver now working with Purkinje simulations #26

Closed bergolho closed 3 years ago

bergolho commented 3 years ago

Hello Sachetto,

Changes: In this pull request, I included an additional argument in the "grid_to_csr()" function so that the Purkinje domain linear system could be solved using CuBLAS. There is also a new section "purkinje_linear_system_solver" which will only appear in Purkinje coupled simulations. This was necessary in order to run two separate instances of the "linear_system_solver" with different configurations for the Purkinje and tissue. There is a new example "purkinje_with_fibrosis.ini" that tests this new functionality, which is basically the plain mesh with fibrosis domain with a Purkinje as the source of stimulus and coupled inside the fibrotic region. In this example, the tissue domain is solved by the GPU (Diffusion + Reaction), while the Purkinje domain by the CPU (Diffusion + Reaction).

Issues: A minor issue that I noticed in these tests is that we can only use only one instance of the GPU linear system solver in the program. For instance, I could not solve the Purkinje and tissue linear system both on the GPU. I believe the reason is because of some global variables in the "gpu_solvers_cublas" library that cannot be shared with two instances of the solver.

Remove: You can remove my old VTU results in the scripts/error_calculator folder and do not consider the Python script changes, I will keep them locally here.

Please feel free to suggest changes to this new code.

rsachetto commented 3 years ago

Manually merged in commit 8be293b

rsachetto commented 3 years ago

@bergolho In Commit 5e6da34252c5b35899eddcac6b177e3af1dc2103 , we removed the global variables, so now you can use the GPU solver in the mesh and in the Purkinje fibers.