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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2856 - (hide annotations)
Mon Jan 18 04:14:37 2010 UTC (9 years, 8 months ago) by gross
File MIME type: text/plain
File size: 7857 byte(s)
FunctionSpaces provide now some information about their approximation order.
1 jgs 82
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1312
14 ksteube 1811
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 ksteube 1312 #include "Util.h"
64 robwdcock 682 #include "paso/SystemMatrixPattern.h"
65     #include "escript/DataC.h"
66 jgs 82
67 bcumming 730 #ifdef PASO_MPI
68     #include "paso/Paso_MPI.h"
69     #endif
70    
71 jgs 82 /**************************************************************/
72    
73     /* this struct holds a mesh: */
74    
75     struct Finley_Mesh {
76     char* Name; /* the name of the mesh */
77 jgs 123 dim_t reference_counter; /* counts the number of references to the mesh; */
78 gross 2856 dim_t approximationOrder;
79     dim_t reducedApproximationOrder;
80     dim_t integrationOrder;
81     dim_t reducedIntegrationOrder;
82 jgs 82 Finley_NodeFile* Nodes; /* the table of the nodes */
83     Finley_ElementFile* Elements; /* the table of the elements */
84     Finley_ElementFile* FaceElements; /* the table of the face elements */
85     Finley_ElementFile* ContactElements; /* the table of the contact elements */
86     Finley_ElementFile* Points; /* the table of points (treated as elements of dimension 0) */
87 gross 1044 Finley_TagMap* TagMap; /* the tag map mapping names to tag keys */
88 jgs 102
89     /* pointer to the sparse matrix pattern */
90    
91 jgs 150 Paso_SystemMatrixPattern *FullFullPattern;
92     Paso_SystemMatrixPattern *FullReducedPattern;
93     Paso_SystemMatrixPattern *ReducedFullPattern;
94     Paso_SystemMatrixPattern *ReducedReducedPattern;
95 bcumming 730 Paso_MPIInfo *MPIInfo;
96 jgs 82 };
97    
98     typedef struct Finley_Mesh Finley_Mesh;
99    
100     /* these structures are used for matching surfaces elements: */
101    
102     struct Finley_Mesh_findMatchingFaces_center{
103 jgs 123 index_t refId;
104 jgs 82 double x[MAX_numDim];
105     };
106     typedef struct Finley_Mesh_findMatchingFaces_center Finley_Mesh_findMatchingFaces_center;
107    
108     /**************************************************************/
109    
110     /* interfaces: */
111 gross 2856 Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, Paso_MPIInfo *mpi_info);
112 jgs 102 Finley_Mesh* Finley_Mesh_reference(Finley_Mesh*);
113 jgs 123 dim_t Finley_Mesh_getDim(Finley_Mesh*);
114 ksteube 1312 void Finley_Mesh_free(Finley_Mesh*);
115    
116     void Finley_Mesh_addTagMap(Finley_Mesh *mesh_p,const char* name, index_t tag_key);
117     index_t Finley_Mesh_getTag(Finley_Mesh *mesh_p,const char* name);
118     bool_t Finley_Mesh_isValidTagName(Finley_Mesh *mesh_p,const char* name);
119     void Finley_Mesh_distributeByRankOfDOF(Finley_Mesh* in, dim_t *distribution);
120 jgs 150 Paso_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
121     Paso_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
122 jgs 82 void Finley_Mesh_write(Finley_Mesh*,char*);
123 ksteube 1312 void Finley_Mesh_dump(Finley_Mesh *in,char* fname);
124 ksteube 1339 void Finley_PrintMesh_Info(Finley_Mesh *, bool_t);
125 ksteube 1312 Finley_Mesh* Finley_Mesh_load(char* fname);
126 gross 1062 Finley_Mesh* Finley_Mesh_read(char*,index_t, index_t, bool_t);
127 gross 2722 Finley_Mesh* Finley_Mesh_readGmsh(char*,index_t, index_t, index_t, bool_t, bool_t);
128 gross 2856 void Mesh_setOrders(Finley_Mesh *in);
129 gross 2748
130 gross 532 void Finley_Mesh_setCoordinates(Finley_Mesh*,escriptDataC*);
131 ksteube 1312 void Finley_Mesh_setElements(Finley_Mesh* self,Finley_ElementFile *elements);
132     void Finley_Mesh_setFaceElements(Finley_Mesh* self,Finley_ElementFile *elements);
133     void Finley_Mesh_setContactElements(Finley_Mesh* self,Finley_ElementFile *elements);
134     void Finley_Mesh_setPoints(Finley_Mesh* self,Finley_ElementFile *elements);
135 gross 2748
136 ksteube 1312 void Finley_Mesh_optimizeDOFDistribution(Finley_Mesh* in,dim_t *distribution);
137     void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize);
138     void Finley_Mesh_createColoring(Finley_Mesh* in, index_t *node_localDOF_map);
139     void Finley_Mesh_optimizeElementOrdering(Finley_Mesh* in);
140     void Finley_Mesh_resolveNodeIds(Finley_Mesh*);
141 gross 1749 void Finley_Mesh_createMappings(Finley_Mesh* in, index_t *dof_distribution, index_t *node_distribution);
142     void Finley_Mesh_createNodeFileMappings(Finley_Mesh* in, dim_t numReducedNodes, index_t* indexReducedNodes, index_t* dof_first_component, index_t* nodes_first_component);
143 ksteube 1312 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);
144 jgs 82
145 ksteube 1312 void Finley_Mesh_optimizeDOFLabeling(Finley_Mesh*,dim_t *);
146    
147    
148 jgs 123 Finley_Mesh* Finley_Mesh_merge(dim_t, Finley_Mesh**);
149 jgs 82
150     void Finley_Mesh_relableElementNodes(int*,int,Finley_Mesh*);
151     void Finley_Mesh_markNodes(int*,int,Finley_Mesh*,int);
152    
153 gross 1062 void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
154     void Finley_Mesh_joinFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
155 jgs 82
156     int Finley_Mesh_findMatchingFaces_compar(const void*,const void*);
157     void Finley_Mesh_findMatchingFaces(Finley_NodeFile*,Finley_ElementFile *,double,double, int*, int*,int*,int*);
158     void Finley_Mesh_print(Finley_Mesh *in);
159 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);
160 gross 1156 void Finley_Mesh_optimizeNodeLabeling(Finley_Mesh* mesh_p);
161 gross 1171 dim_t Finley_Mesh_FindMinDegreeNode(Paso_SystemMatrixPattern* pattern_p,index_t* available,index_t indicator);
162     index_t Finley_Mesh_getDegree(Paso_SystemMatrixPattern* pattern_p, index_t *label);
163 jgs 82
164 gross 2421 void Finley_Mesh_saveVTK(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp, const char* metadata, const char*metadata_schema);
165 gross 1716 void Finley_Mesh_setTagsInUse(Finley_Mesh* in);
166 dhawcroft 793
167 gross 2533 int Finley_Mesh_getStatus(Finley_Mesh* in);
168    
169 jgs 82 #endif /* #ifndef INC_FINLEY_MESH */
170 jgs 123

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26