Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/netgen/libsrc/meshing/geomsearch.hpp
3206 views
1
#ifndef FILE_GEOMSEARCH
2
#define FILE_GEOMSEARCH
3
4
/**************************************************************************/
5
/* File: geomsearch.hh */
6
/* Author: Johannes Gerstmayr */
7
/* Date: 19. Nov. 97 */
8
/**************************************************************************/
9
10
class FrontPoint3;
11
class FrontFace;
12
class MiniElement2d;
13
14
/// class for quick access of 3D-elements; class cannot delete elements, but only append
15
class GeomSearch3d
16
{
17
18
public:
19
///
20
GeomSearch3d();
21
///
22
virtual ~GeomSearch3d();
23
24
///
25
void Init (ARRAY <FrontPoint3,PointIndex::BASE> *pointsi, ARRAY <FrontFace> *facesi);
26
27
///get elements max extension
28
void ElemMaxExt(Point3d& minp, Point3d& maxp, const MiniElement2d& elem);
29
30
///get minimum coordinates of two points ->p2
31
void MinCoords(const Point3d& p1, Point3d& p2);
32
33
///get minimum coordinates of two points ->p2
34
void MaxCoords(const Point3d& p1, Point3d& p2);
35
36
///create a hashtable from an existing array of triangles
37
///sizei = number of pieces in one direction
38
void Create();
39
40
///add new element to Hashtable
41
void AddElem(const MiniElement2d& elem, INDEX elemnum);
42
43
///GetLocal faces in sphere with radius xh and middlepoint p
44
void GetLocals(ARRAY<MiniElement2d> & locfaces, ARRAY<INDEX> & findex,
45
INDEX fstind, const Point3d& p0, double xh);
46
47
private:
48
49
ARRAY <FrontFace> *faces; // Pointers to Arrays in Adfront
50
ARRAY <FrontPoint3,PointIndex::BASE> *points;
51
52
ARRAY <ARRAY <int>*> hashtable;
53
54
Point3d minext; //extension of Hashdomain
55
Point3d maxext;
56
Point3d maxextreal;
57
Vec3d elemsize; //size of one Hash-Element
58
59
threeint size; // size of Hashtable in each direction
60
int reset;
61
int hashcount;
62
};
63
64
#endif
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