1 |
/* $Id$ */ |
/* |
2 |
|
****************************************************************************** |
3 |
|
* * |
4 |
|
* COPYRIGHT ACcESS 2003,2004,2005 - All Rights Reserved * |
5 |
|
* * |
6 |
|
* This software is the property of ACcESS. No part of this code * |
7 |
|
* may be copied in any form or by any means without the expressed written * |
8 |
|
* consent of ACcESS. Copying, use or modification of this software * |
9 |
|
* by any unauthorised person is illegal unless that person has a software * |
10 |
|
* license agreement with ACcESS. * |
11 |
|
* * |
12 |
|
****************************************************************************** |
13 |
|
*/ |
14 |
|
|
15 |
/**************************************************************/ |
/**************************************************************/ |
16 |
|
|
18 |
|
|
19 |
/**************************************************************/ |
/**************************************************************/ |
20 |
|
|
21 |
/* Copyrights by ACcESS Australia 2003,2004 */ |
/* Author: gross@access.edu.au */ |
22 |
/* Author: gross@access.edu.au */ |
/* Version: $Id$ */ |
23 |
|
|
24 |
/**************************************************************/ |
/**************************************************************/ |
25 |
|
|
|
#include "Finley.h" |
|
|
#include "ElementFile.h" |
|
|
#include "System.h" |
|
26 |
#include "IndexList.h" |
#include "IndexList.h" |
27 |
|
|
28 |
/**************************************************************/ |
/**************************************************************/ |
31 |
triangle of the matrix is stored. */ |
triangle of the matrix is stored. */ |
32 |
|
|
33 |
void Finley_IndexList_insertElements(Finley_IndexList* index_list, Finley_ElementFile* elements, |
void Finley_IndexList_insertElements(Finley_IndexList* index_list, Finley_ElementFile* elements, |
34 |
int reduce_row_order, maybelong* row_Label, |
bool_t reduce_row_order, index_t* row_Label, |
35 |
int reduce_col_order, maybelong* col_Label) { |
bool_t reduce_col_order, index_t* col_Label) { |
36 |
maybelong e,kr,kc,NN_row,NN_col,i,icol,irow,color; |
index_t color; |
37 |
|
dim_t e,kr,kc,NN_row,NN_col,i,icol,irow; |
38 |
|
|
39 |
if (elements!=NULL) { |
if (elements!=NULL) { |
40 |
maybelong NN=elements->ReferenceElement->Type->numNodes; |
dim_t NN=elements->ReferenceElement->Type->numNodes; |
41 |
maybelong id[NN],*row_node,*col_node; |
index_t id[NN],*row_node,*col_node; |
42 |
for (i=0;i<NN;i++) id[i]=i; |
for (i=0;i<NN;i++) id[i]=i; |
43 |
if (reduce_col_order) { |
if (reduce_col_order) { |
44 |
col_node=elements->ReferenceElement->Type->linearNodes; |
col_node=elements->ReferenceElement->Type->linearNodes; |
54 |
row_node=id; |
row_node=id; |
55 |
NN_row=elements->ReferenceElement->Type->numNodes; |
NN_row=elements->ReferenceElement->Type->numNodes; |
56 |
} |
} |
57 |
for (color=0;color<elements->numColors;color++) { |
for (color=elements->minColor;color<=elements->maxColor;color++) { |
58 |
#pragma omp for private(e,irow,kr,kc,icol) schedule(static) |
#pragma omp for private(e,irow,kr,kc,icol) schedule(static) |
59 |
for (e=0;e<elements->numElements;e++) { |
for (e=0;e<elements->numElements;e++) { |
60 |
if (elements->Color[e]==color) { |
if (elements->Color[e]==color) { |
74 |
|
|
75 |
/* inserts row index row into the Finley_IndexList in if it does not exist */ |
/* inserts row index row into the Finley_IndexList in if it does not exist */ |
76 |
|
|
77 |
void Finley_IndexList_insertIndex(Finley_IndexList* in, maybelong index) { |
void Finley_IndexList_insertIndex(Finley_IndexList* in, index_t index) { |
78 |
int i; |
dim_t i; |
79 |
/* is index in in? */ |
/* is index in in? */ |
80 |
for (i=0;i<in->n;i++) { |
for (i=0;i<in->n;i++) { |
81 |
if (in->index[i]==index) return; |
if (in->index[i]==index) return; |
99 |
|
|
100 |
/* counts the number of row indices in the Finley_IndexList in */ |
/* counts the number of row indices in the Finley_IndexList in */ |
101 |
|
|
102 |
int Finley_IndexList_count(Finley_IndexList* in) { |
dim_t Finley_IndexList_count(Finley_IndexList* in) { |
103 |
if (in==NULL) { |
if (in==NULL) { |
104 |
return 0; |
return 0; |
105 |
} else { |
} else { |
109 |
|
|
110 |
/* count the number of row indices in the Finley_IndexList in */ |
/* count the number of row indices in the Finley_IndexList in */ |
111 |
|
|
112 |
void Finley_IndexList_toArray(Finley_IndexList* in, maybelong* array) { |
void Finley_IndexList_toArray(Finley_IndexList* in, index_t* array) { |
113 |
int i; |
dim_t i; |
114 |
if (in!=NULL) { |
if (in!=NULL) { |
115 |
for (i=0;i<in->n;i++) array[i]=in->index[i]+INDEX_OFFSET; |
for (i=0;i<in->n;i++) array[i]=in->index[i]+INDEX_OFFSET; |
116 |
Finley_IndexList_toArray(in->extension,&(array[in->n])); |
Finley_IndexList_toArray(in->extension,&(array[in->n])); |
128 |
|
|
129 |
/* |
/* |
130 |
* $Log$ |
* $Log$ |
131 |
* Revision 1.2 2004/12/14 05:39:30 jgs |
* Revision 1.6 2005/09/15 03:44:22 jgs |
132 |
* *** empty log message *** |
* Merge of development branch dev-02 back to main trunk on 2005-09-15 |
|
* |
|
|
* Revision 1.1.1.1.2.2 2004/11/24 01:37:13 gross |
|
|
* some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now |
|
133 |
* |
* |
134 |
* Revision 1.1.1.1.2.1 2004/11/12 06:58:18 gross |
* Revision 1.5.2.1 2005/09/07 06:26:18 gross |
135 |
* a lot of changes to get the linearPDE class running: most important change is that there is no matrix format exposed to the user anymore. the format is chosen by the Domain according to the solver and symmetry |
* the solver from finley are put into the standalone package paso now |
136 |
* |
* |
137 |
* Revision 1.1.1.1 2004/10/26 06:53:57 jgs |
* Revision 1.5 2005/07/08 04:07:51 jgs |
138 |
* initial import of project esys2 |
* Merge of development branch back to main trunk on 2005-07-08 |
139 |
* |
* |
140 |
* Revision 1.1.2.2 2004/10/26 06:36:39 jgs |
* Revision 1.4 2004/12/15 07:08:32 jgs |
141 |
* committing Lutz's changes to branch jgs |
* *** empty log message *** |
142 |
|
* Revision 1.1.1.1.2.3 2005/06/29 02:34:50 gross |
143 |
|
* some changes towards 64 integers in finley |
144 |
* |
* |
145 |
* Revision 1.2 2004/10/13 01:53:42 gross |
* Revision 1.1.1.1.2.2 2004/11/24 01:37:13 gross |
146 |
* bug in CSC assembling fixed |
* some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now |
147 |
* |
* |
|
* Revision 1.1 2004/07/02 04:21:13 gross |
|
|
* Finley C code has been included |
|
148 |
* |
* |
149 |
* |
* |
150 |
*/ |
*/ |