/[escript]/branches/trilinos_from_5897/dudley/src/IndexList.cpp
ViewVC logotype

Contents of /branches/trilinos_from_5897/dudley/src/IndexList.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6079 - (show annotations)
Mon Mar 21 12:22:38 2016 UTC (2 years, 11 months ago) by caltinay
File size: 3284 byte(s)
Big commit - making dudley much more like finley to make it more
managable. Fixed quite a few issues that had been fixed in finley.
Disposed of all ReducedNode/ReducedDOF entities that dudley never supported.
Compiles and passes tests.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The 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 /* Dudley: Converting an element list into a matrix shape */
20
21 /****************************************************************************/
22
23 #include "IndexList.h"
24 #include "ElementFile.h"
25
26 namespace dudley {
27
28 /* Translate from distributed/local array indices to global indices */
29
30 /// inserts the contributions from the element matrices of elements
31 /// into the row index col.
32 void IndexList_insertElements(IndexList* index_list,
33 const ElementFile* elements, const index_t* map)
34 {
35 // index_list is an array of linked lists. Each entry is a row (DOF) and
36 // contains the indices to the non-zero columns
37 if (!elements)
38 return;
39
40 const int NN = elements->numNodes;
41 // number of element nodes for both column and row
42 const int NN_rowcol = elements->numShapes;
43
44 for (index_t color = elements->minColor; color <= elements->maxColor; color++) {
45 #pragma omp for
46 for (index_t e = 0; e < elements->numElements; e++) {
47 if (elements->Color[e] == color) {
48 for (int kr = 0; kr < NN_rowcol; kr++) {
49 const index_t irow = map[elements->Nodes[INDEX2(kr, e, NN)]];
50 for (int kc = 0; kc < NN_rowcol; kc++) {
51 const index_t icol = map[elements->Nodes[INDEX2(kc, e, NN)]];
52 index_list[irow].insertIndex(icol);
53 }
54 }
55 }
56 }
57 }
58 }
59
60 void IndexList_insertElementsWithRowRangeNoMainDiagonal(IndexList* indexList,
61 index_t firstRow, index_t lastRow,
62 const ElementFile* elements, const index_t* map)
63 {
64 if (!elements)
65 return;
66
67 const int NN = elements->numNodes;
68 for (index_t color = elements->minColor; color <= elements->maxColor; color++) {
69 #pragma omp for
70 for (index_t e = 0; e < elements->numElements; e++) {
71 if (elements->Color[e] == color) {
72 for (int kr = 0; kr < NN; kr++) {
73 const index_t irow = map[elements->Nodes[INDEX2(kr, e, NN)]];
74 if (firstRow <= irow && irow < lastRow) {
75 const index_t irow_loc = irow - firstRow;
76 for (int kc = 0; kc < NN; kc++) {
77 const index_t icol = map[elements->Nodes[INDEX2(kc, e, NN)]];
78 if (icol != irow)
79 indexList[irow_loc].insertIndex(icol);
80 }
81 }
82 }
83 }
84 }
85 }
86 }
87
88 } // namespace dudley
89

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 /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,5898-6007 /trunk/ripley/test/python/dudley/src/IndexList.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26