/[escript]/branches/doubleplusgood/finley/src/Mesh.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/finley/src/Mesh.cpp

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

revision 4326 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4327 by jfenwick, Wed Mar 20 05:09:11 2013 UTC
# Line 32  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 32  Finley_Mesh* Finley_Mesh_alloc(char* nam
32        
33    /*  allocate the return value */    /*  allocate the return value */
34        
35    out=MEMALLOC(1,Finley_Mesh);    out=new Finley_Mesh;
36    if (Finley_checkPtr(out)) return NULL;    if (Finley_checkPtr(out)) return NULL;
37    out->Name=NULL;      out->Name=NULL;  
38    out->Nodes=NULL;    out->Nodes=NULL;
# Line 54  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 54  Finley_Mesh* Finley_Mesh_alloc(char* nam
54    }    }
55    /*   copy name: */    /*   copy name: */
56        
57    out->Name=MEMALLOC(strlen(name)+1,char);    out->Name=new char[strlen(name)+1];
58    if (Finley_checkPtr(out->Name)) {    if (Finley_checkPtr(out->Name)) {
59        Finley_Mesh_free(out);        Finley_Mesh_free(out);
60        return NULL;        return NULL;
# Line 93  void Finley_Mesh_free(Finley_Mesh* in) { Line 93  void Finley_Mesh_free(Finley_Mesh* in) {
93    if (in!=NULL) {    if (in!=NULL) {
94       in->reference_counter--;       in->reference_counter--;
95       if (in->reference_counter<1) {       if (in->reference_counter<1) {
96         MEMFREE(in->Name);         delete[] in->Name;
97         Finley_NodeFile_free(in->Nodes);         Finley_NodeFile_free(in->Nodes);
98         Finley_ElementFile_free(in->FaceElements);         Finley_ElementFile_free(in->FaceElements);
99         Finley_ElementFile_free(in->Elements);           Finley_ElementFile_free(in->Elements);  
# Line 105  void Finley_Mesh_free(Finley_Mesh* in) { Line 105  void Finley_Mesh_free(Finley_Mesh* in) {
105         Paso_SystemMatrixPattern_free(in->ReducedFullPattern);         Paso_SystemMatrixPattern_free(in->ReducedFullPattern);
106         Paso_SystemMatrixPattern_free(in->ReducedReducedPattern);         Paso_SystemMatrixPattern_free(in->ReducedReducedPattern);
107         Esys_MPIInfo_free( in->MPIInfo );         Esys_MPIInfo_free( in->MPIInfo );
108         MEMFREE(in);               delete in;      
109       }       }
110    }    }
111  }  }

Legend:
Removed from v.4326  
changed lines
  Added in v.4327

  ViewVC Help
Powered by ViewVC 1.1.26