File: sparseRHS_example.sce

package info (click to toggle)
mumps 5.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,624 kB
  • sloc: fortran: 455,982; ansic: 14,533; makefile: 684; xml: 527; f90: 181; sh: 130
file content (39 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//A simple demo for the MUMPS interface, with the use of a sparse Right Hand Side 
//to run it, You just have to execute  the instruction within Scilab
//		exec sparse_example.sce; 


//*********************** MATRIX INITIALISATION ***********************//
// This matrix has to be a SciSparse, otherwise it won't work.
	exec('ex.sci');
	//voir pour les speyes
	mat=sparse(a);

// Right Hand side setting
	exec('ex_rhs.sci'); 
	RHS = sparse(rhs);
	
//****************** Initialisation of the Scilab MUMPS structure ******************//
timer();
[id]=initmumps();

//Here Job=-1, the next call will only initialise the C and Fortran structure
[id]=dmumps(id);
id.RHS=RHS;

//******************** CALL TO MUMPS FOR RESOLUTION ********************//
job=6;
id.JOB=job;

[id]=dmumps(id,mat);

// verification of the solution
solution=id.SOL;
norm_res=norm(mat*solution-RHS,'inf');
write(%io(2),norm_res);

//****************** DESTRUCTION OF THE MUMPS INSTANCE ******************//
job=-2;
id.JOB=job;
[id]=dmumps(id);
t=timer()