-
Notifications
You must be signed in to change notification settings - Fork 0
/
Atom.h
62 lines (48 loc) · 2.01 KB
/
Atom.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
#ifndef _ATOM_H_
#define _ATOM_H_
#include <memory>
#include <vector>
#include "Type.h"
#include "InputManager.h"
namespace Hamilton_Space {
struct Box
{
std::vector<std::vector<HS_float> > range;
std::vector<HS_float> length;
};
class Atom
{
public:
Atom(std::shared_ptr<InputManager> input);
~Atom();
void genInitialConfig(std::shared_ptr<InputManager> input);
void clearGhost();
void packSendAtoms(int first, int last, int dim, HS_float lo, HS_float hi, int pbcFlag, int* count, HS_float* buffer, int* sendList);
void unpackRecvAtoms(int count, HS_float* buffer);
void packExchange(HS_float* buffer, int* count, int dimDirectionIndex);
void unpackExchange(int count, HS_float* buffer);
void packCommunicateGhosts(int count, int dim, int pbcFlag, HS_float* buffer, int* sendlist);
void unpackCommunicateGhosts(int count, int startIndex, HS_float* buffer);
void packReverseCommunication(int count, int startIndex, HS_float* buffer);
void unpackReverseCommunication(int count, int* sendlist, HS_float* buffer);
void packSendAtomsRCB(int first, int last, int dim, HS_float* lo, HS_float* hi, int pbcFlag, int* count, HS_float* buffer, int* sendList);
void packExchangeRCB(std::vector<HS_float*> &, std::vector<int> &, int dim, RCBTreeNode* tree);
void unpackExchangeRCB(std::vector<HS_float*> &, std::vector<int> &, int);
void swap(int i, int j);
void enforcePBC();
int findParticleInRCBTree(std::vector<HS_float> x, RCBTreeNode* tree, int start, int end);
void printFrame(); // For Test
void propagate(); // For Test
public:
int nall; // total number of atoms
int nlocal, nghost; // nlocal->number of host atoms, nghost->number of ghost atoms
int natoms; // total number of atoms in the system
HS_float mass; // For Lennard-Jones Particle with uniform mass
Box box;
int nprocs;
std::vector<std::vector<HS_float> > x;
std::vector<std::vector<HS_float> > v;
std::vector<std::vector<HS_float> > f;
};
}
#endif