14 #ifndef ESYS_LSMGRIDITERATOR_H
15 #define ESYS_LSMGRIDITERATOR_H
64 minPt =
Vec3(0,0,0) + sphereRadius;
67 (numPtsX-1)*2.0*sphereRadius
84 (numPtsY-1)*(sphereRadius*2.0*sqrt(2.0/3.0)),
85 (numPtsZ-1)*(sphereRadius*sqrt(3.0))
87 ((numPtsY > 1) ? sphereRadius*sqrt(3.0)/3.0 : 0.0)
90 minPt =
Vec3(sphereRadius, sphereRadius, 0);
93 (numPtsX-1)*2.0*sphereRadius
101 (numPtsY-1)*(sphereRadius*sqrt(3.0)),
125 int numPtsX ,numPtsY ,numPtsZ;
127 numPtsX = max(1,
int(nearbyint((particleBBox.
getSizes().
X()-(sphereRadius/4.0))/(sphereRadius*2.0))));
128 numPtsY = max(1,
int(nearbyint(particleBBox.
getSizes().
Y()/(sphereRadius*2.0*sqrt(2.0/3.0)))));
129 numPtsZ = max(1,
int(nearbyint(particleBBox.
getSizes().
Z()/(sphereRadius*sqrt(3.0)))));
131 numPtsX = max(1,
int(floor((particleBBox.
getSizes().
X()-(sphereRadius/4.0))/(sphereRadius*2.0))));
132 numPtsY = max(1,
int(floor(particleBBox.
getSizes().
Y()/(sphereRadius*2.0*sqrt(2.0/3.0)))));
133 numPtsZ = max(1,
int(floor(particleBBox.
getSizes().
Z()/(sphereRadius*sqrt(3.0)))));
135 if ((numPtsZ > 1) && (numPtsY > 1)) {
139 const Vec3 minPt = particleBBox.
getMinPt() + sphereRadius;
142 (numPtsX-1)*2.0*sphereRadius + ((numPtsZ > 1) ? sphereRadius : 0.0) + ((numPtsY > 1) ? sphereRadius : 0.0),
143 (numPtsY-1)*(sphereRadius*2.0*sqrt(2.0/3.0)),
144 (numPtsZ-1)*(sphereRadius*sqrt(3.0))
146 ((numPtsY > 1) ? sphereRadius*sqrt(3.0)/3.0 : 0.0)
150 numPtsX = int(nearbyint((particleBBox.
getSizes().
X()-(sphereRadius/4.0))/(sphereRadius*2.0)));
151 numPtsY = int(nearbyint(particleBBox.
getSizes().
Y()/(sphereRadius*sqrt(3.0))));
158 (numPtsX-1)*2.0*sphereRadius + ((numPtsY > 1) ? sphereRadius : 0.0),
159 (numPtsY-1)*(sphereRadius*sqrt(3.0)),