/[escript]/branches/domexper/dudley/src/IndexList.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/IndexList.c

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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
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    
# Line 6  Line 18 
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  /**************************************************************/  /**************************************************************/
# Line 22  Line 31 
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;
# Line 44  void Finley_IndexList_insertElements(Fin Line 54  void Finley_IndexList_insertElements(Fin
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) {
# Line 64  void Finley_IndexList_insertElements(Fin Line 74  void Finley_IndexList_insertElements(Fin
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;
# Line 89  void Finley_IndexList_insertIndex(Finley Line 99  void Finley_IndexList_insertIndex(Finley
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 {
# Line 99  int Finley_IndexList_count(Finley_IndexL Line 109  int Finley_IndexList_count(Finley_IndexL
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]));
# Line 118  void Finley_IndexList_free(Finley_IndexL Line 128  void Finley_IndexList_free(Finley_IndexL
128    
129  /*  /*
130   * $Log$   * $Log$
131     * Revision 1.6  2005/09/15 03:44:22  jgs
132     * Merge of development branch dev-02 back to main trunk on 2005-09-15
133     *
134     * Revision 1.5.2.1  2005/09/07 06:26:18  gross
135     * the solver from finley are put into the standalone package paso now
136     *
137     * Revision 1.5  2005/07/08 04:07:51  jgs
138     * Merge of development branch back to main trunk on 2005-07-08
139     *
140   * Revision 1.4  2004/12/15 07:08:32  jgs   * Revision 1.4  2004/12/15 07:08:32  jgs
141   * *** empty log message ***   * *** 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.1.1.1.2.2  2004/11/24 01:37:13  gross
146     * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
147   *   *
148   *   *
149   *   *

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

  ViewVC Help
Powered by ViewVC 1.1.26