/[escript]/branches/domexper/dudley/src/Mesh.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/Mesh.c

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

trunk/esys2/finley/src/finleyC/Mesh.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/finley/src/Mesh.c revision 616 by elspeth, Wed Mar 22 02:46:56 2006 UTC
# Line 1  Line 1 
1    /*
2     ************************************************************
3     *          Copyright 2006 by ACcESS MNRF                   *
4     *                                                          *
5     *              http://www.access.edu.au                    *
6     *       Primary Business: Queensland, Australia            *
7     *  Licensed under the Open Software License version 3.0    *
8     *     http://www.opensource.org/licenses/osl-3.0.php       *
9     *                                                          *
10     ************************************************************
11    */
12    
13  /**************************************************************/  /**************************************************************/
14    
15  /*   Finley: Mesh */  /*   Finley: Mesh */
16    
17  /**************************************************************/  /**************************************************************/
18    
19  /*   Copyrights by ACcESS Australia 2003,04 */  /*  Author: gross@access.edu.au */
20  /*   Author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
21    
22  /**************************************************************/  /**************************************************************/
23    
 #include "Finley.h"  
24  #include "Mesh.h"  #include "Mesh.h"
25    
26  /**************************************************************/  /**************************************************************/
# Line 20  Line 30 
30    
31  extern Finley_RefElementInfo Finley_RefElement_InfoList[];  extern Finley_RefElementInfo Finley_RefElement_InfoList[];
32    
33  Finley_Mesh* Finley_Mesh_alloc(char* name,int numDim, int order) {  Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order) {
34    Finley_Mesh *out;    Finley_Mesh *out;
35        
36    /*  allocate the return value */    /*  allocate the return value */
37        
38    out=(Finley_Mesh*)MEMALLOC(sizeof(Finley_Mesh));    out=MEMALLOC(1,Finley_Mesh);
39    if (Finley_checkPtr(out)) return NULL;    if (Finley_checkPtr(out)) return NULL;
40    out->Name=NULL;      out->Name=NULL;  
41    out->Nodes=NULL;    out->Nodes=NULL;
# Line 34  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 44  Finley_Mesh* Finley_Mesh_alloc(char* nam
44    out->Points=NULL;          out->Points=NULL;      
45    out->ContactElements=NULL;          out->ContactElements=NULL;      
46    out->reference_counter=0;    out->reference_counter=0;
47    
48      out->FullFullPattern=NULL;
49      out->FullReducedPattern=NULL;
50      out->ReducedFullPattern=NULL;
51      out->ReducedReducedPattern=NULL;
52        
53    /*   copy name: */    /*   copy name: */
54        
55    out->Name=(char*)MEMALLOC((strlen(name)+1)*sizeof(char));    out->Name=MEMALLOC(strlen(name)+1,char);
56    if (Finley_checkPtr(out->Name)) {    if (Finley_checkPtr(out->Name)) {
57        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
58        return NULL;        return NULL;
# Line 47  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 62  Finley_Mesh* Finley_Mesh_alloc(char* nam
62    /*   allocate node table: */    /*   allocate node table: */
63        
64    out->Nodes=Finley_NodeFile_alloc(numDim);    out->Nodes=Finley_NodeFile_alloc(numDim);
65    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
66        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
67        return NULL;        return NULL;
68    }    }
# Line 60  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 75  Finley_Mesh* Finley_Mesh_alloc(char* nam
75    return out;    return out;
76  }  }
77    
78    /* returns a reference to Finley_Mesh in */
79    
80    Finley_Mesh* Finley_Mesh_reference(Finley_Mesh* in) {
81         if (in!=NULL) ++(in->reference_counter);
82         return in;
83    }
84    
85  /*   deallocates a mesh: */  /*   deallocates a mesh: */
86    
87  void Finley_Mesh_dealloc(Finley_Mesh* in) {  void Finley_Mesh_dealloc(Finley_Mesh* in) {
# Line 79  void Finley_Mesh_dealloc(Finley_Mesh* in Line 101  void Finley_Mesh_dealloc(Finley_Mesh* in
101         Finley_ElementFile_dealloc(in->FaceElements);         Finley_ElementFile_dealloc(in->FaceElements);
102         Finley_ElementFile_dealloc(in->ContactElements);         Finley_ElementFile_dealloc(in->ContactElements);
103         Finley_ElementFile_dealloc(in->Points);         Finley_ElementFile_dealloc(in->Points);
104           Paso_SystemMatrixPattern_dealloc(in->FullFullPattern);
105           Paso_SystemMatrixPattern_dealloc(in->FullReducedPattern);
106           Paso_SystemMatrixPattern_dealloc(in->ReducedFullPattern);
107           Paso_SystemMatrixPattern_dealloc(in->ReducedReducedPattern);
108         MEMFREE(in);               MEMFREE(in);      
109       }       }
110    }    }
# Line 88  void Finley_Mesh_dealloc(Finley_Mesh* in Line 114  void Finley_Mesh_dealloc(Finley_Mesh* in
114    
115  /*  returns the spatial dimension of the mesh: */  /*  returns the spatial dimension of the mesh: */
116    
117  int Finley_Mesh_getDim(Finley_Mesh *in) {  dim_t Finley_Mesh_getDim(Finley_Mesh *in) {
118    return in->Nodes->numDim;    return in->Nodes->numDim;
119  }  }
120    
# Line 96  int Finley_Mesh_getDim(Finley_Mesh *in) Line 122  int Finley_Mesh_getDim(Finley_Mesh *in)
122    
123  /*  returns the number of nodes in the mesh: */  /*  returns the number of nodes in the mesh: */
124    
125  int Finley_Mesh_getNumNodes(Finley_Mesh *in) {  dim_t Finley_Mesh_getNumNodes(Finley_Mesh *in) {
126    return in->Nodes->numNodes;    return in->Nodes->numNodes;
127  }  }
128  /**************************************************************/  /**************************************************************/
129    
130  /*  returns the number of degrees of freedom in the mesh: */  /*  returns the number of degrees of freedom in the mesh: */
131    
132  int Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh *in) {  dim_t Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh *in) {
133    return in->Nodes->numDegreesOfFreedom;    return in->Nodes->numDegreesOfFreedom;
134  }  }
135  /**************************************************************/  /**************************************************************/
136    
137  /*  returns the number of degrees of freedom in the mesh: */  /*  returns the number of degrees of freedom in the mesh: */
138    
139  int Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh *in) {  dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh *in) {
140    return in->Nodes->reducedNumDegreesOfFreedom;    return in->Nodes->reducedNumDegreesOfFreedom;
141  }  }
142  /*  /*
143  * $Log$  * $Log$
144  * Revision 1.1  2004/10/26 06:53:57  jgs  * Revision 1.6  2005/09/15 03:44:22  jgs
145  * Initial revision  * Merge of development branch dev-02 back to main trunk on 2005-09-15
146    *
147    * Revision 1.5.2.1  2005/09/07 06:26:19  gross
148    * the solver from finley are put into the standalone package paso now
149    *
150    * Revision 1.5  2005/07/08 04:07:51  jgs
151    * Merge of development branch back to main trunk on 2005-07-08
152    *
153    * Revision 1.4  2004/12/15 07:08:32  jgs
154    * *** empty log message ***
155    * Revision 1.1.1.1.2.3  2005/06/29 02:34:51  gross
156    * some changes towards 64 integers in finley
157    *
158    * Revision 1.1.1.1.2.2  2004/11/24 01:37:13  gross
159    * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
160  *  *
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
161  *  *
162  *  *
163  */  */

Legend:
Removed from v.82  
changed lines
  Added in v.616

  ViewVC Help
Powered by ViewVC 1.1.26