forked from richiefhf2019/peridynamics_cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBond.h
96 lines (66 loc) · 2.34 KB
/
Bond.h
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
// Header ==> Function Declarations
#include<iostream>
#include<string>
//#include "PeriParticle.h"
#include "realtypes.h"
#include "Vec.h"
#include "Matrix.h"
#ifndef BOND_H
#define BOND_H
namespace periDynamics {
class PeriParticle;
class Bond {
public:
//-------------------------------------------------------------------------
// Default Constructor
Bond();
// Overload Constructor
Bond(REAL , PeriParticle* , PeriParticle* );
// Destructor
~Bond();
//-------------------------------------------------------------------------
// Accessor Functions
bool getIsAlive() const;
// getisAlive - returns state of the Bond
// @return - state of the Bond
REAL getWeight() const;
// getweight - returns weight of the Bond
// @return - weight of the Bond
REAL getInitLength() const;
// getinitLength - returns initial length of the Bond
// @return - initial length of the Bond
REAL getParticleVolume(bool) const;
Vec getXi(bool) const;
Vec getEta(bool) const;
Vec getEtaHalf(bool, const REAL) const;
PeriParticle* getPt1() const {return pt1;}
PeriParticle* getPt2() const {return pt2;}
Matrix getMicroK(const bool) const; // get the contribution of K from one single bond
Matrix getMicroN(const bool, const bool) const;
Matrix getMicroNHalf(const bool, const bool, const REAL) const;
Matrix getMicroNDeltaU(const bool, const bool, const REAL) const;
//-------------------------------------------------------------------------
// Mutator Functions
void setIsAlive(bool) ;
// setisAlive - sets state of the Bond
// @param - state of the Bond
void setWeight(REAL) ;
// setweight - sets weight of the Bond
// @param - weight of the Bond
void setInitLength(REAL);
// setinitLength - sets initial length of the Bond
// @param - initial length of the Bond
void setAliveFalse() {isAlive = false;}
//-------------------------------------------------------------------------
// Utility Functions
REAL calcCurrentLength();
private:
// Member Variables
bool isAlive; // if the Bond is alive or not
REAL weight; // influence function
REAL initLength; // initial Bond length
PeriParticle *pt1; // what for? store address of the particles it belongs to.
PeriParticle *pt2;
}; // end Bond
} // end periDynamics
#endif