27class NearNeighborState:
public State {
29 CkVec<pqSmoothNode> *Qs;
30 int nParticlesPending;
34 NearNeighborState(
int nParts,
int nSmooth) {
35 Qs =
new CkVec<pqSmoothNode>[nParts+2];
39 void finishBucketSmooth(
int iBucket,
TreePiece *tp);
40 ~NearNeighborState() {
45#include "smoothparams.h"
53class DensitySmoothParams :
public SmoothParams
65 DensitySmoothParams() {}
66 DensitySmoothParams(
int _iType,
int am) {
70 PUPable_decl(DensitySmoothParams);
71 DensitySmoothParams(CkMigrateMessage *m) : SmoothParams(m) {}
72 virtual void pup(PUP::er &p) {
78class SmoothCompute :
public Compute
89 globalSmoothParams = params;
102 Vector3D<double> offset,
112 bool &didcomp,
int awi);
113 void reassoc(
void *ce,
int ar,
Opt *o);
121class KNearestSmoothCompute :
public SmoothCompute
127 double dfBall2OverSoft2;
132 int iLhF,
double dfB2OS2)
133 : SmoothCompute(_tp, _params){
136 dfBall2OverSoft2 = dfB2OS2;
138 ~KNearestSmoothCompute() {
146 Vector3D<double> offset,
150 void initSmoothPrioQueue(
int iBucket,
State *state) ;
158 void walkDone(
State *state) ;
163 State *getNewState(
int d1);
165 State *getNewState(
int d1,
int d2) {
return 0;}
166 State *getNewState() {
return 0;}
173class ReNearNeighborState:
public State {
175 CkVec<pqSmoothNode> *Qs;
176 int nParticlesPending;
178 ReNearNeighborState(
int nParts) {
179 Qs =
new CkVec<pqSmoothNode>[nParts+2];
181 void finishBucketSmooth(
int iBucket,
TreePiece *tp);
182 ~ReNearNeighborState() {
delete [] Qs; }
186class ReSmoothCompute :
public SmoothCompute
200 Vector3D<double> offset,
224class MarkSmoothCompute :
public SmoothCompute
230 ~MarkSmoothCompute() {
238 Vector3D<double> offset,
249 void walkDone(
State *state) ;
254 State *getNewState(
int d1,
int d2) {
return 0;}
255 State *getNewState(
int d1);
256 State *getNewState() {
return 0;}
261class MarkNeighborState:
public State {
263 int nParticlesPending;
265 MarkNeighborState(
int nParts) {}
266 void finishBucketSmooth(
int iBucket,
TreePiece *tp);
267 ~MarkNeighborState() {}
273class SmoothOpt :
public Opt{
275 SmoothOpt() : Opt(Local){
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;
337inline 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);
370inline 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);
396inline 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);
424inline 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);
462inline 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;
483inline double dkernelM4(
double ar2)
491 adk = -0.75*(2.0-adk)*(2.0-adk)/adk;
506inline 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.
528inline double DKERNEL(
double ar2) {
530 return dkernelWendland(ar2);
532 return dkernelM6(ar2);
534 return dkernelM4(ar2);
536 #error No available kernel selected.
KeyType NodeKey
This key is the identification of a node inside the global tree, and it is unique for the node....
Definition GenericTreeNode.h:35
virtual void pup(PUP::er &p)
required method for remote entry call.
Definition smooth.h:72
Class for cross processor data needed for smooth operations.
Definition GravityParticle.h:649
Fundamental type for a particle.
Definition GravityParticle.h:364
cosmoType fBall
Neighbor search radius for smoothing.
Definition GravityParticle.h:387
void recvdParticlesFull(GravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Definition smooth.cpp:291
void bucketCompare(TreePiece *tp, GravityParticle *p, GenericTreeNode *node, GravityParticle *particles, Vector3D< double > offset, State *state)
Definition smooth.cpp:237
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition smooth.cpp:310
void startNodeProcessEvent(State *state)
Definition smooth.h:152
void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition smooth.h:153
int openCriterion(TreePiece *ownerTP, GenericTreeNode *node, int reqID, State *state)
Definition smooth.cpp:206
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition smooth.cpp:1122
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
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:243
void bucketCompare(TreePiece *tp, GravityParticle *p, GenericTreeNode *node, GravityParticle *particles, Vector3D< double > offset, State *state)
Definition smooth.cpp:1078
Base class for optimizing walk actions.
Definition Opt.h:12
int openCriterion(TreePiece *ownerTP, GenericTreeNode *node, int reqID, State *state)
Definition smooth.cpp:804
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(int d1, int d2)
default implementation
Definition smooth.h:218
void startNodeProcessEvent(State *state)
Definition smooth.h:205
void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition smooth.h:206
void walkDone(State *state)
execute SmoothParams::fcnSmooth() for all particles in the bucket.
Definition smooth.cpp:1017
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition smooth.cpp:889
State * getNewState()
default implementation
Definition smooth.h:220
void bucketCompare(TreePiece *tp, GravityParticle *p, GenericTreeNode *node, GravityParticle *particles, Vector3D< double > offset, State *state)
Definition smooth.cpp:832
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 nodeMissedEvent(int reqID, int chunk, State *state, TreePiece *tp)
Allow book-keeping of a cache miss.
Definition smooth.cpp:146
A base class from which parameters for all smooth operations can be derived.
Definition smoothparams.h:9
int iType
Particle type to smooth over; "TreeActive".
Definition smoothparams.h:11
virtual void pup(PUP::er &p)
required method for remote entry call.
Definition smoothparams.h:45
int activeRung
Currently active rung.
Definition smoothparams.h:12
Base class for maintaining the state of a tree walk.
Definition State.h:6
Fundamental structure that holds particle and tree data.
Definition ParallelGravity.h:755
Base class for walking trees.
Definition TreeWalk.h:11
Base class for tree nodes.
Definition GenericTreeNode.h:59
Object for priority queue entry.
Definition smooth.h:13