%
% @file pde2d_pardiso.m
%
% @brief
%
% @copyright
% Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
% SPC (Swiss Plasma Center)
%
% spclibs is free software: you can redistribute it and/or modify it under
% the terms of the GNU Lesser General Public License as published by the Free
% Software Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% spclibs is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with this program. If not, see .
%
% @authors
% (in alphabetical order)
% @author Trach-Minh Tran
%
file='pde2d_pardiso.h5';
if verLessThan('matlab', '7.9');
n = hdf5read(file,'/MAT/RANK');
nnz = hdf5read(file,'/MAT/NNZ');
nlsym = hdf5read(file,'/MAT/NLSYM');
else
n = hdf5read(file,'/MAT/', 'RANK');
nnz = hdf5read(file,'/MAT/', 'NNZ');
nlsym = hdf5read(file,'/MAT/', 'NLSYM');
end
cols=hdf5read(file, '/MAT/cols');
irow=hdf5read(file, '/MAT/irow');
val=hdf5read(file, '/MAT/val');
perm=hdf5read(file, '/MAT/perm');
rows = zeros(nnz,1);
cols=double(cols);
irow=double(irow);
perm=double(perm);
for i=1:n
s = irow(i);
e = irow(i+1)-1;
rows(s:e) = i;
end
mat = sparse(rows,cols,val);
figure
subplot(121);
spy(mat(perm,perm));
title('Matrix structure')
subplot(122);
spy(chol(mat(perm,perm)));
title('Factor L^T')