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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years, 1 month ago) by ksteube
File MIME type: text/plain
File size: 7571 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 #ifndef INC_FINLEY_MESH
17 #define INC_FINLEY_MESH
18
19 /**************************************************************/
20
21 /* Finley: Mesh */
22
23 /* A mesh is built from nodes and elements which are describing the
24 domain, the surface and point sources. (the latter are needed to
25 establish links with other codes, in particular to particle
26 codes). The nodes are stored a Finley_NodeFile and elements in a
27 Finley_ElementFile. A Finley_NodeFile and three Finley_ElementFile
28 containing the elements describing the domain, surface and point
29 sources respectively. Notice that the surface elements do not
30 necessaryly cover the entire surface of the domain. */
31
32 /* The element type is fixed by the reference element, see
33 ReferenceElement.h. The numbering of the nodes starts with 0. */
34
35 /* Important: it is assumed that every node is appearing in at least
36 one element or surface element and that any node used in an
37 element, surface element or as a point is specified in the
38 Finley_Node, see also Finley_resolveNodeIds. */
39
40 /* In some cases it is useful to refer to a mesh entirly built from
41 order 1 (=linear) elements. The linear version of the mesh can be
42 accessed by referning to the first few nodes of each element
43 (thanks to the way the nodes are ordered). As the numbering of
44 these nodes is not continuous a relabeling vectors are introduced
45 in the Finley_NodeFile. This feature is not fully implemented
46 yet. */
47
48 /* allnodes and elements are tagged. the tag allows to group nodes and
49 elements. A typical application is to mark surface elements on a
50 certain portion of the domain with the same tag. All these surface
51 elements can then assigned the same value eg. for the pressure. */
52
53 /* Thespacial dimension is determined by the type of elements
54 used. The spacial dimension should be accessed by the function
55 Finley_Mesh_getDim. Notice that the element type also determines
56 the type of surface elements to be used. */
57
58 /**************************************************************/
59
60 #include "Finley.h"
61 #include "NodeFile.h"
62 #include "ElementFile.h"
63 #include "TagMap.h"
64 #include "Util.h"
65 #include "paso/SystemMatrixPattern.h"
66 #include "escript/DataC.h"
67
68 #ifdef PASO_MPI
69 #include "paso/Paso_MPI.h"
70 #endif
71
72 /**************************************************************/
73
74 /* this struct holds a mesh: */
75
76 struct Finley_Mesh {
77 char* Name; /* the name of the mesh */
78 index_t order; /* integration order */
79 index_t reduced_order; /* reduced integration order */
80 dim_t reference_counter; /* counts the number of references to the mesh; */
81 Finley_NodeFile* Nodes; /* the table of the nodes */
82 Finley_ElementFile* Elements; /* the table of the elements */
83 Finley_ElementFile* FaceElements; /* the table of the face elements */
84 Finley_ElementFile* ContactElements; /* the table of the contact elements */
85 Finley_ElementFile* Points; /* the table of points (treated as elements of dimension 0) */
86 Finley_TagMap* TagMap; /* the tag map mapping names to tag keys */
87
88 /* pointer to the sparse matrix pattern */
89
90 Paso_SystemMatrixPattern *FullFullPattern;
91 Paso_SystemMatrixPattern *FullReducedPattern;
92 Paso_SystemMatrixPattern *ReducedFullPattern;
93 Paso_SystemMatrixPattern *ReducedReducedPattern;
94 Paso_MPIInfo *MPIInfo;
95 };
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 index_t refId;
103 double x[MAX_numDim];
104 };
105 typedef struct Finley_Mesh_findMatchingFaces_center Finley_Mesh_findMatchingFaces_center;
106
107 /**************************************************************/
108
109 /* interfaces: */
110 Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order, index_t reduced_order, Paso_MPIInfo *mpi_info);
111 Finley_Mesh* Finley_Mesh_reference(Finley_Mesh*);
112 dim_t Finley_Mesh_getDim(Finley_Mesh*);
113 void Finley_Mesh_free(Finley_Mesh*);
114
115 void Finley_Mesh_addTagMap(Finley_Mesh *mesh_p,const char* name, index_t tag_key);
116 index_t Finley_Mesh_getTag(Finley_Mesh *mesh_p,const char* name);
117 bool_t Finley_Mesh_isValidTagName(Finley_Mesh *mesh_p,const char* name);
118 void Finley_Mesh_distributeByRankOfDOF(Finley_Mesh* in, dim_t *distribution);
119 Paso_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
120 Paso_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
121 void Finley_Mesh_write(Finley_Mesh*,char*);
122 void Finley_Mesh_dump(Finley_Mesh *in,char* fname);
123 Finley_Mesh* Finley_Mesh_load(char* fname);
124 Finley_Mesh* Finley_Mesh_read(char*,index_t, index_t, bool_t);
125 Finley_Mesh* Finley_Mesh_readGmsh(char*,index_t, index_t, index_t, bool_t);
126 void Finley_Mesh_setCoordinates(Finley_Mesh*,escriptDataC*);
127 void Finley_Mesh_setElements(Finley_Mesh* self,Finley_ElementFile *elements);
128 void Finley_Mesh_setFaceElements(Finley_Mesh* self,Finley_ElementFile *elements);
129 void Finley_Mesh_setContactElements(Finley_Mesh* self,Finley_ElementFile *elements);
130 void Finley_Mesh_setPoints(Finley_Mesh* self,Finley_ElementFile *elements);
131 void Finley_Mesh_optimizeDOFDistribution(Finley_Mesh* in,dim_t *distribution);
132 void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize);
133 void Finley_Mesh_createColoring(Finley_Mesh* in, index_t *node_localDOF_map);
134 void Finley_Mesh_optimizeElementOrdering(Finley_Mesh* in);
135 void Finley_Mesh_resolveNodeIds(Finley_Mesh*);
136 void Finley_Mesh_createMappings(Finley_Mesh* in, index_t *distribution);
137 void Finley_Mesh_createNodeFileMappings(Finley_Mesh* in, dim_t numReducedNodes, index_t* indexReducedNodes, index_t* dof_first_component);
138 void Finley_Mesh_markDOFsConnectedToRange(index_t* mask, index_t offset, index_t marker,index_t firstDOF,index_t lastDOF,Finley_Mesh* in, bool_t useLinear);
139
140 void Finley_Mesh_optimizeDOFLabeling(Finley_Mesh*,dim_t *);
141
142
143 Finley_Mesh* Finley_Mesh_merge(dim_t, Finley_Mesh**);
144
145 void Finley_Mesh_relableElementNodes(int*,int,Finley_Mesh*);
146 void Finley_Mesh_markNodes(int*,int,Finley_Mesh*,int);
147
148 void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
149 void Finley_Mesh_joinFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
150
151 int Finley_Mesh_findMatchingFaces_compar(const void*,const void*);
152 void Finley_Mesh_findMatchingFaces(Finley_NodeFile*,Finley_ElementFile *,double,double, int*, int*,int*,int*);
153 void Finley_Mesh_print(Finley_Mesh *in);
154 void Finley_Mesh_saveDX(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp);
155 void Finley_Mesh_optimizeNodeLabeling(Finley_Mesh* mesh_p);
156 dim_t Finley_Mesh_FindMinDegreeNode(Paso_SystemMatrixPattern* pattern_p,index_t* available,index_t indicator);
157 index_t Finley_Mesh_getDegree(Paso_SystemMatrixPattern* pattern_p, index_t *label);
158
159
160 void Finley_Mesh_saveVTK(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp);
161
162 #endif /* #ifndef INC_FINLEY_MESH */
163

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26