/[escript]/trunk/finley/src/Mesh_getPattern.c
ViewVC logotype

Diff of /trunk/finley/src/Mesh_getPattern.c

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

trunk/esys2/finley/src/finleyC/Mesh_getPattern.c revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC trunk/finley/src/finleyC/Mesh_getPattern.c revision 155 by jgs, Wed Nov 9 02:02:19 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 "IndexList.h"  
 #include "System.h"  
26  #include "Mesh.h"  #include "Mesh.h"
27    #include "IndexList.h"
28    
29  /**************************************************************/  /**************************************************************/
30    
31  /* returns a reference to the matrix pattern                  */  /* returns a reference to the matrix pattern                  */
32    
33  Finley_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order) {  Paso_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order) {
34     Finley_SystemMatrixPattern *out=NULL;     Paso_SystemMatrixPattern *out=NULL;
35     Finley_ErrorCode=NO_ERROR;     Finley_resetError();
36     /* make sure that the requested pattern is available */     /* make sure that the requested pattern is available */
37     if (reduce_row_order) {     if (reduce_row_order) {
38        if (reduce_col_order) {        if (reduce_col_order) {
# Line 37  Finley_SystemMatrixPattern* Finley_getPa Line 47  Finley_SystemMatrixPattern* Finley_getPa
47           if (mesh->FullFullPattern==NULL) mesh->FullFullPattern=Finley_makePattern(mesh,reduce_row_order,reduce_col_order);           if (mesh->FullFullPattern==NULL) mesh->FullFullPattern=Finley_makePattern(mesh,reduce_row_order,reduce_col_order);
48        }        }
49     }     }
50     if (Finley_ErrorCode==NO_ERROR) {     if (Finley_noError()) {
51        if (reduce_row_order) {        if (reduce_row_order) {
52           if (reduce_col_order) {           if (reduce_col_order) {
53              out=Finley_SystemMatrixPattern_reference(mesh->ReducedReducedPattern);              out=Paso_SystemMatrixPattern_reference(mesh->ReducedReducedPattern);
54           } else {           } else {
55              out=Finley_SystemMatrixPattern_reference(mesh->ReducedFullPattern);              out=Paso_SystemMatrixPattern_reference(mesh->ReducedFullPattern);
56           }           }
57        } else {        } else {
58           if (reduce_col_order) {           if (reduce_col_order) {
59              out=Finley_SystemMatrixPattern_reference(mesh->FullReducedPattern);              out=Paso_SystemMatrixPattern_reference(mesh->FullReducedPattern);
60           } else {           } else {
61              out=Finley_SystemMatrixPattern_reference(mesh->FullFullPattern);              out=Paso_SystemMatrixPattern_reference(mesh->FullFullPattern);
62           }           }
63        }        }
64     }       }  
65     return out;     return out;
66  }  }
67  Finley_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order) {  Paso_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order) {
68    double time0;    double time0;
69    dim_t i,n;    dim_t i,n;
70    index_t s,itmp,*rowLabel=NULL,*colLabel=NULL, *ptr=NULL, *index=NULL;    index_t s,itmp,*rowLabel=NULL,*colLabel=NULL, *ptr=NULL, *index=NULL;
71    Finley_IndexList* index_list=NULL;    Finley_IndexList* index_list=NULL;
72    Finley_ErrorCode=NO_ERROR;    Finley_resetError();
73        
74    time0=Finley_timer();    time0=Finley_timer();
75    if (reduce_col_order) {    if (reduce_col_order) {
# Line 130  Finley_SystemMatrixPattern* Finley_makeP Line 140  Finley_SystemMatrixPattern* Finley_makeP
140      for(i=0;i<n;++i) Finley_IndexList_free(index_list[i].extension);      for(i=0;i<n;++i) Finley_IndexList_free(index_list[i].extension);
141    }    }
142    TMPMEMFREE(index_list);    TMPMEMFREE(index_list);
143      #ifdef Finley_TRACE
144    printf("timing: mesh to matrix pattern: %.4e sec\n",Finley_timer()-time0);    printf("timing: mesh to matrix pattern: %.4e sec\n",Finley_timer()-time0);
145    if (Finley_ErrorCode!=NO_ERROR) {    #endif
146      if (! Finley_noError()) {
147      MEMFREE(ptr);      MEMFREE(ptr);
148      MEMFREE(index);      MEMFREE(index);
149      return NULL;      return NULL;
150    } else {    } else {
151      return Finley_SystemMatrixPattern_alloc(n,ptr,index);      return Paso_SystemMatrixPattern_alloc(n,ptr,index);
152    }    }
153  }  }
154  /*  /*
155   * $Log$   * $Log$
156     * Revision 1.5  2005/09/15 03:44:22  jgs
157     * Merge of development branch dev-02 back to main trunk on 2005-09-15
158     *
159     * Revision 1.4  2005/09/01 03:31:35  jgs
160     * Merge of development branch dev-02 back to main trunk on 2005-09-01
161     *
162     * Revision 1.3.2.2  2005/09/07 06:26:19  gross
163     * the solver from finley are put into the standalone package paso now
164     *
165     * Revision 1.3.2.1  2005/08/24 02:02:18  gross
166     * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
167     *
168   * Revision 1.3  2005/07/08 04:07:52  jgs   * Revision 1.3  2005/07/08 04:07:52  jgs
169   * Merge of development branch back to main trunk on 2005-07-08   * Merge of development branch back to main trunk on 2005-07-08
170   *   *

Legend:
Removed from v.123  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.26