/[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

trunk/esys2/finley/src/finleyC/Mesh.c revision 100 by jgs, Wed Dec 15 03:48:48 2004 UTC trunk/finley/src/finleyC/Mesh.c revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC
# Line 1  Line 1 
1    /*
2     ******************************************************************************
3     *                                                                            *
4     *       COPYRIGHT  ACcESS 2003,2004,2005 -  All Rights Reserved              *
5     *                                                                            *
6     * This software is the property of ACcESS. No part of this code              *
7     * may be copied in any form or by any means without the expressed written    *
8     * consent of ACcESS.  Copying, use or modification of this software          *
9     * by any unauthorised person is illegal unless that person has a software    *
10     * license agreement with ACcESS.                                             *
11     *                                                                            *
12     ******************************************************************************
13    */
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /*   Finley: Mesh */  /*   Finley: Mesh */
18    
19  /**************************************************************/  /**************************************************************/
20    
21  /*   Copyrights by ACcESS Australia 2003,04 */  /*  Author: gross@access.edu.au */
22  /*   Author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
23    
24  /**************************************************************/  /**************************************************************/
25    
 #include "Finley.h"  
26  #include "Mesh.h"  #include "Mesh.h"
27    
28  /**************************************************************/  /**************************************************************/
# Line 20  Line 32 
32    
33  extern Finley_RefElementInfo Finley_RefElement_InfoList[];  extern Finley_RefElementInfo Finley_RefElement_InfoList[];
34    
35  Finley_Mesh* Finley_Mesh_alloc(char* name,int numDim, int order) {  Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order) {
36    Finley_Mesh *out;    Finley_Mesh *out;
37        
38    /*  allocate the return value */    /*  allocate the return value */
39        
40    out=(Finley_Mesh*)MEMALLOC(sizeof(Finley_Mesh));    out=MEMALLOC(1,Finley_Mesh);
41    if (Finley_checkPtr(out)) return NULL;    if (Finley_checkPtr(out)) return NULL;
42    out->Name=NULL;      out->Name=NULL;  
43    out->Nodes=NULL;    out->Nodes=NULL;
# Line 34  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 46  Finley_Mesh* Finley_Mesh_alloc(char* nam
46    out->Points=NULL;          out->Points=NULL;      
47    out->ContactElements=NULL;          out->ContactElements=NULL;      
48    out->reference_counter=0;    out->reference_counter=0;
49    
50      out->FullFullPattern=NULL;
51      out->FullReducedPattern=NULL;
52      out->ReducedFullPattern=NULL;
53      out->ReducedReducedPattern=NULL;
54        
55    /*   copy name: */    /*   copy name: */
56        
57    out->Name=(char*)MEMALLOC((strlen(name)+1)*sizeof(char));    out->Name=MEMALLOC(strlen(name)+1,char);
58    if (Finley_checkPtr(out->Name)) {    if (Finley_checkPtr(out->Name)) {
59        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
60        return NULL;        return NULL;
# Line 47  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 64  Finley_Mesh* Finley_Mesh_alloc(char* nam
64    /*   allocate node table: */    /*   allocate node table: */
65        
66    out->Nodes=Finley_NodeFile_alloc(numDim);    out->Nodes=Finley_NodeFile_alloc(numDim);
67    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
68        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
69        return NULL;        return NULL;
70    }    }
# Line 60  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 77  Finley_Mesh* Finley_Mesh_alloc(char* nam
77    return out;    return out;
78  }  }
79    
80    /* returns a reference to Finley_Mesh in */
81    
82    Finley_Mesh* Finley_Mesh_reference(Finley_Mesh* in) {
83         if (in!=NULL) ++(in->reference_counter);
84         return in;
85    }
86    
87  /*   deallocates a mesh: */  /*   deallocates a mesh: */
88    
89  void Finley_Mesh_dealloc(Finley_Mesh* in) {  void Finley_Mesh_dealloc(Finley_Mesh* in) {
# Line 79  void Finley_Mesh_dealloc(Finley_Mesh* in Line 103  void Finley_Mesh_dealloc(Finley_Mesh* in
103         Finley_ElementFile_dealloc(in->FaceElements);         Finley_ElementFile_dealloc(in->FaceElements);
104         Finley_ElementFile_dealloc(in->ContactElements);         Finley_ElementFile_dealloc(in->ContactElements);
105         Finley_ElementFile_dealloc(in->Points);         Finley_ElementFile_dealloc(in->Points);
106           Paso_SystemMatrixPattern_dealloc(in->FullFullPattern);
107           Paso_SystemMatrixPattern_dealloc(in->FullReducedPattern);
108           Paso_SystemMatrixPattern_dealloc(in->ReducedFullPattern);
109           Paso_SystemMatrixPattern_dealloc(in->ReducedReducedPattern);
110         MEMFREE(in);               MEMFREE(in);      
111       }       }
112    }    }
# Line 88  void Finley_Mesh_dealloc(Finley_Mesh* in Line 116  void Finley_Mesh_dealloc(Finley_Mesh* in
116    
117  /*  returns the spatial dimension of the mesh: */  /*  returns the spatial dimension of the mesh: */
118    
119  int Finley_Mesh_getDim(Finley_Mesh *in) {  dim_t Finley_Mesh_getDim(Finley_Mesh *in) {
120    return in->Nodes->numDim;    return in->Nodes->numDim;
121  }  }
122    
# Line 96  int Finley_Mesh_getDim(Finley_Mesh *in) Line 124  int Finley_Mesh_getDim(Finley_Mesh *in)
124    
125  /*  returns the number of nodes in the mesh: */  /*  returns the number of nodes in the mesh: */
126    
127  int Finley_Mesh_getNumNodes(Finley_Mesh *in) {  dim_t Finley_Mesh_getNumNodes(Finley_Mesh *in) {
128    return in->Nodes->numNodes;    return in->Nodes->numNodes;
129  }  }
130  /**************************************************************/  /**************************************************************/
131    
132  /*  returns the number of degrees of freedom in the mesh: */  /*  returns the number of degrees of freedom in the mesh: */
133    
134  int Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh *in) {  dim_t Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh *in) {
135    return in->Nodes->numDegreesOfFreedom;    return in->Nodes->numDegreesOfFreedom;
136  }  }
137  /**************************************************************/  /**************************************************************/
138    
139  /*  returns the number of degrees of freedom in the mesh: */  /*  returns the number of degrees of freedom in the mesh: */
140    
141  int Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh *in) {  dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh *in) {
142    return in->Nodes->reducedNumDegreesOfFreedom;    return in->Nodes->reducedNumDegreesOfFreedom;
143  }  }
144  /*  /*
145  * $Log$  * $Log$
146  * Revision 1.3  2004/12/15 03:48:45  jgs  * Revision 1.6  2005/09/15 03:44:22  jgs
147    * Merge of development branch dev-02 back to main trunk on 2005-09-15
148    *
149    * Revision 1.5.2.1  2005/09/07 06:26:19  gross
150    * the solver from finley are put into the standalone package paso now
151    *
152    * Revision 1.5  2005/07/08 04:07:51  jgs
153    * Merge of development branch back to main trunk on 2005-07-08
154    *
155    * Revision 1.4  2004/12/15 07:08:32  jgs
156  * *** empty log message ***  * *** empty log message ***
157    * Revision 1.1.1.1.2.3  2005/06/29 02:34:51  gross
158    * some changes towards 64 integers in finley
159  *  *
160  * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  * Revision 1.1.1.1.2.2  2004/11/24 01:37:13  gross
161  * initial import of project esys2  * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
162  *  *
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
163  *  *
164  *  *
165  */  */

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

  ViewVC Help
Powered by ViewVC 1.1.26