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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/finley/src/finleyC/IndexList.c revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC trunk/finley/src/IndexList.c revision 971 by ksteube, Wed Feb 14 04:40:49 2007 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
2     ************************************************************
3     *          Copyright 2006 by ACcESS MNRF                   *
4     *                                                          *
5     *              http://www.access.edu.au                    *
6     *       Primary Business: Queensland, Australia            *
7     *  Licensed under the Open Software License version 3.0    *
8     *     http://www.opensource.org/licenses/osl-3.0.php       *
9     *                                                          *
10     ************************************************************
11    */
12    
13  /**************************************************************/  /**************************************************************/
14    
# Line 6  Line 16 
16    
17  /**************************************************************/  /**************************************************************/
18    
19  /* Copyrights by ACcESS Australia 2003,2004 */  /*  Author: gross@access.edu.au */
20  /* Author: gross@access.edu.au */  /*  Version: $Id$ */
21    
22  /**************************************************************/  /**************************************************************/
23    
 #include "Finley.h"  
 #include "ElementFile.h"  
 #include "System.h"  
24  #include "IndexList.h"  #include "IndexList.h"
25    
26  /**************************************************************/  /**************************************************************/
# Line 22  Line 29 
29     triangle of the matrix is stored. */     triangle of the matrix is stored. */
30    
31  void Finley_IndexList_insertElements(Finley_IndexList* index_list, Finley_ElementFile* elements,  void Finley_IndexList_insertElements(Finley_IndexList* index_list, Finley_ElementFile* elements,
32                                         int reduce_row_order, maybelong* row_Label,                                         bool_t reduce_row_order, index_t* row_Label,
33                                         int reduce_col_order, maybelong* col_Label) {                                         bool_t reduce_col_order, index_t* col_Label) {
34    maybelong e,kr,kc,NN_row,NN_col,i,icol,irow,color;    index_t color;
35      dim_t e,kr,kc,NN_row,NN_col,i,icol,irow;
36    
37    if (elements!=NULL) {    if (elements!=NULL) {
38      maybelong NN=elements->ReferenceElement->Type->numNodes;      dim_t NN=elements->ReferenceElement->Type->numNodes;
39      maybelong id[NN],*row_node,*col_node;      index_t id[NN],*row_node,*col_node;
40      for (i=0;i<NN;i++) id[i]=i;      for (i=0;i<NN;i++) id[i]=i;
41      if (reduce_col_order) {      if (reduce_col_order) {
42         col_node=elements->ReferenceElement->Type->linearNodes;         col_node=elements->ReferenceElement->Type->linearNodes;
# Line 44  void Finley_IndexList_insertElements(Fin Line 52  void Finley_IndexList_insertElements(Fin
52         row_node=id;         row_node=id;
53         NN_row=elements->ReferenceElement->Type->numNodes;         NN_row=elements->ReferenceElement->Type->numNodes;
54      }      }
55      for (color=0;color<elements->numColors;color++) {      for (color=elements->minColor;color<=elements->maxColor;color++) {
56          #pragma omp for private(e,irow,kr,kc,icol) schedule(static)          #pragma omp for private(e,irow,kr,kc,icol) schedule(static)
57          for (e=0;e<elements->numElements;e++) {          for (e=0;e<elements->numElements;e++) {
58              if (elements->Color[e]==color) {              if (elements->Color[e]==color) {
# Line 64  void Finley_IndexList_insertElements(Fin Line 72  void Finley_IndexList_insertElements(Fin
72    
73  /* 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 */
74    
75  void Finley_IndexList_insertIndex(Finley_IndexList* in, maybelong index) {  void Finley_IndexList_insertIndex(Finley_IndexList* in, index_t index) {
76    int i;    dim_t i;
77    /* is index in in? */    /* is index in in? */
78    for (i=0;i<in->n;i++) {    for (i=0;i<in->n;i++) {
79      if (in->index[i]==index)  return;      if (in->index[i]==index)  return;
# Line 89  void Finley_IndexList_insertIndex(Finley Line 97  void Finley_IndexList_insertIndex(Finley
97    
98  /* counts the number of row indices in the Finley_IndexList in */  /* counts the number of row indices in the Finley_IndexList in */
99    
100  int Finley_IndexList_count(Finley_IndexList* in) {  dim_t Finley_IndexList_count(Finley_IndexList* in) {
101    if (in==NULL) {    if (in==NULL) {
102       return 0;       return 0;
103    } else {    } else {
# Line 99  int Finley_IndexList_count(Finley_IndexL Line 107  int Finley_IndexList_count(Finley_IndexL
107    
108  /* count the number of row indices in the Finley_IndexList in */  /* count the number of row indices in the Finley_IndexList in */
109    
110  void Finley_IndexList_toArray(Finley_IndexList* in, maybelong* array) {  void Finley_IndexList_toArray(Finley_IndexList* in, index_t* array) {
111    int i;    dim_t i;
112    if (in!=NULL) {    if (in!=NULL) {
113      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];
114      Finley_IndexList_toArray(in->extension,&(array[in->n]));      Finley_IndexList_toArray(in->extension,&(array[in->n]));
115    }    }
116  }  }
# Line 118  void Finley_IndexList_free(Finley_IndexL Line 126  void Finley_IndexList_free(Finley_IndexL
126    
127  /*  /*
128   * $Log$   * $Log$
129     * Revision 1.6  2005/09/15 03:44:22  jgs
130     * Merge of development branch dev-02 back to main trunk on 2005-09-15
131     *
132     * Revision 1.5.2.1  2005/09/07 06:26:18  gross
133     * the solver from finley are put into the standalone package paso now
134     *
135     * Revision 1.5  2005/07/08 04:07:51  jgs
136     * Merge of development branch back to main trunk on 2005-07-08
137     *
138   * Revision 1.4  2004/12/15 07:08:32  jgs   * Revision 1.4  2004/12/15 07:08:32  jgs
139   * *** empty log message ***   * *** empty log message ***
140     * Revision 1.1.1.1.2.3  2005/06/29 02:34:50  gross
141     * some changes towards 64 integers in finley
142     *
143     * Revision 1.1.1.1.2.2  2004/11/24 01:37:13  gross
144     * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
145   *   *
146   *   *
147   *   *

Legend:
Removed from v.102  
changed lines
  Added in v.971

  ViewVC Help
Powered by ViewVC 1.1.26