OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
zsimple_example.m
Go to the documentation of this file.
1% Simple example of using MUMPS in matlab
2
3% initialization of a matlab MUMPS structure
4id = initmumps;
5% here JOB = -1, the call to MUMPS will initialize C
6% and fortran MUMPS structure
7id = zmumps(id);
8% load a sparse matrix
9load lhr01;
10mat = Problem.A;
11n = size(mat,1);
12mat = mat + sparse(1:n,1:n,i*ones(n,1));
13% JOB = 6 means analysis+facto+solve
14id.JOB = 6;
15id.ICNTL(6) = 0;
16% we set the right hand side
17id.RHS = ones(size(mat,1),1);
18%call to mumps
19id = zmumps(id,mat);
20% we see that there is a memory problem in INFOG(1) and INFOG(2)
21id.INFOG(1)
22id.INFOG(2)
23% we activate the numerical maximun transversal
24id.ICNTL(6) = 6;
25id = zmumps(id,mat);
26if(norm(mat*id.SOL - ones(size(mat,1),1),'inf') > sqrt(eps))
27 disp('WARNING : precision may not be OK');
28else
29 disp('SOLUTION OK');
30end
31norm(mat*id.SOL - ones(size(mat,1),1),'inf')
32% destroy mumps instance
33id.JOB = -2;
34id = zmumps(id)
35
#define ICNTL(I)
!This file is part of MUMPS
Definition cmumps_root.h:2
if(complex_arithmetic) id
end load lhr01
end diagonal values have been computed in the(sparse) matrix id.SOL
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
end[inform, rinform, sol, inst, schur, redrhs, pivnul_list, sym_perm, uns_perm, icntl, cntl, colsca_out, rowsca_out, keep_out, dkeep_out]
Definition dmumps.m:40
id INFOG
Definition dmumps.m:41
id SOL
Definition dmumps.m:43
initmumps id
if(norm(mat *id.SOL - id.RHS, 'inf') > sqrt(eps)) disp('WARNING els disp)('SOLUTION OK')
#define JOB
Definition mumpsmex.c:33
n
subroutine zmumps(id)