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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 616 - (show annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 5 months ago) by elspeth
File MIME type: text/plain
File size: 3908 byte(s)
Copyright added to more source files.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26