/[escript]/trunk/dudley/src/IndexList.cpp
ViewVC logotype

Annotation of /trunk/dudley/src/IndexList.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6651 - (hide annotations)
Wed Feb 7 02:12:08 2018 UTC (20 months, 2 weeks ago) by jfenwick
File size: 3302 byte(s)
Make everyone sad by touching all the files

Copyright dates update

1 jgs 82
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 6651 * Copyright (c) 2003-2018 by The University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
7     * Primary Business: Queensland, Australia
8 jfenwick 6112 * Licensed under the Apache License, version 2.0
9     * http://www.apache.org/licenses/LICENSE-2.0
10 ksteube 1811 *
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 jgs 82
17 caltinay 5996 /****************************************************************************/
18 jgs 82
19 jfenwick 3086 /* Dudley: Converting an element list into a matrix shape */
20 jgs 82
21 caltinay 5996 /****************************************************************************/
22 jgs 82
23     #include "IndexList.h"
24 caltinay 6119 #include "ElementFile.h"
25 jgs 82
26 caltinay 6197 #include <escript/index.h>
27    
28 caltinay 5996 namespace dudley {
29    
30 ksteube 1312 /* Translate from distributed/local array indices to global indices */
31    
32 caltinay 6119 /// inserts the contributions from the element matrices of elements
33     /// into the row index col.
34     void IndexList_insertElements(IndexList* index_list,
35     const ElementFile* elements, const index_t* map)
36 jfenwick 3141 {
37 caltinay 6119 // index_list is an array of linked lists. Each entry is a row (DOF) and
38     // contains the indices to the non-zero columns
39     if (!elements)
40     return;
41 gross 2748
42 caltinay 6119 const int NN = elements->numNodes;
43     // number of element nodes for both column and row
44     const int NN_rowcol = elements->numShapes;
45    
46     for (index_t color = elements->minColor; color <= elements->maxColor; color++) {
47     #pragma omp for
48     for (index_t e = 0; e < elements->numElements; e++) {
49     if (elements->Color[e] == color) {
50     for (int kr = 0; kr < NN_rowcol; kr++) {
51     const index_t irow = map[elements->Nodes[INDEX2(kr, e, NN)]];
52     for (int kc = 0; kc < NN_rowcol; kc++) {
53     const index_t icol = map[elements->Nodes[INDEX2(kc, e, NN)]];
54     index_list[irow].insertIndex(icol);
55 caltinay 5996 }
56     }
57 caltinay 4809 }
58     }
59 jfenwick 3224 }
60 jgs 82 }
61    
62 caltinay 6119 void IndexList_insertElementsWithRowRangeNoMainDiagonal(IndexList* indexList,
63     index_t firstRow, index_t lastRow,
64     const ElementFile* elements, const index_t* map)
65 ksteube 1312 {
66 caltinay 6119 if (!elements)
67     return;
68 jfenwick 3224
69 caltinay 6119 const int NN = elements->numNodes;
70     for (index_t color = elements->minColor; color <= elements->maxColor; color++) {
71     #pragma omp for
72     for (index_t e = 0; e < elements->numElements; e++) {
73     if (elements->Color[e] == color) {
74     for (int kr = 0; kr < NN; kr++) {
75     const index_t irow = map[elements->Nodes[INDEX2(kr, e, NN)]];
76     if (firstRow <= irow && irow < lastRow) {
77     const index_t irow_loc = irow - firstRow;
78     for (int kc = 0; kc < NN; kc++) {
79     const index_t icol = map[elements->Nodes[INDEX2(kc, e, NN)]];
80     if (icol != irow)
81     indexList[irow_loc].insertIndex(icol);
82 caltinay 5996 }
83     }
84 caltinay 4809 }
85     }
86     }
87 gross 1722 }
88 jgs 82 }
89    
90 caltinay 5996 } // namespace dudley
91    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/4.0fordebian/dudley/src/IndexList.cpp:5567-5588 /branches/diaplayground/dudley/src/IndexList.cpp:4940-5147 /branches/lapack2681/finley/src/IndexList.cpp:2682-2741 /branches/pasowrap/dudley/src/IndexList.cpp:3661-3674 /branches/py3_attempt2/dudley/src/IndexList.cpp:3871-3891 /branches/restext/finley/src/IndexList.cpp:2610-2624 /branches/ripleygmg_from_3668/dudley/src/IndexList.cpp:3669-3791 /branches/stage3.0/finley/src/IndexList.cpp:2569-2590 /branches/symbolic_from_3470/dudley/src/IndexList.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/IndexList.cpp:3517-3974 /branches/trilinos_from_5897/dudley/src/IndexList.cpp:5898-6118 /release/3.0/finley/src/IndexList.cpp:2591-2601 /release/4.0/dudley/src/IndexList.cpp:5380-5406 /trunk/dudley/src/IndexList.cpp:4257-4344 /trunk/ripley/test/python/dudley/src/IndexList.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26