1 |
/* $Id$ */ |
/* |
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 |
|
|
16 |
/**************************************************************/ |
/**************************************************************/ |
17 |
|
|
19 |
|
|
20 |
/**************************************************************/ |
/**************************************************************/ |
21 |
|
|
|
/* Copyrights by ACcESS, Australia 2004 */ |
|
22 |
/* Author: Lutz Gross, gross@access.edu.au */ |
/* Author: Lutz Gross, gross@access.edu.au */ |
23 |
|
/* Version: $Id$ */ |
24 |
|
|
25 |
/**************************************************************/ |
/**************************************************************/ |
26 |
|
|
|
#include "Finley.h" |
|
|
#include "Common.h" |
|
27 |
#include "Mesh.h" |
#include "Mesh.h" |
28 |
#include "escript/Data/DataC.h" |
|
29 |
|
/**************************************************************/ |
30 |
|
|
31 |
void Finley_Mesh_saveDX(const char * filename_p, Finley_Mesh *mesh_p, escriptDataC* data_p) { |
void Finley_Mesh_saveDX(const char * filename_p, Finley_Mesh *mesh_p, escriptDataC* data_p) { |
32 |
|
char error_msg[LenErrorMsg_MAX]; |
33 |
/* if there is no mesh we just return */ |
/* if there is no mesh we just return */ |
34 |
if (mesh_p==NULL) return; |
if (mesh_p==NULL) return; |
35 |
/* some tables needed for reordering */ |
/* some tables needed for reordering */ |
48 |
/* open the file and check handel */ |
/* open the file and check handel */ |
49 |
FILE * fileHandle_p = fopen(filename_p, "w"); |
FILE * fileHandle_p = fopen(filename_p, "w"); |
50 |
if (fileHandle_p==NULL) { |
if (fileHandle_p==NULL) { |
51 |
Finley_ErrorCode=IO_ERROR; |
sprintf(error_msg,"File %s could not be opened for writing.",filename_p); |
52 |
sprintf(Finley_ErrorMsg,"File %s could not be opened for writing.",filename_p); |
Finley_setError(IO_ERROR,error_msg); |
53 |
return; |
return; |
54 |
} |
} |
55 |
/* positions */ |
/* positions */ |
76 |
case(FINLEY_REDUCED_DEGREES_OF_FREEDOM): |
case(FINLEY_REDUCED_DEGREES_OF_FREEDOM): |
77 |
nodetype=FINLEY_REDUCED_DEGREES_OF_FREEDOM; |
nodetype=FINLEY_REDUCED_DEGREES_OF_FREEDOM; |
78 |
isCellCentered=FALSE; |
isCellCentered=FALSE; |
|
break; |
|
79 |
elements=mesh_p->Elements; |
elements=mesh_p->Elements; |
80 |
|
break; |
81 |
case(FINLEY_NODES): |
case(FINLEY_NODES): |
82 |
nodetype=FINLEY_NODES; |
nodetype=FINLEY_NODES; |
83 |
isCellCentered=FALSE; |
isCellCentered=FALSE; |
101 |
elements=mesh_p->ContactElements; |
elements=mesh_p->ContactElements; |
102 |
break; |
break; |
103 |
default: |
default: |
104 |
Finley_ErrorCode=TYPE_ERROR; |
sprintf(error_msg,"saveDX:Finley does not know anything about function space type %d",getFunctionSpaceType(data_p)); |
105 |
sprintf(Finley_ErrorMsg,"Finley does not know anything about function space type %d",getFunctionSpaceType(data_p)); |
Finley_setError(TYPE_ERROR,error_msg); |
106 |
return; |
return; |
107 |
} |
} |
108 |
} |
} |
130 |
resortIndex=resort[4]; |
resortIndex=resort[4]; |
131 |
strcpy(elemTypeStr, "cubes"); |
strcpy(elemTypeStr, "cubes"); |
132 |
} else { |
} else { |
133 |
Finley_ErrorCode=VALUE_ERROR; |
sprintf(error_msg,"saveDX: Element type %s is not supported by DX",elements->ReferenceElement->Type->Name); |
134 |
sprintf(Finley_ErrorMsg, "Element type %s is not supported by DX",elements->ReferenceElement->Type->Name); |
Finley_setError(VALUE_ERROR,error_msg); |
135 |
return; |
return; |
136 |
} |
} |
137 |
int NN=elements->ReferenceElement->Type->numNodes; |
int NN=elements->ReferenceElement->Type->numNodes; |
207 |
|
|
208 |
/* |
/* |
209 |
* $Log$ |
* $Log$ |
210 |
|
* Revision 1.5 2005/09/15 03:44:23 jgs |
211 |
|
* Merge of development branch dev-02 back to main trunk on 2005-09-15 |
212 |
|
* |
213 |
|
* Revision 1.4.2.3 2005/09/09 08:15:17 gross |
214 |
|
* bugs in vtk and dx writer fixed |
215 |
|
* |
216 |
|
* Revision 1.4.2.2 2005/09/08 08:28:39 gross |
217 |
|
* some cleanup in savevtk |
218 |
|
* |
219 |
|
* Revision 1.4.2.1 2005/09/07 06:26:20 gross |
220 |
|
* the solver from finley are put into the standalone package paso now |
221 |
|
* |
222 |
* Revision 1.4 2005/07/08 04:07:55 jgs |
* Revision 1.4 2005/07/08 04:07:55 jgs |
223 |
* Merge of development branch back to main trunk on 2005-07-08 |
* Merge of development branch back to main trunk on 2005-07-08 |
224 |
* |
* |