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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (hide annotations)
Tue Dec 14 05:39:33 2004 UTC (14 years, 8 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Mesh.h
File MIME type: text/plain
File size: 5998 byte(s)
*** empty log message ***

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26