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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 201 - (hide annotations)
Wed Nov 23 04:10:21 2005 UTC (14 years ago) by jgs
Original Path: trunk/finley/src/finley/ElementFile.c
File MIME type: text/plain
File size: 3759 byte(s)
copy finleyC and CPPAdapter to finley and finley/CPPAdapter to
facilitate scons builds

1 jgs 150 /*
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 jgs 82 /**************************************************************/
16    
17     /* Finley: ElementFile */
18    
19     /* allocates an element file to hold elements of type id and with integration order order. */
20     /* use Finley_Mesh_allocElementTable to allocate the element table (Id,Nodes,Tag). */
21    
22     /**************************************************************/
23    
24     /* Author: gross@access.edu.au */
25     /* Version: $Id$ */
26    
27     /**************************************************************/
28    
29     #include "ElementFile.h"
30    
31     /**************************************************************/
32    
33 jgs 123 Finley_ElementFile* Finley_ElementFile_alloc(ElementTypeId id,index_t order){
34 jgs 82 extern Finley_RefElementInfo Finley_RefElement_InfoList[];
35 jgs 123 dim_t NQ;
36 jgs 82 Finley_ElementFile *out;
37    
38     /* get the number of quadrature nodes needed to achieve integration order order: */
39    
40     if (order<0) order=2*Finley_RefElement_InfoList[id].numOrder;
41     NQ= Finley_RefElement_InfoList[id].getNumQuadNodes(order);
42 jgs 150 if (! Finley_noError()) return NULL;
43 jgs 82
44     /* allocate the return value */
45    
46 jgs 102 out=MEMALLOC(1,Finley_ElementFile);
47 jgs 82 if (Finley_checkPtr(out)) return NULL;
48     out->ReferenceElement=NULL;
49     out->LinearReferenceElement=NULL;
50     out->numElements=0;
51     out->Id=NULL;
52     out->Nodes=NULL;
53     out->Tag=NULL;
54     out->Color=NULL;
55 jgs 123 out->minColor=0;
56     out->maxColor=-1;
57 jgs 82 out->order = order;
58    
59     /* allocate the reference element: */
60    
61     out->ReferenceElement=Finley_RefElement_alloc(id,NQ);
62 jgs 150 if (! Finley_noError()) {
63 jgs 82 Finley_ElementFile_dealloc(out);
64     return NULL;
65     }
66     out->LinearReferenceElement=Finley_RefElement_alloc(Finley_RefElement_InfoList[id].LinearTypeId,NQ);
67 jgs 150 if (! Finley_noError()) {
68 jgs 82 Finley_ElementFile_dealloc(out);
69     return NULL;
70     }
71     return out;
72     }
73    
74     /* deallocates an element file: */
75    
76     void Finley_ElementFile_dealloc(Finley_ElementFile* in) {
77     if (in!=NULL) {
78     #ifdef Finley_TRACE
79     if (in->ReferenceElement!=NULL) printf("element file for %s is deallocated.\n",in->ReferenceElement->Type->Name);
80     #endif
81     Finley_RefElement_dealloc(in->ReferenceElement);
82     Finley_RefElement_dealloc(in->LinearReferenceElement);
83     Finley_ElementFile_deallocTable(in);
84     MEMFREE(in);
85     }
86     }
87     /*
88     * $Log$
89 jgs 150 * Revision 1.6 2005/09/15 03:44:21 jgs
90     * Merge of development branch dev-02 back to main trunk on 2005-09-15
91     *
92     * Revision 1.5.2.1 2005/09/07 06:26:18 gross
93     * the solver from finley are put into the standalone package paso now
94     *
95 jgs 123 * Revision 1.5 2005/07/08 04:07:48 jgs
96     * Merge of development branch back to main trunk on 2005-07-08
97     *
98 jgs 102 * Revision 1.4 2004/12/15 07:08:32 jgs
99 jgs 97 * *** empty log message ***
100 jgs 123 * Revision 1.1.1.1.2.2 2005/06/29 02:34:49 gross
101     * some changes towards 64 integers in finley
102 jgs 82 *
103 jgs 123 * Revision 1.1.1.1.2.1 2004/11/24 01:37:13 gross
104     * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
105 jgs 97 *
106 jgs 82 *
107 jgs 123 *
108 jgs 82 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26