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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Copyright dates update

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
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 /* Dudley: Converting an element list into a matrix shape */
20
21 /****************************************************************************/
22
23 #include "IndexList.h"
24 #include "ElementFile.h"
25
26 #include <escript/index.h>
27
28 namespace dudley {
29
30 /* Translate from distributed/local array indices to global indices */
31
32 /// 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 {
37 // 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
42 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 }
56 }
57 }
58 }
59 }
60 }
61
62 void IndexList_insertElementsWithRowRangeNoMainDiagonal(IndexList* indexList,
63 index_t firstRow, index_t lastRow,
64 const ElementFile* elements, const index_t* map)
65 {
66 if (!elements)
67 return;
68
69 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 }
83 }
84 }
85 }
86 }
87 }
88 }
89
90 } // 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