/[escript]/trunk/finley/src/Mesh.h
ViewVC logotype

Annotation of /trunk/finley/src/Mesh.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 150 - (hide annotations)
Thu Sep 15 03:44:45 2005 UTC (13 years, 11 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Mesh.h
File MIME type: text/plain
File size: 7477 byte(s)
Merge of development branch dev-02 back to main trunk on 2005-09-15

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     /* Version: $Id$ */
15 jgs 82
16 jgs 150
17 jgs 82 #ifndef INC_FINLEY_MESH
18     #define INC_FINLEY_MESH
19    
20     /**************************************************************/
21    
22     /* Finley: Mesh */
23    
24     /* A mesh is built from nodes and elements which are describing the
25     domain, the surface and point sources. (the latter are needed to
26     establish links with other codes, in particular to particle
27     codes). The nodes are stored a Finley_NodeFile and elements in a
28     Finley_ElementFile. A Finley_NodeFile and three Finley_ElementFile
29     containing the elements describing the domain, surface and point
30     sources respectively. Notice that the surface elements do not
31     necessaryly cover the entire surface of the domain. */
32    
33     /* The element type is fixed by the reference element, see
34     ReferenceElement.h. The numbering of the nodes starts with 0. */
35    
36     /* Important: it is assumed that every node is appearing in at least
37     one element or surface element and that any node used in an
38     element, surface element or as a point is specified in the
39     Finley_Node, see also Finley_resolveNodeIds. */
40    
41     /* In some cases it is useful to refer to a mesh entirly built from
42     order 1 (=linear) elements. The linear version of the mesh can be
43     accessed by referning to the first few nodes of each element
44     (thanks to the way the nodes are ordered). As the numbering of
45     these nodes is not continuous a relabeling vectors are introduced
46     in the Finley_NodeFile. This feature is not fully implemented
47     yet. */
48    
49     /* allnodes and elements are tagged. the tag allows to group nodes and
50     elements. A typical application is to mark surface elements on a
51     certain portion of the domain with the same tag. All these surface
52     elements can then assigned the same value eg. for the pressure. */
53    
54     /* Thespacial dimension is determined by the type of elements
55     used. The spacial dimension should be accessed by the function
56     Finley_Mesh_getDim. Notice that the element type also determines
57     the type of surface elements to be used. */
58    
59     /**************************************************************/
60    
61 jgs 150 #include "Finley.h"
62 jgs 82 #include "NodeFile.h"
63     #include "ElementFile.h"
64 jgs 150 #include "paso/SystemMatrixPattern.h"
65 jgs 82 #include "escript/Data/DataC.h"
66    
67     /**************************************************************/
68    
69     /* this struct holds a mesh: */
70    
71     struct Finley_Mesh {
72     char* Name; /* the name of the mesh */
73 jgs 123 index_t order; /* integration order */
74     dim_t reference_counter; /* counts the number of references to the mesh; */
75 jgs 82 Finley_NodeFile* Nodes; /* the table of the nodes */
76     Finley_ElementFile* Elements; /* the table of the elements */
77     Finley_ElementFile* FaceElements; /* the table of the face elements */
78     Finley_ElementFile* ContactElements; /* the table of the contact elements */
79     Finley_ElementFile* Points; /* the table of points (treated as elements of dimension 0) */
80 jgs 102
81     /* pointer to the sparse matrix pattern */
82    
83 jgs 150 Paso_SystemMatrixPattern *FullFullPattern;
84     Paso_SystemMatrixPattern *FullReducedPattern;
85     Paso_SystemMatrixPattern *ReducedFullPattern;
86     Paso_SystemMatrixPattern *ReducedReducedPattern;
87 jgs 82 };
88    
89     typedef struct Finley_Mesh Finley_Mesh;
90    
91     /* these structures are used for matching surfaces elements: */
92    
93     struct Finley_Mesh_findMatchingFaces_center{
94 jgs 123 index_t refId;
95 jgs 82 double x[MAX_numDim];
96     };
97     typedef struct Finley_Mesh_findMatchingFaces_center Finley_Mesh_findMatchingFaces_center;
98    
99     /**************************************************************/
100    
101     /* interfaces: */
102    
103     Finley_Mesh* Finley_Mesh_alloc(char*,int,int);
104 jgs 102 Finley_Mesh* Finley_Mesh_reference(Finley_Mesh*);
105 jgs 82 void Finley_Mesh_dealloc(Finley_Mesh*);
106 jgs 123 dim_t Finley_Mesh_getDim(Finley_Mesh*);
107     dim_t Finley_Mesh_getNumNodes(Finley_Mesh*);
108     dim_t Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh*);
109     dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh*);
110 jgs 150 Paso_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
111     Paso_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
112 jgs 82 void Finley_Mesh_write(Finley_Mesh*,char*);
113 jgs 123 Finley_Mesh* Finley_Mesh_read(char*,index_t);
114 jgs 82
115     void Finley_Mesh_prepare(Finley_Mesh* in);
116     void Finley_Mesh_prepareNodes(Finley_Mesh* in);
117     void Finley_Mesh_improveColoring(Finley_Mesh* in);
118     void Finley_Mesh_optimizeElementDistribution(Finley_Mesh* in);
119     void Finley_Mesh_resolveNodeIds(Finley_Mesh*);
120 jgs 123 Finley_Mesh* Finley_Mesh_merge(dim_t, Finley_Mesh**);
121 jgs 82
122     void Finley_Mesh_relableElementNodes(int*,int,Finley_Mesh*);
123     void Finley_Mesh_markNodes(int*,int,Finley_Mesh*,int);
124    
125     void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance);
126     void Finley_Mesh_joinFaces(Finley_Mesh* self,double safety_factor,double tolerance);
127    
128     int Finley_Mesh_findMatchingFaces_compar(const void*,const void*);
129     void Finley_Mesh_findMatchingFaces(Finley_NodeFile*,Finley_ElementFile *,double,double, int*, int*,int*,int*);
130     void Finley_Mesh_print(Finley_Mesh *in);
131     void Finley_Mesh_saveDX(const char *, Finley_Mesh *, escriptDataC*);
132 jgs 110 void Finley_Mesh_saveVTK(const char *, Finley_Mesh *, escriptDataC*);
133 jgs 82
134     #endif /* #ifndef INC_FINLEY_MESH */
135 jgs 123
136     /*
137     * $Log$
138 jgs 150 * Revision 1.7 2005/09/15 03:44:22 jgs
139     * Merge of development branch dev-02 back to main trunk on 2005-09-15
140     *
141     * Revision 1.6.2.1 2005/09/07 06:26:19 gross
142     * the solver from finley are put into the standalone package paso now
143     *
144 jgs 123 * Revision 1.6 2005/07/08 04:07:51 jgs
145     * Merge of development branch back to main trunk on 2005-07-08
146     *
147     * Revision 1.1.1.1.2.3 2005/06/29 02:34:51 gross
148     * some changes towards 64 integers in finley
149     *
150     * Revision 1.1.1.1.2.2 2005/02/09 06:53:59 cochrane
151     * Added Finley_Mesh_saveVTK.
152     *
153     * Revision 1.1.1.1.2.1 2004/11/12 06:58:18 gross
154     * a lot of changes to get the linearPDE class running: most important change is that there is no matrix format exposed to the user anymore. the format is chosen by the Domain according to the solver and symmetry
155     *
156     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
157     * initial import of project esys2
158     *
159     * Revision 1.5 2004/07/27 08:26:45 gross
160     * Finley: saveDX added: now it is possible to write data on boundary and contact elements
161     *
162     * Revision 1.4 2004/07/26 04:27:15 gross
163     * it allmost compiles now
164     *
165     * Revision 1.3 2004/07/02 04:21:13 gross
166     * Finley C code has been included
167     *
168     * Revision 1.2 2004/07/02 00:03:29 gross
169     * interface for saveDX added
170     *
171     * Revision 1.1.1.1 2004/06/24 04:00:40 johng
172     * Initial version of eys using boost-python.
173     *
174     *
175     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26