Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 - Printable Version +- MYSTRAN Forum (https://www.mystran.com/forums) +-- Forum: MYSTRAN (https://www.mystran.com/forums/forumdisplay.php?fid=4) +--- Forum: MYSTRAN (https://www.mystran.com/forums/forumdisplay.php?fid=5) +--- Thread: Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 (/showthread.php?tid=54) |
Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 - ceanwang - 10-14-2020 Hi, Trying to use SuperLU sparse solver which is from https://github.com/xiaoyeli/superlu First: Inputs for SuperLU are: Code: !NROW=n=400 Second: Output for SuperLU is b(i), i=1,n after solving. Need to map this b(i) to what MYSTRAN is called. Help is appreciated. Cheers Cean The code is like this: Existing Banded: Code: IF (SOLLIB == 'BANDED ') THEN ! Use LAPACK Newly added Sparse: Code: ELSE IF (SOLLIB == 'SPARSE ') THEN Here is SuperLU's test data g20.rua https://github.com/xiaoyeli/superlu/blob/master/EXAMPLE/g20.rua It has 400 rows, 400 columns and 1920 none zero values. The data is arrange as COLPTR, ROWIND and VALUES. RE: Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 - Admin - 10-26-2020 Cean, Is there a reason you are looking into SuplerLU? Perhaps because it is native Fortran? PaStiX looks to be a great option, but it is coded in C. CalculiX (coded in Fortran) uses PaStiX so there is a way to incorporate it. Here are some papers about solvers. The 2017 paper discusses SuperLU and I made a screenshot of some notable comments. I also contacted Bill and he is going to look into it. https://www.mystran.com/docs/Solver_Papers.zip RE: Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 - ceanwang - 10-27-2020 Yes, just want to try a easy build case. There could setup a sparse solver switch, like: If SparseSolver = 'SuperLU' then ... else If SparseSolver = 'PaStiX' then ... else print 'Not supported yet' endif RE: Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 - Admin - 10-28-2020 Sure, that is a good idea. Have you seen this document? It might help. https://mystran.com/notes/Sparse_Solver_Notes.pdf RE: Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90 - ceanwang - 10-28-2020 (10-28-2020, 04:07 AM)Admin Wrote: Sure, that is a good idea. Have you seen this document? It might help. I am following it. |