OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sparserhs_example.m
Go to the documentation of this file.
1%Example of using MUMPS in matlab with sparse right hansd side
2
3% initialization of a matlab MUMPS structure
4id = initmumps;
5id = dmumps(id);
6load lhr01;
7mat = Problem.A;
8% JOB = 6 means analysis+facto+solve
9id.JOB = 6;
10% we set the rigth hand side
11id.RHS = ones(size(mat,1),2);
12id.RHS(:,2) = 2*id.RHS(:,2);
13id.RHS = sparse(id.RHS);
14%call to mumps
15id = dmumps(id,mat);
16if(norm(mat*id.SOL - id.RHS,'inf') > sqrt(eps))
17 disp('WARNING : precision may not be OK');
18else
19 disp('SOLUTION OK');
20end
21norm(mat*id.SOL - id.RHS,'inf')
22% solution OK
23% destroy mumps instance
24id.JOB = -2;
25id = dmumps(id)
26
27
28
!This file is part of MUMPS
Definition cmumps_root.h:2
end load lhr01
end diagonal values have been computed in the(sparse) matrix id.SOL
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 SOL
Definition dmumps.m:43
initmumps id
we set the rigth hand side id RHS
****************************************This help menu gives details about the use of dmumps
Definition mumps_help.m:2
#define JOB
Definition mumpsmex.c:33
end norm(mat *id.SOL - id.RHS, 'inf') % solution OK % destroy mumps instance id.JOB
if(norm(mat *id.SOL - id.RHS, 'inf') > sqrt(eps)) disp('WARNING els disp)('SOLUTION OK')