-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPeriParticle.h
106 lines (79 loc) · 3.53 KB
/
PeriParticle.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
97
98
99
100
101
102
103
104
105
106
// Header ==> Function Declarations
#pragma once
#include <iostream>
#include <vector>
#include "Bond.h"
#include "Vec.h"
#include "Matrix.h"
#include "realtypes.h"
#include "globfuncs.h"
#include "PeriMaterialModel.h"
#ifndef PERIPARTICLE_H
#define PERIPARTICLE_H
namespace periDynamics{
class PeriDomain;
class PeriParticle {
public:
// Default Constructor
PeriParticle();
PeriParticle(REAL x, REAL y, REAL z);
~PeriParticle();
//void calcKinv(); // calculate Matrix the inverse of K Matrix
//void calcAcceleration(); // calculate the acceleration of the particle
//void calcStress(); // calculate stress
void setParticleVolume(REAL newParticleVolume);
// setParticleVolume - sets the volume of the particle
// @param newParticleVolume - volume of the particle
REAL getParticleVolume() const {return particleVolume;}
REAL getHorizonSize() const {return horizonSize;}
Vec getInitPosition() const {return initPosition;}
Vec getDisplacement() const {return displacement;}
Vec getVelocity() const {return velocity;}
bool getIsAlive() const {return isAlive;}
Matrix getSigma() const {return sigma;}
Matrix getDeformationGradient() const {return deformationGradient;}
Matrix getParticleKinv() const {return Kinv;}
Matrix getIsv() const {return isv;}
Vec getVelocityHalf() const {return velocityHalf;}
Vec getAcceleration() const {return acceleration;}
void checkParticleAlive(REAL);
void replaceHorizonSizeIfLarger(REAL tmp); // replace this->horizonSize if tmp is larger
void prescribeBottomDisplacement(REAL disp ) {displacement.setz(disp); velocity.setz(0.0);}
void prescribeTopDisplacement(REAL disp) {displacement.setz(disp);}
void setInitVelocity(const Vec& tmp) {velocity = tmp;}
void setInitIsv(REAL isv_tmp) {isv(1,1) = isv_tmp;}
void setAcceleration(Vec newAcceleration) {acceleration = newAcceleration;}
// void pushBackNeighborVec(PeriParticle* pt) {neighborVec.push_back(pt);}
void pushBackBondVec(Bond* bt) {bondVec.push_back(bt);}
void setAliveFalse() {isAlive = false;}
void setStressZero() {sigma = zeros(3,3);}
void setAccelerationZero() {acceleration = 0;}
void setParticleKinv(Matrix& tmp) {Kinv = tmp;}
void calcParticleKinv();
void calcParticleStress(const PeriMaterialModel*);
void calcParticleAcceleration(const REAL);
void updateDisplacement(const REAL); // update displacement and velocityHalf
void updateVelocity(const REAL); // update velocity
void initial();
// initial displacement, velocity and acceleration
private:
bool isAlive; // if the peri-particle is alive
//REAL particleDensity; // particle density ==> defined globally, same material, usually
//dem::Vec currPosition; // current position vector of particle, no need, save spaces
Vec initPosition; // initial position vector of particle
REAL particleVolume; // particle volume
Vec displacement; // particle displacement
Vec velocity; // particle velocity
Vec velocityHalf; // velocity at half time-step, for Velocity-Verlet integration
Vec acceleration; // particle acceleration
Matrix sigma; // Cauchy stress
Matrix deformationGradient;// deformation gradient tensor
Matrix deformationGradientHalf;
Matrix Kinv; // the inverse K Matrix
Matrix isv; // a 1x5 matrix
REAL horizonSize; // used to get neighbor list
// std::vector<PeriParticle*> neighborVec; // neighbor list of this particle
std::vector<Bond*> bondVec; // Bonds connected to this particle
}; // end particle
} // end periDynamics
#endif