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

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

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

revision 100 by jgs, Wed Dec 15 03:48:48 2004 UTC revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC
# Line 25  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 25  Finley_Mesh* Finley_Mesh_alloc(char* nam
25        
26    /*  allocate the return value */    /*  allocate the return value */
27        
28    out=(Finley_Mesh*)MEMALLOC(sizeof(Finley_Mesh));    out=MEMALLOC(1,Finley_Mesh);
29    if (Finley_checkPtr(out)) return NULL;    if (Finley_checkPtr(out)) return NULL;
30    out->Name=NULL;      out->Name=NULL;  
31    out->Nodes=NULL;    out->Nodes=NULL;
# Line 34  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 34  Finley_Mesh* Finley_Mesh_alloc(char* nam
34    out->Points=NULL;          out->Points=NULL;      
35    out->ContactElements=NULL;          out->ContactElements=NULL;      
36    out->reference_counter=0;    out->reference_counter=0;
37    
38      out->FullFullPattern=NULL;
39      out->FullReducedPattern=NULL;
40      out->ReducedFullPattern=NULL;
41      out->ReducedReducedPattern=NULL;
42        
43    /*   copy name: */    /*   copy name: */
44        
45    out->Name=(char*)MEMALLOC((strlen(name)+1)*sizeof(char));    out->Name=MEMALLOC(strlen(name)+1,char);
46    if (Finley_checkPtr(out->Name)) {    if (Finley_checkPtr(out->Name)) {
47        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
48        return NULL;        return NULL;
# Line 60  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 65  Finley_Mesh* Finley_Mesh_alloc(char* nam
65    return out;    return out;
66  }  }
67    
68    /* returns a reference to Finley_Mesh in */
69    
70    Finley_Mesh* Finley_Mesh_reference(Finley_Mesh* in) {
71         if (in!=NULL) ++(in->reference_counter);
72         return in;
73    }
74    
75  /*   deallocates a mesh: */  /*   deallocates a mesh: */
76    
77  void Finley_Mesh_dealloc(Finley_Mesh* in) {  void Finley_Mesh_dealloc(Finley_Mesh* in) {
# Line 79  void Finley_Mesh_dealloc(Finley_Mesh* in Line 91  void Finley_Mesh_dealloc(Finley_Mesh* in
91         Finley_ElementFile_dealloc(in->FaceElements);         Finley_ElementFile_dealloc(in->FaceElements);
92         Finley_ElementFile_dealloc(in->ContactElements);         Finley_ElementFile_dealloc(in->ContactElements);
93         Finley_ElementFile_dealloc(in->Points);         Finley_ElementFile_dealloc(in->Points);
94           Finley_SystemMatrixPattern_dealloc(in->FullFullPattern);
95           Finley_SystemMatrixPattern_dealloc(in->FullReducedPattern);
96           Finley_SystemMatrixPattern_dealloc(in->ReducedFullPattern);
97           Finley_SystemMatrixPattern_dealloc(in->ReducedReducedPattern);
98         MEMFREE(in);               MEMFREE(in);      
99       }       }
100    }    }
# Line 115  int Finley_Mesh_getReducedNumDegreesOfFr Line 131  int Finley_Mesh_getReducedNumDegreesOfFr
131  }  }
132  /*  /*
133  * $Log$  * $Log$
134  * Revision 1.3  2004/12/15 03:48:45  jgs  * Revision 1.4  2004/12/15 07:08:32  jgs
135  * *** empty log message ***  * *** empty log message ***
136  *  *
 * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
 * initial import of project esys2  
 *  
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
137  *  *
138  *  *
139  */  */

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

  ViewVC Help
Powered by ViewVC 1.1.26