-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMesh.hh
154 lines (141 loc) · 5.17 KB
/
Mesh.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**********************************************************************
* *
* File Name: Mesh.hh *
* *
* Class Name: Mesh *
* *
* Goal: Compute and store all the mesh related data *
* *
* Copyright (C) 04/2002 Arthur Moncorge *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, *
* MA 02111-1307, USA. *
* *
*********************************************************************/
#ifndef _CLASS_MESH_HH_
#define _CLASS_MESH_HH_
#include"mylibrary.hh"
class Mesh
{
public:
//! holds information about each segment(edge) in the mesh
struct Edge{
//! the edge number of the segment(edge)
int n;
//! node number that makes up one end of the segment
int vertex1;
//! node number that makes up one end of the segment
int vertex2;
//! this is the number of the triangle that the segment(edge) is a part of
int k;
//! not sure but it is set to -1 in Mesh::meshEdge
int l;
//! ?? the segment(edge) number[0-2] of the edge in the triangle when encounterd first used in advection routine
int kseg;
//! ?? the segment(edge) number[0-2] of the edge in the triangle when encounterd second used in advection routine
int lseg;
//! length of the segment
double length;
//! refrence value of the segment
int Ref;
//! used during setting of the edges in Mesh::meshEdge
/*! is seems to provide some kind of unique id to each segment
* it is used only in Mesh::meshEdge and is not seen again
*/
double xp;
//! used during setting of the edges in Mesh::meshEdge
double yp;
};
//! struct used to pass information about mesh arround
/*! This structure holds information about the mesh. It is passed back to
* the Prog class and is used to initilise the MixHy class
*/
struct mesh_data{
int Np;
int Nt;
int Ne;
double hmin;
double hmax;
int* Refp;
double* Coorp;
int* Coort;
int** Coore;
double* area;
double* SumMass;
double** invMl;
double*** invM;
double*** Al;
double** Ihat;
double** Ixhat;
double** Iyhat;
double** IyRT;
struct Edge*** T_edge;
struct Edge** edge;
int segINJE;
int segPROD;
int segLEAK;
int segBORD;
double total_area;
};
public:
Mesh(char* meshfile);
~Mesh();
void meshRead(FILE* fd);
//! build up data structures that describe the segments(edges) of the mesh
/*! The member function loops through all the triangles and all the
possible segments and compiles information needed later in the
advection and other computations
specifically T_edges edges Coore and Ne are initialized
*/
void meshEdge();
//! this is an internal use function used by meshRead
void increase_array(int size, double** cx, double** cy);
//! compute arrays used in matrix calculations
/*! For each triangle, this subroutine computes matrices that will
* be use to build the matrices of the Poisson solver or the Darcy's
* law */
void meshCompute();
void test_orientation(int k);
//! return information about the mesh
void get(struct mesh_data *mesh_val);
public:
int Np;
int Nt;
int Ne;
double hmin;
double hmax;
int* Refp;
double* Coorp;
int* Coort;
int** Coore;
double* area;
double* SumMass;
double** invMl;
double*** invM;
double*** Al;
double** Ihat;
double** Ixhat;
double** Iyhat;
double** IyRT;
struct Edge*** T_edge; // (Edge*)[Nt][3] ptr on triangle edges
struct Edge** edge; // (Edge*)[Ne] ptr on edges
int segINJE;
int segPROD;
int segLEAK;
int segBORD;
double total_area;
};
#endif // End of _CLASS_MESH_HH_