Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/meshgen2d/src/include/Vertex.h
3203 views
1
#if !defined( MESH_VERTEX_H )
2
#define MESH_VERTEX_H
3
4
#include "TriangleElement.h"
5
6
#include <set>
7
8
class Node;
9
10
class Vertex : public TriangleElement
11
{
12
public:
13
Vertex();
14
Vertex( Node* n1, Node* n2, Node* n3 );
15
void reset( Node* n1, Node* n2, Node* n3 );
16
17
void setVertices(Vertex *v1, Vertex *v2, Vertex *v3);
18
void replaceVertexWith(const int ind, Vertex* vtx) { vertices[ind] = vtx; }
19
20
Vertex* firstAcceptableFound(double tx, double ty);
21
Vertex* vertexWith( Node* a, Node* b);
22
Vertex* vertexOwning( Node* a, Node* b);
23
int isDestroyedBy(double tx, double ty, bool extOK);
24
25
int id() const { return tag; }
26
27
bool isDeleted() { return deleted; }
28
void makeDeleted() { deleted = true; }
29
void unDelete() { deleted = false; }
30
31
void labelBodies( const int bd, std::set< std::pair< int, int > >& bounds );
32
33
bool isExternal() { return body == 0; }
34
35
bool rightSize( double ref )
36
{
37
const double DELTA = 1.25;
38
39
ratio = radius / ref;
40
if( ratio < DELTA ) return true;
41
return false;
42
}
43
44
virtual double orderingValue() { return ratio; }
45
46
bool isAtHeap() { return heap != -1; }
47
void setHeap( const int p ) { heap = p; }
48
int atHeap() { return heap; }
49
50
protected:
51
52
int tag;
53
54
double radius;
55
double ratio;
56
57
bool deleted;
58
59
int heap;
60
public:
61
62
Vertex *vertices[3];
63
double vx, vy;
64
};
65
66
#endif /* MESH_VERTEX_H */
67
68