-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsmoothparams.h
52 lines (51 loc) · 2.18 KB
/
smoothparams.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
#ifndef __SMOOTHPARAMS_H
#define __SMOOTHPARAMS_H
class pqSmoothNode;
class TreePiece;
/// @brief A base class from which parameters for all smooth
/// operations can be derived.
class SmoothParams : public PUP::able
{
public:
int iType; ///< Particle type to smooth over; "TreeActive"
int activeRung; ///< Currently active rung
TreePiece *tp;
int bUseBallMax; ///< limit fBall growth for bFastGas
/// Function to apply to smooth particle and neighbors
virtual void fcnSmooth(GravityParticle *p, int nSmooth, pqSmoothNode *nList) = 0;
/// Particle is doing a neighbor search
virtual int isSmoothActive(GravityParticle *p) = 0;
/// initialize particles to be smoothed
virtual void initSmoothParticle(GravityParticle *p) = 0;
/// initialize particles in tree but not smoothed
virtual void initTreeParticle(GravityParticle *p) = 0;
/// calculation on all tree particles after all walks are done
virtual void postTreeParticle(GravityParticle *p) = 0;
/// @brief initialize particles as they come into the cache
/// @param p pointer to incoming particle data from remote processor
virtual void initSmoothCache(GravityParticle *p) = 0;
/// @brief combine cache copy with home particle
/// @param p1 pointer to "home" particle data
/// @param p2 pointer to particle data being flushed back from a
/// remote treepiece.
///
/// This method enables commutative/associative operations to be
/// performed on remote data by combining data accumulated by a
/// remote processor in p2 with the data on the home particle, p1.
/// Any accumulators used in this function should be initialized
/// in initSmoothCache() to avoid double counting.
virtual void combSmoothCache(GravityParticle *p1,
ExternalSmoothParticle *p2) = 0;
// limit ball growth by default
SmoothParams() { bUseBallMax = 1; tp = NULL; }
PUPable_abstract(SmoothParams);
SmoothParams(CkMigrateMessage *m) : PUP::able(m) { tp = NULL; }
/// required method for remote entry call.
virtual void pup(PUP::er &p) {
PUP::able::pup(p);//Call base class
p|iType;
p|activeRung;
p|bUseBallMax;
}
};
#endif