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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 110 - (hide annotations)
Mon Feb 14 04:14:42 2005 UTC (14 years, 6 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Mesh.h
File MIME type: text/plain
File size: 5154 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 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     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 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     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 102 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 102 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 jgs 110 void Finley_Mesh_saveVTK(const char *, Finley_Mesh *, escriptDataC*);
118 jgs 82
119     #endif /* #ifndef INC_FINLEY_MESH */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26