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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (hide annotations)
Fri Jul 8 04:08:13 2005 UTC (14 years, 2 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Mesh.h
File MIME type: text/plain
File size: 6324 byte(s)
Merge of development branch back to main trunk on 2005-07-08

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 102 #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 jgs 123 index_t order; /* integration order */
59     dim_t reference_counter; /* counts the number of references to the mesh; */
60 jgs 82 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 102
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 jgs 123 index_t refId;
80 jgs 82 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 102 Finley_Mesh* Finley_Mesh_reference(Finley_Mesh*);
90 jgs 82 void Finley_Mesh_dealloc(Finley_Mesh*);
91 jgs 123 dim_t Finley_Mesh_getDim(Finley_Mesh*);
92     dim_t Finley_Mesh_getNumNodes(Finley_Mesh*);
93     dim_t Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh*);
94     dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh*);
95     Finley_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
96     Finley_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
97 jgs 82 void Finley_Mesh_write(Finley_Mesh*,char*);
98 jgs 123 Finley_Mesh* Finley_Mesh_read(char*,index_t);
99 jgs 82
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 jgs 123 Finley_Mesh* Finley_Mesh_merge(dim_t, Finley_Mesh**);
106 jgs 82
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 jgs 110 void Finley_Mesh_saveVTK(const char *, Finley_Mesh *, escriptDataC*);
118 jgs 82
119     #endif /* #ifndef INC_FINLEY_MESH */
120 jgs 123
121     /*
122     * $Log$
123     * Revision 1.6 2005/07/08 04:07:51 jgs
124     * Merge of development branch back to main trunk on 2005-07-08
125     *
126     * Revision 1.1.1.1.2.3 2005/06/29 02:34:51 gross
127     * some changes towards 64 integers in finley
128     *
129     * Revision 1.1.1.1.2.2 2005/02/09 06:53:59 cochrane
130     * Added Finley_Mesh_saveVTK.
131     *
132     * Revision 1.1.1.1.2.1 2004/11/12 06:58:18 gross
133     * 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
134     *
135     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
136     * initial import of project esys2
137     *
138     * Revision 1.5 2004/07/27 08:26:45 gross
139     * Finley: saveDX added: now it is possible to write data on boundary and contact elements
140     *
141     * Revision 1.4 2004/07/26 04:27:15 gross
142     * it allmost compiles now
143     *
144     * Revision 1.3 2004/07/02 04:21:13 gross
145     * Finley C code has been included
146     *
147     * Revision 1.2 2004/07/02 00:03:29 gross
148     * interface for saveDX added
149     *
150     * Revision 1.1.1.1 2004/06/24 04:00:40 johng
151     * Initial version of eys using boost-python.
152     *
153     *
154     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26