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

Diff of /trunk/finley/src/Mesh_resolveNodeIds.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 123 by jgs, Fri Jul 8 04:08:13 2005 UTC
# Line 16  Line 16 
16    
17  #include "Finley.h"  #include "Finley.h"
18  #include "Mesh.h"  #include "Mesh.h"
19    #include "Util.h"
20    
21  /**************************************************************/  /**************************************************************/
22    
23  void  Finley_Mesh_resolveNodeIds(Finley_Mesh* in) {  void  Finley_Mesh_resolveNodeIds(Finley_Mesh* in) {
24    maybelong k,min_id,max_id,min_id2,max_id2,len,numDim,newNumNodes,n;    dim_t k,len,numDim,newNumNodes,n;
25    maybelong *maskNodes=NULL,*maskElements=NULL,*index=NULL;    index_t min_id,max_id,min_id2,max_id2,*maskNodes=NULL,*maskElements=NULL,*index=NULL;
26    Finley_NodeFile *newNodeFile=NULL;    Finley_NodeFile *newNodeFile=NULL;
27    Finley_ErrorCode=NO_ERROR;    Finley_ErrorCode=NO_ERROR;
28    numDim=Finley_Mesh_getDim(in);    numDim=Finley_Mesh_getDim(in);
29        
30    /*   find the minimum and maximum id used: */    /*   find the minimum and maximum id used: */
31        
32    min_id=MAYBELONG_MAX;    min_id=INDEX_T_MAX;
33    max_id=-MAYBELONG_MAX;    max_id=-INDEX_T_MAX;
34    Finley_NodeFile_setIdRange(&min_id2,&max_id2,in->Nodes);    Finley_NodeFile_setIdRange(&min_id2,&max_id2,in->Nodes);
35    if (min_id2==MAYBELONG_MAX || max_id2==-MAYBELONG_MAX) {    if (min_id2==INDEX_T_MAX || max_id2==-INDEX_T_MAX) {
36      Finley_ErrorCode=VALUE_ERROR;      Finley_ErrorCode=VALUE_ERROR;
37      sprintf(Finley_ErrorMsg,"Mesh has not been defined completely.");      sprintf(Finley_ErrorMsg,"Mesh has not been defined completely.");
38      goto clean;      goto clean;
# Line 61  void  Finley_Mesh_resolveNodeIds(Finley_ Line 62  void  Finley_Mesh_resolveNodeIds(Finley_
62    newNodeFile=Finley_NodeFile_alloc(numDim);    newNodeFile=Finley_NodeFile_alloc(numDim);
63    if (Finley_ErrorCode!=NO_ERROR) goto clean;    if (Finley_ErrorCode!=NO_ERROR) goto clean;
64    
65    maskNodes=TMPMEMALLOC(len,maybelong);    maskNodes=TMPMEMALLOC(len,index_t);
66    if (Finley_checkPtr(maskNodes)) goto clean;    if (Finley_checkPtr(maskNodes)) goto clean;
67    
68    maskElements=TMPMEMALLOC(len,maybelong);    maskElements=TMPMEMALLOC(len,index_t);
69    if (Finley_checkPtr(maskElements)) goto clean;    if (Finley_checkPtr(maskElements)) goto clean;
70    
71    index=TMPMEMALLOC(in->Nodes->numNodes,maybelong);    index=TMPMEMALLOC(in->Nodes->numNodes,index_t);
72    if (Finley_checkPtr(maskElements)) goto clean;    if (Finley_checkPtr(maskElements)) goto clean;
73    
74    Finley_NodeFile_allocTable(newNodeFile,len);    Finley_NodeFile_allocTable(newNodeFile,len);
# Line 137  void  Finley_Mesh_resolveNodeIds(Finley_ Line 138  void  Finley_Mesh_resolveNodeIds(Finley_
138    
139  /*  /*
140  * $Log$  * $Log$
141    * Revision 1.5  2005/07/08 04:07:54  jgs
142    * Merge of development branch back to main trunk on 2005-07-08
143    *
144  * Revision 1.4  2004/12/15 07:08:33  jgs  * Revision 1.4  2004/12/15 07:08:33  jgs
145  * *** empty log message ***  * *** empty log message ***
146    * Revision 1.1.1.1.2.2  2005/06/29 02:34:53  gross
147    * some changes towards 64 integers in finley
148    *
149    * Revision 1.1.1.1.2.1  2004/11/24 01:37:14  gross
150    * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
151  *  *
152  *  *
153  *  *

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

  ViewVC Help
Powered by ViewVC 1.1.26