/[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 3224 by jfenwick, Wed Sep 29 05:19:37 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. */
27    
28  Dudley_Mesh *Dudley_Mesh_alloc(char *name, dim_t numDim, Paso_MPIInfo * mpi_info)  Dudley_Mesh *Dudley_Mesh_alloc(char *name, dim_t numDim, Esys_MPIInfo * mpi_info)
29  {  {
30      Dudley_Mesh *out;      Dudley_Mesh *out;
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 44  Dudley_Mesh *Dudley_Mesh_alloc(char *nam Line 46  Dudley_Mesh *Dudley_Mesh_alloc(char *nam
46      out->FullReducedPattern = NULL;      out->FullReducedPattern = NULL;
47      out->ReducedFullPattern = NULL;      out->ReducedFullPattern = NULL;
48      out->ReducedReducedPattern = NULL;      out->ReducedReducedPattern = NULL;
49      out->MPIInfo = Paso_MPIInfo_getReference(mpi_info);      out->MPIInfo = Esys_MPIInfo_getReference(mpi_info);
50      if (!Dudley_noError())      if (!Dudley_noError())
51      {      {
52      Dudley_Mesh_free(out);      Dudley_Mesh_free(out);
# 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 88  Dudley_Mesh *Dudley_Mesh_reference(Dudle Line 90  Dudley_Mesh *Dudley_Mesh_reference(Dudle
90      return in;      return in;
91  }  }
92    
93  /*   freeates a mesh: */  /*   frees a mesh: */
94    
95  void Dudley_Mesh_free(Dudley_Mesh * in)  void Dudley_Mesh_free(Dudley_Mesh * in)
96  {  {
# 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 107  void Dudley_Mesh_free(Dudley_Mesh * in) Line 109  void Dudley_Mesh_free(Dudley_Mesh * in)
109          Paso_SystemMatrixPattern_free(in->FullReducedPattern);          Paso_SystemMatrixPattern_free(in->FullReducedPattern);
110          Paso_SystemMatrixPattern_free(in->ReducedFullPattern);          Paso_SystemMatrixPattern_free(in->ReducedFullPattern);
111          Paso_SystemMatrixPattern_free(in->ReducedReducedPattern);          Paso_SystemMatrixPattern_free(in->ReducedReducedPattern);
112          Paso_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    
# Line 156  int Dudley_Mesh_getStatus(Dudley_Mesh * Line 158  int Dudley_Mesh_getStatus(Dudley_Mesh *
158      }      }
159  }  }
160    
161  void Mesh_setOrders(Dudley_Mesh * in)  void Dudley_Mesh_setOrders(Dudley_Mesh * in)
162  {  {
163      in->approximationOrder = 1; // order of shapeFunctions is always 1 in Dudley      in->approximationOrder = 1; /* order of shapeFunctions is always 1 in Dudley */
164      in->reducedApproximationOrder = 1;      in->reducedApproximationOrder = 1;
165      in->integrationOrder = 2;      in->integrationOrder = 2;
166      in->reducedIntegrationOrder = 0;      in->reducedIntegrationOrder = 0;

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

  ViewVC Help
Powered by ViewVC 1.1.26