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

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

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

branches/domexper/dudley/src/Mesh.c revision 3251 by jfenwick, Thu Oct 7 04:02:30 2010 UTC branches/doubleplusgood/dudley/src/Mesh.cpp revision 4332 by jfenwick, Thu Mar 21 04:21:14 2013 UTC
# Line 1  Line 1 
1  /*******************************************************  /*****************************************************************************
2  *  *
3  * Copyright (c) 2003-2010 by University of Queensland  * Copyright (c) 2003-2013 by University of Queensland
4  * Earth Systems Science Computational Center (ESSCC)  * http://www.uq.edu.au
 * http://www.uq.edu.au/esscc  
5  *  *
6  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
7  * Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
8  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
9  *  *
10  *******************************************************/  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11    * Development since 2012 by School of Earth Sciences
12    *
13    *****************************************************************************/
14    
15  /**************************************************************/  /************************************************************************************/
16    
17  /*   Dudley: Mesh */  /*   Dudley: Mesh */
18    
19  /**************************************************************/  /************************************************************************************/
20    
21  #include "Mesh.h"  #include "Mesh.h"
22    
23  /**************************************************************/  /************************************************************************************/
24    
25  /*   allocates a Mesh with name name for elements of type id using an integration order. If order is negative, */  /*   allocates a Mesh with name name for elements of type id using an integration order. If order is negative, */
26  /*   the most appropriate order is selected indepently. */  /*   the most appropriate order is selected indepently. */
# Line 29  Dudley_Mesh *Dudley_Mesh_alloc(char *nam Line 31  Dudley_Mesh *Dudley_Mesh_alloc(char *nam
31    
32      /*  allocate the return value */      /*  allocate the return value */
33    
34      out = MEMALLOC(1, Dudley_Mesh);      out = new Dudley_Mesh;
35      if (Dudley_checkPtr(out))      if (Dudley_checkPtr(out))
36      return NULL;      return NULL;
37      out->Name = NULL;      out->Name = NULL;
# Line 52  Dudley_Mesh *Dudley_Mesh_alloc(char *nam Line 54  Dudley_Mesh *Dudley_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 (Dudley_checkPtr(out->Name))      if (Dudley_checkPtr(out->Name))
59      {      {
60      Dudley_Mesh_free(out);      Dudley_Mesh_free(out);
# Line 97  void Dudley_Mesh_free(Dudley_Mesh * in) Line 99  void Dudley_Mesh_free(Dudley_Mesh * in)
99      in->reference_counter--;      in->reference_counter--;
100      if (in->reference_counter < 1)      if (in->reference_counter < 1)
101      {      {
102          MEMFREE(in->Name);          delete[] in->Name;
103          Dudley_NodeFile_free(in->Nodes);          Dudley_NodeFile_free(in->Nodes);
104          Dudley_ElementFile_free(in->FaceElements);          Dudley_ElementFile_free(in->FaceElements);
105          Dudley_ElementFile_free(in->Elements);          Dudley_ElementFile_free(in->Elements);
# Line 108  void Dudley_Mesh_free(Dudley_Mesh * in) Line 110  void Dudley_Mesh_free(Dudley_Mesh * in)
110          Paso_SystemMatrixPattern_free(in->ReducedFullPattern);          Paso_SystemMatrixPattern_free(in->ReducedFullPattern);
111          Paso_SystemMatrixPattern_free(in->ReducedReducedPattern);          Paso_SystemMatrixPattern_free(in->ReducedReducedPattern);
112          Esys_MPIInfo_free(in->MPIInfo);          Esys_MPIInfo_free(in->MPIInfo);
113          MEMFREE(in);          delete in;
114      }      }
115      }      }
116  }  }
117    
118  /**************************************************************/  /************************************************************************************/
119    
120  /*  returns the spatial dimension of the mesh: */  /*  returns the spatial dimension of the mesh: */
121    

Legend:
Removed from v.3251  
changed lines
  Added in v.4332

  ViewVC Help
Powered by ViewVC 1.1.26