/[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 100 - (hide annotations)
Wed Dec 15 03:48:48 2004 UTC (14 years, 9 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Mesh.h
File MIME type: text/plain
File size: 5187 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     #include "escript/Data/DataC.h"
50    
51     /**************************************************************/
52    
53     /* this struct holds a mesh: */
54    
55     struct Finley_Mesh {
56     char* Name; /* the name of the mesh */
57     int order; /* integration order */
58     int reference_counter; /* counts the number of references to the mesh; */
59     Finley_NodeFile* Nodes; /* the table of the nodes */
60     Finley_ElementFile* Elements; /* the table of the elements */
61     Finley_ElementFile* FaceElements; /* the table of the face elements */
62     Finley_ElementFile* ContactElements; /* the table of the contact elements */
63     Finley_ElementFile* Points; /* the table of points (treated as elements of dimension 0) */
64     };
65    
66     typedef struct Finley_Mesh Finley_Mesh;
67    
68     /* these structures are used for matching surfaces elements: */
69    
70     struct Finley_Mesh_findMatchingFaces_center{
71     int refId;
72     double x[MAX_numDim];
73     };
74     typedef struct Finley_Mesh_findMatchingFaces_center Finley_Mesh_findMatchingFaces_center;
75    
76     /**************************************************************/
77    
78     /* interfaces: */
79    
80     Finley_Mesh* Finley_Mesh_alloc(char*,int,int);
81     void Finley_Mesh_dealloc(Finley_Mesh*);
82     int Finley_Mesh_getDim(Finley_Mesh*);
83     int Finley_Mesh_getNumNodes(Finley_Mesh*);
84     int Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh*);
85     int Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh*);
86     void Finley_Mesh_write(Finley_Mesh*,char*);
87     Finley_Mesh* Finley_Mesh_read(char*,int);
88    
89     void Finley_Mesh_prepare(Finley_Mesh* in);
90     void Finley_Mesh_prepareNodes(Finley_Mesh* in);
91     void Finley_Mesh_improveColoring(Finley_Mesh* in);
92     void Finley_Mesh_optimizeElementDistribution(Finley_Mesh* in);
93     void Finley_Mesh_resolveNodeIds(Finley_Mesh*);
94     Finley_Mesh* Finley_Mesh_merge(int, Finley_Mesh**);
95    
96     void Finley_Mesh_relableElementNodes(int*,int,Finley_Mesh*);
97     void Finley_Mesh_markNodes(int*,int,Finley_Mesh*,int);
98    
99     void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance);
100     void Finley_Mesh_joinFaces(Finley_Mesh* self,double safety_factor,double tolerance);
101    
102     int Finley_Mesh_findMatchingFaces_compar(const void*,const void*);
103     void Finley_Mesh_findMatchingFaces(Finley_NodeFile*,Finley_ElementFile *,double,double, int*, int*,int*,int*);
104     void Finley_Mesh_print(Finley_Mesh *in);
105     void Finley_Mesh_saveDX(const char *, Finley_Mesh *, escriptDataC*);
106    
107     #endif /* #ifndef INC_FINLEY_MESH */
108    
109     /*
110     * $Log$
111 jgs 100 * Revision 1.3 2004/12/15 03:48:45 jgs
112 jgs 97 * *** empty log message ***
113 jgs 82 *
114 jgs 97 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
115     * initial import of project esys2
116     *
117 jgs 82 * Revision 1.5 2004/07/27 08:26:45 gross
118     * Finley: saveDX added: now it is possible to write data on boundary and contact elements
119     *
120     * Revision 1.4 2004/07/26 04:27:15 gross
121     * it allmost compiles now
122     *
123     * Revision 1.3 2004/07/02 04:21:13 gross
124     * Finley C code has been included
125     *
126     * Revision 1.2 2004/07/02 00:03:29 gross
127     * interface for saveDX added
128     *
129     * Revision 1.1.1.1 2004/06/24 04:00:40 johng
130     * Initial version of eys using boost-python.
131     *
132     *
133     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26