29 CkVec<pqSmoothNode> *Qs;
30 int nParticlesPending;
35 Qs =
new CkVec<pqSmoothNode>[nParts+2];
39 void finishBucketSmooth(
int iBucket,
TreePiece *tp);
45 #include "smoothparams.h"
72 virtual void pup(PUP::er &p) {
89 globalSmoothParams = params;
102 Vector3D<double> offset,
112 bool &didcomp,
int awi);
113 void reassoc(
void *ce,
int ar,
Opt *o);
127 double dfBall2OverSoft2;
132 int iLhF,
double dfB2OS2)
136 dfBall2OverSoft2 = dfB2OS2;
146 Vector3D<double> offset,
150 void initSmoothPrioQueue(
int iBucket,
State *state) ;
157 Tree::NodeKey &remoteBucket);
158 void walkDone(
State *state) ;
163 State *getNewState(
int d1);
165 State *getNewState(
int d1,
int d2) {
return 0;}
166 State *getNewState() {
return 0;}
175 CkVec<pqSmoothNode> *Qs;
176 int nParticlesPending;
179 Qs =
new CkVec<pqSmoothNode>[nParts+2];
181 void finishBucketSmooth(
int iBucket,
TreePiece *tp);
200 Vector3D<double> offset,
210 Tree::NodeKey &remoteBucket);
238 Vector3D<double> offset,
248 Tree::NodeKey &remoteBucket);
249 void walkDone(
State *state) ;
254 State *getNewState(
int d1,
int d2) {
return 0;}
255 State *getNewState(
int d1);
256 State *getNewState() {
return 0;}
263 int nParticlesPending;
266 void finishBucketSmooth(
int iBucket,
TreePiece *tp);
278 action_array[0][Internal] = DUMP;
279 action_array[0][Bucket] = DUMP;
281 action_array[0][Boundary] = DUMP;
282 action_array[0][NonLocal] = DUMP;
283 action_array[0][NonLocalBucket] = DUMP;
284 action_array[0][Cached] = DUMP;
285 action_array[0][CachedBucket] = DUMP;
287 action_array[0][Empty] = DUMP;
288 action_array[0][CachedEmpty] = DUMP;
289 action_array[0][Top] = ERROR;
290 action_array[0][Invalid] = ERROR;
294 action_array[1][Internal] = KEEP;
295 action_array[1][Bucket] = KEEP_LOCAL_BUCKET;
296 action_array[1][Boundary] = KEEP;
299 action_array[1][NonLocal] = KEEP;
300 action_array[1][NonLocalBucket] = KEEP_REMOTE_BUCKET;
301 action_array[1][CachedBucket] = KEEP_REMOTE_BUCKET;
302 action_array[1][Cached] = KEEP;
305 action_array[1][Empty] = DUMP;
306 action_array[1][CachedEmpty] = DUMP;
307 action_array[1][Top] = ERROR;
308 action_array[1][Invalid] = ERROR;
337 inline double kernelWendland(
double ar2,
int nSmooth)
342 ak = 2.0 - sqrt(ar2);
343 if (ar2 < 1.0) ak = (1.0 - 0.75*ak*ar2);
344 else ak = 0.25*ak*ak*ak;
347 if (ar2 <= 0) ak = (495/32./8.)*(1-0.01342*pow(nSmooth*0.01,-1.579));
349 double au = sqrt(ar2*0.25);
353 ak = (495/32./8.)*ak*(1+6*au+(35/3.)*au*au);
370 inline double dkernelWendland(
double ar2)
373 double _a2,au = sqrt(ar2*0.25);
376 adk = (-495/32.*7./3./4.)*_a2*_a2*adk*(1+5*au);
396 inline double kernelM6(
double ar2) {
397 double r = 0.5 * sqrt(ar2);
401 CkAssert(r <= 1.0000001);
404 w += -6. * pow(2./3. - r, 5);
406 w += 15. * pow(1./3. - r, 5);
424 inline double dkernelM6(
double ar2) {
425 double r = 0.5 * sqrt(ar2);
429 CkAssert(r <= 1.0000001);
430 dw = -5. * pow(1. - r, 4);
432 dw += 30. * pow(2./3. - r, 4);
438 dw += -75. * pow(1./3. - r, 4);
462 inline double kernelM4(
double ar2)
465 ak = 2.0 - sqrt(ar2);
466 if (ar2 < 1.0) ak = (1.0 - 0.75*ak*ar2);
467 else ak = 0.25*ak*ak*ak;
483 inline double dkernelM4(
double ar2)
491 adk = -0.75*(2.0-adk)*(2.0-adk)/adk;
506 inline double KERNEL(
double ar2,
int nSmooth) {
508 return kernelWendland(ar2, nSmooth);
510 return kernelM6(ar2);
512 return kernelM4(ar2);
514 #error No available kernel selected.
528 inline double DKERNEL(
double ar2) {
530 return dkernelWendland(ar2);
532 return dkernelM6(ar2);
534 return dkernelM4(ar2);
536 #error No available kernel selected.
Class for cross processor data needed for smooth operations.
Definition: GravityParticle.h:568
int doWork(GenericTreeNode *node, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi)
Work to be done at each node.
Definition: smooth.cpp:57
void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition: smooth.h:206
Base clase for all tree based computations.
Definition: Compute.h:26
void startNodeProcessEvent(State *state)
Definition: smooth.h:243
Computation over "inverse" nearest neighbors.
Definition: smooth.h:224
action optimization for the smooth walk.
Definition: smooth.h:273
void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition: smooth.h:153
void bucketCompare(TreePiece *tp, GravityParticle *p, GenericTreeNode *node, GravityParticle *particles, Vector3D< double > offset, State *state)
Definition: smooth.cpp:1078
void startNodeProcessEvent(State *state)
Definition: smooth.h:205
Base class for walking trees.
Definition: TreeWalk.h:11
void recvdParticlesFull(GravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Allow book-keeping of a cache receive event.
Definition: smooth.cpp:870
State * getNewState()
default implementation
Definition: smooth.h:220
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition: smooth.cpp:1122
virtual void pup(PUP::er &p)
required method for remote entry call.
Definition: smooth.h:72
State * getNewState(int d1, int d2)
default implementation
Definition: smooth.h:218
int iType
Particle type to smooth over; "TreeActive".
Definition: smoothparams.h:11
Object to bookkeep a Bucket MarkSmooth Walk.
Definition: smooth.h:261
Base class for tree nodes.
Definition: GenericTreeNode.h:59
Object for priority queue entry.
Definition: smooth.h:12
void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition: smooth.h:244
void startNodeProcessEvent(State *state)
Definition: smooth.h:152
Base class for maintaining the state of a tree walk.
Definition: State.h:6
int openCriterion(TreePiece *ownerTP, GenericTreeNode *node, int reqID, State *state)
Definition: smooth.cpp:804
virtual void pup(PUP::er &p)
required method for remote entry call.
Definition: smoothparams.h:45
void walkDone(State *state)
execute SmoothParams::fcnSmooth() for all particles in the bucket.
Definition: smooth.cpp:1017
Fundamental structure that holds particle and tree data.
Definition: ParallelGravity.h:730
void bucketCompare(TreePiece *tp, GravityParticle *p, GenericTreeNode *node, GravityParticle *particles, Vector3D< double > offset, State *state)
Definition: smooth.cpp:237
Object to bookkeep a Bucket Smooth Walk.
Definition: smooth.h:27
void recvdParticlesFull(GravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Definition: smooth.cpp:291
A base class from which parameters for all smooth operations can be derived.
Definition: smoothparams.h:8
Class for computation over a set smoothing length.
Definition: smooth.h:186
Class to specify density smooth.
Definition: smooth.h:53
void recvdParticlesFull(GravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Allow book-keeping of a cache receive event.
Definition: smooth.cpp:1103
Class for computation over k nearest neighbors.
Definition: smooth.h:121
Base class for optimizing walk actions.
Definition: Opt.h:12
int activeRung
Currently active rung.
Definition: smoothparams.h:12
Fundamental type for a particle.
Definition: GravityParticle.h:316
void nodeMissedEvent(int reqID, int chunk, State *state, TreePiece *tp)
Allow book-keeping of a cache miss.
Definition: smooth.cpp:146
Super class for Smooth and Resmooth computation.
Definition: smooth.h:78
double fBall
Neighbor search radius for smoothing.
Definition: GravityParticle.h:326
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition: smooth.cpp:889
int openCriterion(TreePiece *ownerTP, GenericTreeNode *node, int reqID, State *state)
Definition: smooth.cpp:206
void bucketCompare(TreePiece *tp, GravityParticle *p, GenericTreeNode *node, GravityParticle *particles, Vector3D< double > offset, State *state)
Definition: smooth.cpp:832
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition: smooth.cpp:310