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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
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 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /************************************************************************************/
19
20 /* Paso: apply block diagonal matrix D: x=D*b */
21
22 /* should be called within a parallel region */
23 /* barrier synchronization should be performed to make sure */
24 /* that the input vector available */
25
26 /************************************************************************************/
27
28 /* Copyrights by ACcESS Australia 2003, 2004, 2005 */
29 /* Author: Lutz Gross, l.gross@uq.edu.au */
30
31 /************************************************************************************/
32
33 #include "Paso.h"
34
35 /************************************************************************************/
36
37
38 void Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b) {
39 dim_t i;
40 register dim_t i3,i9;
41 register double b0,b1,b2,D00,D10,D20,D01,D11,D21,D02,D12,D22;
42
43 if (n_block==1) {
44 #pragma omp parallel for private(i) schedule(static)
45 for (i=0;i<n;++i) {
46 x[i]=D[i]*b[i];
47 }
48 } else if (n_block==2) {
49 #pragma omp parallel for private(i,b0,b1,D00,D10,D01,D11,i3,i9) schedule(static)
50 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 }
62 } else if (n_block==3) {
63 #pragma omp parallel for private(i,b0,b1,b2,D00,D10,D20,D01,D11,D21,D02,D12,D22,i3,i9) schedule(static)
64 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 }
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