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

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

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

trunk/esys2/finley/src/finleyC/Mesh_line2.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/finley/src/finleyC/Mesh_line2.c revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC
# Line 1  Line 1 
1    /*
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  /*   Finley: generates rectangular meshes */  /*   Finley: generates rectangular meshes */
# Line 9  Line 23 
23    
24  /**************************************************************/  /**************************************************************/
25    
26  /*   Copyrights by ACcESS Australia 2003/04 */  /*  Author: gross@access.edu.au */
27  /*   Author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
28    
29  /**************************************************************/  /**************************************************************/
30    
 #include "Common.h"  
 #include "Finley.h"  
 #include "Mesh.h"  
31  #include "RectangularMesh.h"  #include "RectangularMesh.h"
32    
33  /**************************************************************/  /**************************************************************/
34    
35  Finley_Mesh* Finley_RectangularMesh_Line2(int* numElements,double* Length,int* periodic, int order,int useElementsOnFace) {  Finley_Mesh* Finley_RectangularMesh_Line2(dim_t* numElements,double* Length,bool_t* periodic, index_t order,bool_t useElementsOnFace) {
36    int N0,NE0,i0,k,NDOF0,NFaceElements,NUMNODES;    dim_t N0,NE0,i0,NDOF0,NFaceElements;
37      index_t NUMNODES,k;
38    Finley_Mesh* out;    Finley_Mesh* out;
39    char name[50];    char name[50];
40    double time0=Finley_timer();    double time0=Finley_timer();
# Line 42  Finley_Mesh* Finley_RectangularMesh_Line Line 53  Finley_Mesh* Finley_RectangularMesh_Line
53        
54    sprintf(name,"Rectangular mesh with %d nodes",N0);    sprintf(name,"Rectangular mesh with %d nodes",N0);
55    out=Finley_Mesh_alloc(name,1,order);    out=Finley_Mesh_alloc(name,1,order);
56    if (Finley_ErrorCode!=NO_ERROR) return NULL;    if (! Finley_noError()) return NULL;
57    
58    out->Elements=Finley_ElementFile_alloc(Line2,out->order);    out->Elements=Finley_ElementFile_alloc(Line2,out->order);
59    if (useElementsOnFace) {    if (useElementsOnFace) {
# Line 53  Finley_Mesh* Finley_RectangularMesh_Line Line 64  Finley_Mesh* Finley_RectangularMesh_Line
64       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order);
65    }    }
66    out->Points=Finley_ElementFile_alloc(Point1,out->order);    out->Points=Finley_ElementFile_alloc(Point1,out->order);
67    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
68          Finley_Mesh_dealloc(out);          Finley_Mesh_dealloc(out);
69          return NULL;          return NULL;
70    }    }
# Line 63  Finley_Mesh* Finley_RectangularMesh_Line Line 74  Finley_Mesh* Finley_RectangularMesh_Line
74    Finley_NodeFile_allocTable(out->Nodes,N0);    Finley_NodeFile_allocTable(out->Nodes,N0);
75    Finley_ElementFile_allocTable(out->Elements,NE0);    Finley_ElementFile_allocTable(out->Elements,NE0);
76    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
77    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
78        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
79        return NULL;        return NULL;
80    }    }
# Line 95  Finley_Mesh* Finley_RectangularMesh_Line Line 106  Finley_Mesh* Finley_RectangularMesh_Line
106      out->Elements->Nodes[INDEX2(0,k,2)]=i0;      out->Elements->Nodes[INDEX2(0,k,2)]=i0;
107      out->Elements->Nodes[INDEX2(1,k,2)]=i0+1;      out->Elements->Nodes[INDEX2(1,k,2)]=i0+1;
108    }    }
109    out->Elements->numColors=COLOR_MOD(0)+1;    out->Elements->minColor=0;
110      out->Elements->maxColor=COLOR_MOD(0);
111        
112    /*   face elements: */    /*   face elements: */
113    if (useElementsOnFace) {    if (useElementsOnFace) {
# Line 124  Finley_Mesh* Finley_RectangularMesh_Line Line 136  Finley_Mesh* Finley_RectangularMesh_Line
136         out->FaceElements->Nodes[INDEX2(0,1,NUMNODES)]=N0-1;         out->FaceElements->Nodes[INDEX2(0,1,NUMNODES)]=N0-1;
137      }      }
138    }    }
139    out->FaceElements->numColors=2;    out->FaceElements->maxColor=1;
140      out->FaceElements->minColor=0;
141    
142    /*  face elements done: */    /*  face elements done: */
143        
# Line 137  Finley_Mesh* Finley_RectangularMesh_Line Line 150  Finley_Mesh* Finley_RectangularMesh_Line
150    
151    Finley_Mesh_prepare(out) ;    Finley_Mesh_prepare(out) ;
152    
153      #ifdef Finley_TRACE
154    printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);    printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);
155      #endif
156    
157    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
158        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
159        return NULL;        return NULL;
160    }    }
# Line 147  Finley_Mesh* Finley_RectangularMesh_Line Line 162  Finley_Mesh* Finley_RectangularMesh_Line
162  }  }
163    
164  /*  /*
165  * $Log$  * Revision 1.3  2005/09/01 03:31:36  jgs
166  * Revision 1.1  2004/10/26 06:53:57  jgs  * Merge of development branch dev-02 back to main trunk on 2005-09-01
167  * Initial revision  *
168    * Revision 1.2.2.2  2005/09/07 06:26:19  gross
169    * the solver from finley are put into the standalone package paso now
170    *
171    * Revision 1.2.2.1  2005/08/24 02:02:18  gross
172    * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
173    *
174    * Revision 1.2  2005/07/08 04:07:52  jgs
175    * Merge of development branch back to main trunk on 2005-07-08
176    *
177    * Revision 1.1.1.1.2.2  2005/06/30 01:53:56  gross
178    * a bug in coloring fixed
179    *
180    * Revision 1.1.1.1.2.1  2005/06/29 02:34:52  gross
181    * some changes towards 64 integers in finley
182    *
183    * Revision 1.1.1.1  2004/10/26 06:53:57  jgs
184    * initial import of project esys2
185  *  *
186  * Revision 1.1.1.1  2004/06/24 04:00:40  johng  * Revision 1.1.1.1  2004/06/24 04:00:40  johng
187  * Initial version of eys using boost-python.  * Initial version of eys using boost-python.

Legend:
Removed from v.82  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.26