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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 777 - (hide annotations)
Wed Jul 12 08:54:45 2006 UTC (13 years, 3 months ago) by gross
File MIME type: text/plain
File size: 4526 byte(s)
integration with persistent jacobeans is running now
1 jgs 150 /*
2 elspeth 616 ************************************************************
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 jgs 150 */
12    
13 jgs 82 /**************************************************************/
14    
15     /* Finley: ElementFile */
16    
17     /* 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). */
19    
20     /**************************************************************/
21    
22     /* Author: gross@access.edu.au */
23     /* Version: $Id$ */
24    
25     /**************************************************************/
26    
27     #include "ElementFile.h"
28    
29     /**************************************************************/
30    
31 bcumming 730 #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 jgs 82 extern Finley_RefElementInfo Finley_RefElement_InfoList[];
38 jgs 123 dim_t NQ;
39 jgs 82 Finley_ElementFile *out;
40    
41     /* get the number of quadrature nodes needed to achieve integration order order: */
42    
43     if (order<0) order=2*Finley_RefElement_InfoList[id].numOrder;
44     NQ= Finley_RefElement_InfoList[id].getNumQuadNodes(order);
45 jgs 150 if (! Finley_noError()) return NULL;
46 jgs 82
47     /* allocate the return value */
48    
49 jgs 102 out=MEMALLOC(1,Finley_ElementFile);
50 jgs 82 if (Finley_checkPtr(out)) return NULL;
51     out->ReferenceElement=NULL;
52     out->LinearReferenceElement=NULL;
53     out->numElements=0;
54     out->Id=NULL;
55     out->Nodes=NULL;
56     out->Tag=NULL;
57     out->Color=NULL;
58 jgs 123 out->minColor=0;
59     out->maxColor=-1;
60 jgs 82 out->order = order;
61 gross 777 out->jacobeans=NULL;
62     out->jacobeans_reducedQ=NULL;
63     out->jacobeans_reducedS=NULL;
64     out->jacobeans_reducedS_reducedQ=NULL;
65 jgs 82
66 bcumming 730 #ifdef PASO_MPI
67     out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
68     out->elementDistribution = Finley_ElementDistribution_alloc( MPIInfo );
69     #endif
70 gross 532
71 jgs 82 /* allocate the reference element: */
72    
73     out->ReferenceElement=Finley_RefElement_alloc(id,NQ);
74 gross 777 out->jacobeans=Finley_ElementFile_Jacobeans_alloc(out->ReferenceElement);
75     out->jacobeans_reducedQ=Finley_ElementFile_Jacobeans_alloc(out->ReferenceElement);
76    
77 jgs 82 out->LinearReferenceElement=Finley_RefElement_alloc(Finley_RefElement_InfoList[id].LinearTypeId,NQ);
78 gross 777 out->jacobeans_reducedS=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElement);
79     out->jacobeans_reducedS_reducedQ=Finley_ElementFile_Jacobeans_alloc(out->LinearReferenceElement);
80 jgs 150 if (! Finley_noError()) {
81 jgs 82 Finley_ElementFile_dealloc(out);
82     return NULL;
83     }
84     return out;
85     }
86    
87     /* deallocates an element file: */
88    
89     void Finley_ElementFile_dealloc(Finley_ElementFile* in) {
90     if (in!=NULL) {
91     #ifdef Finley_TRACE
92     if (in->ReferenceElement!=NULL) printf("element file for %s is deallocated.\n",in->ReferenceElement->Type->Name);
93     #endif
94     Finley_RefElement_dealloc(in->ReferenceElement);
95     Finley_RefElement_dealloc(in->LinearReferenceElement);
96     Finley_ElementFile_deallocTable(in);
97 gross 776 Finley_ElementFile_Jacobeans_dealloc(in->jacobeans);
98     Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS);
99     Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedQ);
100     Finley_ElementFile_Jacobeans_dealloc(in->jacobeans_reducedS_reducedQ);
101 bcumming 730 #ifdef PASO_MPI
102     Paso_MPIInfo_dealloc( in->MPIInfo );
103     Finley_ElementDistribution_dealloc( in->elementDistribution );
104     #endif
105 jgs 82 MEMFREE(in);
106     }
107     }
108     /*
109     * $Log$
110 jgs 150 * Revision 1.6 2005/09/15 03:44:21 jgs
111     * Merge of development branch dev-02 back to main trunk on 2005-09-15
112     *
113     * Revision 1.5.2.1 2005/09/07 06:26:18 gross
114     * the solver from finley are put into the standalone package paso now
115     *
116 jgs 123 * Revision 1.5 2005/07/08 04:07:48 jgs
117     * Merge of development branch back to main trunk on 2005-07-08
118     *
119 jgs 102 * Revision 1.4 2004/12/15 07:08:32 jgs
120 jgs 97 * *** empty log message ***
121 jgs 123 * Revision 1.1.1.1.2.2 2005/06/29 02:34:49 gross
122     * some changes towards 64 integers in finley
123 jgs 82 *
124 jgs 123 * Revision 1.1.1.1.2.1 2004/11/24 01:37:13 gross
125     * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
126 jgs 97 *
127 jgs 82 *
128 jgs 123 *
129 jgs 82 */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26