/[escript]/trunk/paso/src/Solvers/Solver_applyBlockDiagonalMatrix.c
ViewVC logotype

Contents of /trunk/paso/src/Solvers/Solver_applyBlockDiagonalMatrix.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (show annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 11 months ago) by jgs
File MIME type: text/plain
File size: 1904 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* Paso: 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 "Paso.h"
18
19 /**************************************************************/
20
21
22 void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b) {
23 dim_t 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/09/15 03:44:40 jgs
49 * Merge of development branch dev-02 back to main trunk on 2005-09-15
50 *
51 * Revision 1.1.2.1 2005/09/05 06:29:50 gross
52 * These files have been extracted from finley to define a stand alone libray for iterative
53 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
54 * has not been tested yet.
55 *
56 *
57 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26