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

Diff of /trunk/finley/src/Mesh_saveDX.c

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

revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
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    
# Line 6  Line 19 
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 */
# Line 35  void Finley_Mesh_saveDX(const char * fil Line 48  void Finley_Mesh_saveDX(const char * fil
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 */
# Line 63  void Finley_Mesh_saveDX(const char * fil Line 76  void Finley_Mesh_saveDX(const char * fil
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;
# Line 88  void Finley_Mesh_saveDX(const char * fil Line 101  void Finley_Mesh_saveDX(const char * fil
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    }    }
# Line 117  void Finley_Mesh_saveDX(const char * fil Line 130  void Finley_Mesh_saveDX(const char * fil
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;
# Line 194  void Finley_Mesh_saveDX(const char * fil Line 207  void Finley_Mesh_saveDX(const char * fil
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   *   *

Legend:
Removed from v.123  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.26