/[escript]/trunk/paso/src/Solver_applyBlockDiagonalMatrix.cpp.old
ViewVC logotype

Annotation of /trunk/paso/src/Solver_applyBlockDiagonalMatrix.cpp.old

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4869 - (hide annotations)
Mon Apr 14 10:39:22 2014 UTC (5 years, 6 months ago) by caltinay
File size: 2808 byte(s)
all of paso now lives in its own namespace.

1 ksteube 1312
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 4657 * Copyright (c) 2003-2014 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
7     * Primary Business: Queensland, Australia
8     * Licensed under the Open Software License version 3.0
9     * http://www.opensource.org/licenses/osl-3.0.php
10     *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 * Development 2012-2013 by School of Earth Sciences
13     * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3981 *
15     *****************************************************************************/
16 dhawcroft 631
17 ksteube 1811
18 jfenwick 3981 /************************************************************************************/
19 jgs 150
20 caltinay 3642 /* Paso: apply block diagonal matrix D: x=D*b */
21 jgs 150
22 caltinay 3642 /* should be called within a parallel region */
23     /* barrier synchronization should be performed to make sure */
24     /* that the input vector available */
25 jgs 150
26 jfenwick 3981 /************************************************************************************/
27 jgs 150
28 caltinay 3642 /* Copyrights by ACcESS Australia 2003, 2004, 2005 */
29     /* Author: Lutz Gross, l.gross@uq.edu.au */
30 jgs 150
31 jfenwick 3981 /************************************************************************************/
32 jgs 150
33 gross 700 #include "Paso.h"
34 jgs 150
35 jfenwick 3981 /************************************************************************************/
36 jgs 150
37    
38 caltinay 4869 void Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b) {
39 jgs 150 dim_t i;
40 gross 495 register dim_t i3,i9;
41     register double b0,b1,b2,D00,D10,D20,D01,D11,D21,D02,D12,D22;
42    
43 jgs 150 if (n_block==1) {
44 gross 1556 #pragma omp parallel for private(i) schedule(static)
45 gross 495 for (i=0;i<n;++i) {
46 jgs 150 x[i]=D[i]*b[i];
47     }
48     } else if (n_block==2) {
49 gross 1556 #pragma omp parallel for private(i,b0,b1,D00,D10,D01,D11,i3,i9) schedule(static)
50 gross 495 for (i=0;i<n;++i) {
51     i3=2*i;
52     i9=4*i;
53     b0=b[i3];
54     b1=b[i3+1];
55     D00=D[i9 ];
56     D10=D[i9+1];
57     D01=D[i9+2];
58     D11=D[i9+3];
59     x[i3 ]=D00*b0+D01*b1;
60     x[i3+1]=D10*b0+D11*b1;
61 jgs 150 }
62     } else if (n_block==3) {
63 gross 1556 #pragma omp parallel for private(i,b0,b1,b2,D00,D10,D20,D01,D11,D21,D02,D12,D22,i3,i9) schedule(static)
64 gross 495 for (i=0;i<n;++i) {
65     i3=3*i;
66     i9=9*i;
67     b0=b[i3];
68     b1=b[i3+1];
69     b2=b[i3+2];
70     D00=D[i9 ];
71     D10=D[i9+1];
72     D20=D[i9+2];
73     D01=D[i9+3];
74     D11=D[i9+4];
75     D21=D[i9+5];
76     D02=D[i9+6];
77     D12=D[i9+7];
78     D22=D[i9+8];
79     x[i3 ]=D00*b0+D01*b1+D02*b2;
80     x[i3+1]=D10*b0+D11*b1+D12*b2;
81     x[i3+2]=D20*b0+D21*b1+D22*b2;
82 jgs 150 }
83     }
84     return;
85     }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/amg_from_3530/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3531-3826 /branches/lapack2681/paso/src/Solver_applyBlockDiagonalMatrix.cpp:2682-2741 /branches/pasowrap/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3661-3674 /branches/py3_attempt2/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3871-3891 /branches/restext/paso/src/Solver_applyBlockDiagonalMatrix.cpp:2610-2624 /branches/ripleygmg_from_3668/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3669-3791 /branches/stage3.0/paso/src/Solver_applyBlockDiagonalMatrix.cpp:2569-2590 /branches/symbolic_from_3470/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3517-3974 /release/3.0/paso/src/Solver_applyBlockDiagonalMatrix.cpp:2591-2601 /trunk/paso/src/Solver_applyBlockDiagonalMatrix.cpp:4257-4344 /trunk/ripley/test/python/paso/src/Solver_applyBlockDiagonalMatrix.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26