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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1171 - (hide annotations)
Fri May 25 06:55:05 2007 UTC (12 years, 5 months ago) by gross
File MIME type: text/plain
File size: 7493 byte(s)
some modifications to the tests to consider the new integration schemes for tri and tet
1 jgs 150 /*
2 elspeth 626 ************************************************************
3     * Copyright 2006 by ACcESS MNRF *
4     * *
5     * http://www.access.edu.au *
6     * Primary Business: Queensland, Australia *
7     * Licensed under the Open Software License version 3.0 *
8     * http://www.opensource.org/licenses/osl-3.0.php *
9     * *
10     ************************************************************
11 jgs 150 */
12     /* Version: $Id$ */
13 jgs 82
14 jgs 150
15 jgs 82 #ifndef INC_FINLEY_MESH
16     #define INC_FINLEY_MESH
17    
18     /**************************************************************/
19    
20     /* Finley: Mesh */
21    
22     /* A mesh is built from nodes and elements which are describing the
23     domain, the surface and point sources. (the latter are needed to
24     establish links with other codes, in particular to particle
25     codes). The nodes are stored a Finley_NodeFile and elements in a
26     Finley_ElementFile. A Finley_NodeFile and three Finley_ElementFile
27     containing the elements describing the domain, surface and point
28     sources respectively. Notice that the surface elements do not
29     necessaryly cover the entire surface of the domain. */
30    
31     /* The element type is fixed by the reference element, see
32     ReferenceElement.h. The numbering of the nodes starts with 0. */
33    
34     /* Important: it is assumed that every node is appearing in at least
35     one element or surface element and that any node used in an
36     element, surface element or as a point is specified in the
37     Finley_Node, see also Finley_resolveNodeIds. */
38    
39     /* In some cases it is useful to refer to a mesh entirly built from
40     order 1 (=linear) elements. The linear version of the mesh can be
41     accessed by referning to the first few nodes of each element
42     (thanks to the way the nodes are ordered). As the numbering of
43     these nodes is not continuous a relabeling vectors are introduced
44     in the Finley_NodeFile. This feature is not fully implemented
45     yet. */
46    
47     /* allnodes and elements are tagged. the tag allows to group nodes and
48     elements. A typical application is to mark surface elements on a
49     certain portion of the domain with the same tag. All these surface
50     elements can then assigned the same value eg. for the pressure. */
51    
52     /* Thespacial dimension is determined by the type of elements
53     used. The spacial dimension should be accessed by the function
54     Finley_Mesh_getDim. Notice that the element type also determines
55     the type of surface elements to be used. */
56    
57     /**************************************************************/
58    
59 jgs 150 #include "Finley.h"
60 jgs 82 #include "NodeFile.h"
61     #include "ElementFile.h"
62 gross 1044 #include "TagMap.h"
63 robwdcock 682 #include "paso/SystemMatrixPattern.h"
64     #include "escript/DataC.h"
65 jgs 82
66 bcumming 730 #ifdef PASO_MPI
67     #include "paso/Paso_MPI.h"
68     #endif
69    
70 jgs 82 /**************************************************************/
71    
72     /* this struct holds a mesh: */
73    
74     struct Finley_Mesh {
75     char* Name; /* the name of the mesh */
76 gross 964 index_t order; /* integration order */
77 gross 1062 index_t reduced_order; /* reduced integration order */
78 jgs 123 dim_t reference_counter; /* counts the number of references to the mesh; */
79 jgs 82 Finley_NodeFile* Nodes; /* the table of the nodes */
80     Finley_ElementFile* Elements; /* the table of the elements */
81     Finley_ElementFile* FaceElements; /* the table of the face elements */
82     Finley_ElementFile* ContactElements; /* the table of the contact elements */
83     Finley_ElementFile* Points; /* the table of points (treated as elements of dimension 0) */
84 gross 1044 Finley_TagMap* TagMap; /* the tag map mapping names to tag keys */
85 jgs 102
86     /* pointer to the sparse matrix pattern */
87    
88 jgs 150 Paso_SystemMatrixPattern *FullFullPattern;
89     Paso_SystemMatrixPattern *FullReducedPattern;
90     Paso_SystemMatrixPattern *ReducedFullPattern;
91     Paso_SystemMatrixPattern *ReducedReducedPattern;
92 ksteube 971 #ifdef PASO_MPI
93 bcumming 730 Paso_MPIInfo *MPIInfo;
94 ksteube 971 #endif
95 jgs 82 };
96    
97     typedef struct Finley_Mesh Finley_Mesh;
98    
99     /* these structures are used for matching surfaces elements: */
100    
101     struct Finley_Mesh_findMatchingFaces_center{
102 jgs 123 index_t refId;
103 jgs 82 double x[MAX_numDim];
104     };
105     typedef struct Finley_Mesh_findMatchingFaces_center Finley_Mesh_findMatchingFaces_center;
106    
107     /**************************************************************/
108    
109     /* interfaces: */
110 bcumming 730 #ifndef PASO_MPI
111 gross 1062 Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order, index_t reduced_order);
112 bcumming 730 #else
113 gross 1062 Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order, index_t reduced_order, Paso_MPIInfo *mpi_info);
114 bcumming 782 void Finley_Mesh_resolveDegreeOfFreedomOrder( Finley_Mesh *in, bool_t doReduced );
115     void print_mesh_statistics( Finley_Mesh *out, bool_t reduced );
116 gross 1028 #endif
117 bcumming 788 void Finley_Mesh_prepareElementDistribution( Finley_Mesh *in );
118 bcumming 730 /*Finley_Mesh* Finley_Mesh_alloc(char*,int,int);*/
119 jgs 102 Finley_Mesh* Finley_Mesh_reference(Finley_Mesh*);
120 jgs 82 void Finley_Mesh_dealloc(Finley_Mesh*);
121 jgs 123 dim_t Finley_Mesh_getDim(Finley_Mesh*);
122     dim_t Finley_Mesh_getNumNodes(Finley_Mesh*);
123     dim_t Finley_Mesh_getNumDegreesOfFreedom(Finley_Mesh*);
124     dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh*);
125 jgs 150 Paso_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
126     Paso_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
127 jgs 82 void Finley_Mesh_write(Finley_Mesh*,char*);
128 gross 1062 Finley_Mesh* Finley_Mesh_read(char*,index_t, index_t, bool_t);
129 gross 934 Finley_Mesh* Finley_Mesh_readGmsh(char*,index_t, index_t, index_t, bool_t);
130 gross 532 void Finley_Mesh_setCoordinates(Finley_Mesh*,escriptDataC*);
131 jgs 82
132     void Finley_Mesh_prepare(Finley_Mesh* in);
133 gross 964 bool_t Finley_Mesh_isPrepared(Finley_Mesh*);
134 jgs 82 void Finley_Mesh_prepareNodes(Finley_Mesh* in);
135     void Finley_Mesh_improveColoring(Finley_Mesh* in);
136     void Finley_Mesh_optimizeElementDistribution(Finley_Mesh* in);
137     void Finley_Mesh_resolveNodeIds(Finley_Mesh*);
138 jgs 123 Finley_Mesh* Finley_Mesh_merge(dim_t, Finley_Mesh**);
139 jgs 82
140     void Finley_Mesh_relableElementNodes(int*,int,Finley_Mesh*);
141     void Finley_Mesh_markNodes(int*,int,Finley_Mesh*,int);
142    
143 gross 1062 void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
144     void Finley_Mesh_joinFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
145 jgs 82
146     int Finley_Mesh_findMatchingFaces_compar(const void*,const void*);
147     void Finley_Mesh_findMatchingFaces(Finley_NodeFile*,Finley_ElementFile *,double,double, int*, int*,int*,int*);
148     void Finley_Mesh_print(Finley_Mesh *in);
149 jgs 153 void Finley_Mesh_saveDX(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp);
150 dhawcroft 793 #ifndef PASO_MPI
151 jgs 153 void Finley_Mesh_saveVTK(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp);
152 dhawcroft 793 #else
153     void Finley_Mesh_saveVTK_MPIO(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char*
154     *names_p,escriptDataC* *data_pp);
155     #endif
156 gross 1044 void Finley_Mesh_addTagMap(Finley_Mesh *mesh_p,const char* name, index_t tag_key);
157     index_t Finley_Mesh_getTag(Finley_Mesh *mesh_p,const char* name);
158     bool_t Finley_Mesh_isValidTagName(Finley_Mesh *mesh_p,const char* name);
159 gross 1156 void Finley_Mesh_optimizeNodeLabeling(Finley_Mesh* mesh_p);
160 gross 1171 dim_t Finley_Mesh_FindMinDegreeNode(Paso_SystemMatrixPattern* pattern_p,index_t* available,index_t indicator);
161     index_t Finley_Mesh_getDegree(Paso_SystemMatrixPattern* pattern_p, index_t *label);
162 jgs 82
163 dhawcroft 793
164    
165 jgs 82 #endif /* #ifndef INC_FINLEY_MESH */
166 jgs 123

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26