-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsolid.h
112 lines (107 loc) · 2.14 KB
/
solid.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
107
108
109
110
111
#ifndef SOLID_2D_H
#define SOLID_2D_H
#include "units.h"
struct Bond{
int size;
int *first;
int *next;
double *L0;
public:
Bond(){size=0;
first=NULL;next=NULL;L0=NULL;
}
Bond(int size_){
size = size_;
first = new int[size];
next = new int[size];
L0 = new double[size];
}
Bond& operator=(const Bond& rhs){
if (this !=&rhs){
delete [] first;
delete [] next;
delete [] L0;
size = rhs.size;
first = new int[size];
next = new int[size];
L0 = new double[size];
for (int i=0;i<size;i++){
first[i]=rhs.first[i];
next[i]=rhs.next[i];
L0[i]=rhs.L0[i];
}
}
return *this;
}
~Bond(){
delete [] first;
delete [] next;
delete [] L0;
}
};
struct Angle{
int size;
int *left;
int *middle;
int *right;
double *ang0;
public:
Angle(){size=0;
left=NULL;middle=NULL;right=NULL;ang0=NULL;
}
Angle(int size_){
size = size_;
left = new int[size];
middle = new int[size];
right = new int[size];
ang0 = new double[size];
}
Angle& operator=(const Angle& rhs){
if (this !=&rhs){
delete [] left;
delete [] middle;
delete [] right;
delete [] ang0;
size = rhs.size;
left = new int[size];
middle = new int[size];
right = new int[size];
ang0 = new double[size];
for (int i=0;i<size;i++){
left[i]=rhs.left[i];
middle[i]=rhs.middle[i];
right[i]=rhs.right[i];
ang0[i]=rhs.ang0[i];
}
}
return *this;
}
~Angle(){
delete [] left;
delete [] right;
delete [] middle;
delete [] ang0;
}
};
class Solid{
public:
int nn;//totoal number of solid nodes;
int ns;//# of solid strucutes, e.g., cells
int lx,ly; // fluid domain size
double *x;
double *v;
//double xc[2];
double *xc;
double *force;
public:
Solid();
virtual ~Solid();
/*virtual void readInput(const std::string filename)=0;
virtual void computeForce()=0;
virtual void init()=0;
virtual void nondimension(const Units&)=0;
virtual void updateHalf()=0;
virtual void update()=0;
*/
};
#endif