/[escript]/trunk/esys2/finley/src/finleyC/Solvers/Solver_applyBlockDiagonalMatrix.c
ViewVC logotype

Contents of /trunk/esys2/finley/src/finleyC/Solvers/Solver_applyBlockDiagonalMatrix.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 115 - (show annotations)
Fri Mar 4 07:12:47 2005 UTC (14 years, 1 month ago) by jgs
File MIME type: text/plain
File size: 1703 byte(s)
*** empty log message ***

1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* Finley: apply block diagonal matrix D: x=D*b */
6
7 /* should be called within a parallel region */
8 /* barrier synconization should be performed to make sure that the input vector available */
9
10 /**************************************************************/
11
12 /* Copyrights by ACcESS Australia 2003, 2004, 2005 */
13 /* Author: gross@access.edu.au */
14
15 /**************************************************************/
16
17 #include "Common.h"
18
19 /**************************************************************/
20
21
22 void Finley_Solver_applyBlockDiagonalMatrix(int n_block,int n,double* D,maybelong* pivot,double* x,double* b) {
23 int i;
24 if (n_block==1) {
25 #pragma omp for private(i) schedule(static)
26 for (i=0;i<n;i++) {
27 x[i]=D[i]*b[i];
28 }
29 } else if (n_block==2) {
30 #pragma omp for private(i) schedule(static)
31 for (i=0;i<n;i++) {
32 x[2*i ]=D[4*i ]*b[2*i]+D[4*i+2]*b[2*i+1];
33 x[2*i+1]=D[4*i+1]*b[2*i]+D[4*i+3]*b[2*i+1];
34 }
35 } else if (n_block==3) {
36 #pragma omp for private(i) schedule(static)
37 for (i=0;i<n;i++) {
38 x[3*i ]=D[9*i ]*b[3*i]+D[9*i+3]*b[3*i+1]+D[9*i+6]*b[3*i+2];
39 x[3*i+1]=D[9*i+1]*b[3*i]+D[9*i+4]*b[3*i+1]+D[9*i+7]*b[3*i+2];
40 x[3*i+2]=D[9*i+2]*b[3*i]+D[9*i+5]*b[3*i+1]+D[9*i+8]*b[3*i+2];
41 }
42 }
43 return;
44 }
45
46 /*
47 * $Log$
48 * Revision 1.2 2005/03/04 07:12:47 jgs
49 * *** empty log message ***
50 *
51 * Revision 1.1.2.1 2005/03/04 05:09:46 gross
52 * a missing file from the ILU reimplementation
53 *
54 *
55 */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26