/[escript]/trunk/finley/src/ElementFile.c
ViewVC logotype

Diff of /trunk/finley/src/ElementFile.c

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

trunk/esys2/finley/src/finleyC/ElementFile.c revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC trunk/finley/src/ElementFile.c revision 964 by gross, Tue Feb 13 05:10:26 2007 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
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: ElementFile */  /*   Finley: ElementFile */
# Line 8  Line 19 
19    
20  /**************************************************************/  /**************************************************************/
21    
 /*   Copyrights by ACcESS Australia 2003/04 */  
22  /*   Author: gross@access.edu.au */  /*   Author: gross@access.edu.au */
23  /*   Version: $Id$ */  /*   Version: $Id$ */
24    
25  /**************************************************************/  /**************************************************************/
26    
 #include "Finley.h"  
27  #include "ElementFile.h"  #include "ElementFile.h"
28    
29  /**************************************************************/  /**************************************************************/
30    
31  Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id,int order){  #ifndef PASO_MPI
32    Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id,index_t order)
33    #else
34    Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id,index_t order, Paso_MPIInfo *MPIInfo)
35    #endif
36    {
37    extern Finley_RefElementInfo Finley_RefElement_InfoList[];    extern Finley_RefElementInfo Finley_RefElement_InfoList[];
38    int NQ;    dim_t NQ;
39    Finley_ElementFile *out;    Finley_ElementFile *out;
40        
41    /*   get the number of quadrature nodes needed to achieve integration order order: */    /*   get the number of quadrature nodes needed to achieve integration order order: */
42        
43    if (order<0) order=2*Finley_RefElement_InfoList[id].numOrder;    if (order<0) order=2*Finley_RefElement_InfoList[id].numOrder;
44    NQ= Finley_RefElement_InfoList[id].getNumQuadNodes(order);    NQ= Finley_RefElement_InfoList[id].getNumQuadNodes(order);
45    if (Finley_ErrorCode!=NO_ERROR) return NULL;    if (! Finley_noError()) return NULL;
46        
47    /*  allocate the return value */    /*  allocate the return value */
48        
# Line 36  Finley_ElementFile* Finley_ElementFile_a Line 50  Finley_ElementFile* Finley_ElementFile_a
50    if (Finley_checkPtr(out)) return NULL;    if (Finley_checkPtr(out)) return NULL;
51    out->ReferenceElement=NULL;    out->ReferenceElement=NULL;
52    out->LinearReferenceElement=NULL;    out->LinearReferenceElement=NULL;
53      out->isPrepared=FINLEY_UNKNOWN;
54    out->numElements=0;    out->numElements=0;
55    out->Id=NULL;    out->Id=NULL;
56    out->Nodes=NULL;    out->Nodes=NULL;
57    out->Tag=NULL;    out->Tag=NULL;
58    out->Color=NULL;    out->Color=NULL;
59    out->numColors=0;    out->minColor=0;
60      out->maxColor=-1;
61    out->order = order;    out->order = order;
62      out->jacobeans=NULL;
63      out->jacobeans_reducedQ=NULL;
64      out->jacobeans_reducedS=NULL;
65      out->jacobeans_reducedS_reducedQ=NULL;
66    
67    #ifdef PASO_MPI
68      out->Dom=NULL;                
69      out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
70      out->elementDistribution = Finley_ElementDistribution_alloc( MPIInfo );
71    #endif
72    
73    /*  allocate the reference element: */    /*  allocate the reference element: */
74        
75    out->ReferenceElement=Finley_RefElement_alloc(id,NQ);    out->ReferenceElement=Finley_RefElement_alloc(id,NQ);
76    if (Finley_ErrorCode!=NO_ERROR) {    out->jacobeans=Finley_ElementFile_Jacobeans_alloc(out->ReferenceElement);
77       Finley_ElementFile_dealloc(out);    out->jacobeans_reducedQ=Finley_ElementFile_Jacobeans_alloc(out->ReferenceElement);
78       return NULL;  
   }  
79    out->LinearReferenceElement=Finley_RefElement_alloc(Finley_RefElement_InfoList[id].LinearTypeId,NQ);    out->LinearReferenceElement=Finley_RefElement_alloc(Finley_RefElement_InfoList[id].LinearTypeId,NQ);
80    if (Finley_ErrorCode!=NO_ERROR) {    out->jacobeans_reducedS=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElement);
81      out->jacobeans_reducedS_reducedQ=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElement);
82      if (! Finley_noError()) {
83       Finley_ElementFile_dealloc(out);       Finley_ElementFile_dealloc(out);
84       return NULL;       return NULL;
85    }    }
# Line 69  void Finley_ElementFile_dealloc(Finley_E Line 96  void Finley_ElementFile_dealloc(Finley_E
96       Finley_RefElement_dealloc(in->ReferenceElement);       Finley_RefElement_dealloc(in->ReferenceElement);
97       Finley_RefElement_dealloc(in->LinearReferenceElement);       Finley_RefElement_dealloc(in->LinearReferenceElement);
98       Finley_ElementFile_deallocTable(in);         Finley_ElementFile_deallocTable(in);  
99         Finley_ElementFile_Jacobeans_dealloc(in->jacobeans);
100         Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS);
101         Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedQ);
102         Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS_reducedQ);
103    #ifdef PASO_MPI
104         MEMFREE(in->Dom);    
105         Paso_MPIInfo_dealloc( in->MPIInfo );
106         Finley_ElementDistribution_dealloc( in->elementDistribution );
107    #endif          
108       MEMFREE(in);             MEMFREE(in);      
109    }    }
110  }  }
111  /*  /*
112  * $Log$  * $Log$
113    * Revision 1.6  2005/09/15 03:44:21  jgs
114    * Merge of development branch dev-02 back to main trunk on 2005-09-15
115    *
116    * Revision 1.5.2.1  2005/09/07 06:26:18  gross
117    * the solver from finley are put into the standalone package paso now
118    *
119    * Revision 1.5  2005/07/08 04:07:48  jgs
120    * Merge of development branch back to main trunk on 2005-07-08
121    *
122  * Revision 1.4  2004/12/15 07:08:32  jgs  * Revision 1.4  2004/12/15 07:08:32  jgs
123  * *** empty log message ***  * *** empty log message ***
124    * Revision 1.1.1.1.2.2  2005/06/29 02:34:49  gross
125    * some changes towards 64 integers in finley
126    *
127    * Revision 1.1.1.1.2.1  2004/11/24 01:37:13  gross
128    * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
129  *  *
130  *  *
131  *  *

Legend:
Removed from v.102  
changed lines
  Added in v.964

  ViewVC Help
Powered by ViewVC 1.1.26