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

Diff of /trunk-mpi-branch/finley/src/ElementFile.c

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

revision 1222 by ksteube, Tue May 15 03:23:17 2007 UTC revision 1223 by gross, Fri Aug 3 02:40:39 2007 UTC
# Line 15  Line 15 
15  /*   Finley: ElementFile */  /*   Finley: ElementFile */
16    
17  /*   allocates an element file to hold elements of type id and with integration order order. */  /*   allocates an element file to hold elements of type id and with integration order order. */
18  /*   use Finley_Mesh_allocElementTable to allocate the element table (Id,Nodes,Tag). */  /*   use Finley_Mesh_allocElementTable to allocate the element table (Id,Nodes,Tag,Owner). */
19    
20  /**************************************************************/  /**************************************************************/
21    
# Line 28  Line 28 
28    
29  /**************************************************************/  /**************************************************************/
30    
 #ifndef PASO_MPI  
 Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id, index_t order, index_t reduced_order)  
 #else  
31  Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id, index_t order, index_t reduced_order, Paso_MPIInfo *MPIInfo)  Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id, index_t order, index_t reduced_order, Paso_MPIInfo *MPIInfo)
 #endif  
32  {  {
33    extern Finley_RefElementInfo Finley_RefElement_InfoList[];    extern Finley_RefElementInfo Finley_RefElement_InfoList[];
34    dim_t NQ, reduced_NQ;    dim_t NQ, reduced_NQ;
# Line 69  Finley_ElementFile* Finley_ElementFile_a Line 65  Finley_ElementFile* Finley_ElementFile_a
65    out->jacobeans_reducedS=NULL;    out->jacobeans_reducedS=NULL;
66    out->jacobeans_reducedS_reducedQ=NULL;    out->jacobeans_reducedS_reducedQ=NULL;
67    
68  #ifdef PASO_MPI    out->Owner=NULL;                
   out->Dom=NULL;                  
69    out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );    out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
   out->elementDistribution = Finley_ElementDistribution_alloc( MPIInfo );  
 #endif  
70    
71    /*  allocate the reference element: */    /*  allocate the reference element: */
72        
# Line 86  Finley_ElementFile* Finley_ElementFile_a Line 79  Finley_ElementFile* Finley_ElementFile_a
79    out->jacobeans_reducedS=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElement);    out->jacobeans_reducedS=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElement);
80    out->LinearReferenceElementReducedOrder=Finley_RefElement_alloc(Finley_RefElement_InfoList[id].LinearTypeId,reduced_NQ);    out->LinearReferenceElementReducedOrder=Finley_RefElement_alloc(Finley_RefElement_InfoList[id].LinearTypeId,reduced_NQ);
81    out->jacobeans_reducedS_reducedQ=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElementReducedOrder);    out->jacobeans_reducedS_reducedQ=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElementReducedOrder);
82    
83      out->numNodes=out->ReferenceElement->Type->numNodes;
84    
85    if (! Finley_noError()) {    if (! Finley_noError()) {
86       Finley_ElementFile_dealloc(out);       Finley_ElementFile_free(out);
87       return NULL;       return NULL;
88    }    }
89    return out;    return out;
# Line 95  Finley_ElementFile* Finley_ElementFile_a Line 91  Finley_ElementFile* Finley_ElementFile_a
91    
92  /*  deallocates an element file: */  /*  deallocates an element file: */
93    
94  void Finley_ElementFile_dealloc(Finley_ElementFile* in) {  void Finley_ElementFile_free(Finley_ElementFile* in) {
95    if (in!=NULL) {    if (in!=NULL) {
96       #ifdef Finley_TRACE       #ifdef Finley_TRACE
97       if (in->ReferenceElement!=NULL) printf("element file for %s is deallocated.\n",in->ReferenceElement->Type->Name);       if (in->ReferenceElement!=NULL) printf("element file for %s is deallocated.\n",in->ReferenceElement->Type->Name);
98       #endif       #endif
99         Finley_ElementFile_freeTable(in);  
100       Finley_RefElement_dealloc(in->ReferenceElement);       Finley_RefElement_dealloc(in->ReferenceElement);
101       Finley_RefElement_dealloc(in->ReferenceElementReducedOrder);       Finley_RefElement_dealloc(in->ReferenceElementReducedOrder);
102       Finley_RefElement_dealloc(in->LinearReferenceElement);       Finley_RefElement_dealloc(in->LinearReferenceElement);
103       Finley_RefElement_dealloc(in->LinearReferenceElementReducedOrder);       Finley_RefElement_dealloc(in->LinearReferenceElementReducedOrder);
      Finley_ElementFile_deallocTable(in);    
104       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans);       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans);
105       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS);       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS);
106       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedQ);       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedQ);
107       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS_reducedQ);       Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS_reducedQ);
108  #ifdef PASO_MPI       Paso_MPIInfo_free( in->MPIInfo );
      MEMFREE(in->Dom);      
      Paso_MPIInfo_dealloc( in->MPIInfo );  
      Finley_ElementDistribution_dealloc( in->elementDistribution );  
 #endif            
109       MEMFREE(in);             MEMFREE(in);      
110    }    }
111  }  }
112  /*  
113  * $Log$  dim_t Finley_ElementFile_getGlobalNumElements(Finley_ElementFile* in) {
114  * Revision 1.6  2005/09/15 03:44:21  jgs      if (in) {
115  * Merge of development branch dev-02 back to main trunk on 2005-09-15      } else {
116  *        return 0;
117  * Revision 1.5.2.1  2005/09/07 06:26:18  gross      }
118  * the solver from finley are put into the standalone package paso now  }
119  *  dim_t Finley_ElementFile_getMyNumElements(Finley_ElementFile* in) {
120  * Revision 1.5  2005/07/08 04:07:48  jgs      return  Finley_ElementFile_getLastElement(in)-Finley_ElementFile_getFirstElement(in);
121  * Merge of development branch back to main trunk on 2005-07-08  }
122  *  index_t Finley_ElementFile_getFirstElement(Finley_ElementFile* in) {
123  * Revision 1.4  2004/12/15 07:08:32  jgs      if (in) {
124  * *** empty log message ***      } else {
125  * Revision 1.1.1.1.2.2  2005/06/29 02:34:49  gross        return 0;
126  * some changes towards 64 integers in finley      }
127  *  }
128  * Revision 1.1.1.1.2.1  2004/11/24 01:37:13  gross  index_t Finley_ElementFile_getLastElement(Finley_ElementFile* in) {
129  * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now      if (in) {
130  *      } else {
131  *        return 0;
132  *      }
133  */  }
134    

Legend:
Removed from v.1222  
changed lines
  Added in v.1223

  ViewVC Help
Powered by ViewVC 1.1.26