OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
simple_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;
5id.SYM = 0;
6
7% here JOB = -1, the call to MUMPS will initialize C
8% and fortran MUMPS structure
9id = dmumps(id);
10% load a sparse matrix
11load lhr01;
12mat = Problem.A;
13% JOB = 6 means analysis+facto+solve
14
15%prob = UFget(373);
16%mat = prob.A;
17id.JOB = 6;
18%%%%%%% BEGIN OPTIONAL PART TO ILLUSTRATE THE USE OF MAXIMUM TRANSVERSAL
19id.ICNTL(7) = 5;
20id.ICNTL(6) = 1;
21id.ICNTL(8) = 7;
22id.ICNTL(14) = 80;
23% we set the rigth hand side
24id.RHS = ones(size(mat,1),1);
25%call to mumps
26id = dmumps(id,mat);
27% we see that there is a memory problem in INFOG(1) and INFOG(2)
28id.INFOG(1)
29id.INFOG(2)
30% we activate the numerical maximun transversal
31fprintf('total number of nonzeros in factors %d\n', id.INFOG(10));
32
33%%%%%%% END OPTIONAL PART %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34if(norm(mat*id.SOL - ones(size(mat,1),1),'inf') > sqrt(eps))
35 disp('WARNING : precision may not be OK');
36else
37 disp('SOLUTION OK');
38end
39norm(mat*id.SOL - ones(size(mat,1),1),'inf')
40% destroy mumps instance
41SOL = id.SOL;
42id.JOB = -2;
43id = dmumps(id)
!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')
****************************************This help menu gives details about the use of dmumps
Definition mumps_help.m:2
#define JOB
Definition mumpsmex.c:33
n