13#ifndef VOROPP_C_LOOPS_HH
14#define VOROPP_C_LOOPS_HH
70 inline void add(
int ijk,
int q) {
71 if(
op==
o+
size) add_ordering_memory();
72 *(
op++)=ijk;*(
op++)=q;
75 void add_ordering_memory();
130 template<
class c_
class>
137 inline void pos(
double &
x,
double &
y,
double &
z) {
148 inline void pos(
int &
pid,
double &
x,
double &
y,
double &
z,
double &r) {
177 template<
class c_
class>
184 while(
co[
ijk]==0)
if(!next_block())
return false;
195 if(!next_block())
return false;
205 inline bool next_block() {
227 template<
class c_
class>
240 while(
co[
ijk]==0)
if(!next_block())
return false;
259 if(!next_block())
return false;
265 int ijk_start = 0, ijk_stop = 0;
271 inline bool next_block() {
273 if (
ijk >= ijk_stop)
return false;
300 template<
class c_
class>
302 sx(con.bx-ax), sy(con.by-ay), sz(con.bz-az), xsp(con.xsp), ysp(con.ysp), zsp(con.zsp),
303 xperiodic(con.xperiodic), yperiodic(con.yperiodic), zperiodic(con.zperiodic) {}
314 while(
q>=
co[
ijk]) {
q=0;
if(!next_block())
return false;}
319 const double ax,ay,az,sx,sy,sz,xsp,ysp,zsp;
320 double px,py,pz,apx,apy,apz;
321 double v0,v1,v2,v3,v4,v5;
322 int ai,bi,aj,bj,ak,bk;
323 int ci,cj,ck,di,dj,dk,inc1,inc2;
324 const bool xperiodic,yperiodic,zperiodic;
325 inline int step_mod(
int a,
int b)
const {
return a>=0?a%b:b-1-(b-1-a)%b;}
326 inline int step_div(
int a,
int b)
const {
return a>=0?a/b:-1+(a+1)/b;}
327 inline int step_int(
double a)
const {
return a<0?
int(a)-1:
int(a);}
330 bool out_of_bounds();
354 template<
class c_
class>
363 ijk=*(
cp++);decode();
372 if(
cp==
op)
return false;
373 ijk=*(
cp++);decode();
384 inline void decode() {
403 template<
class c_
class>
405 ijk0(
nx*(ey+con.
oy*ez)), inc2(2*
nx*con.ey+1) {}
415 while(
co[
ijk]==0)
if(!next_block())
return false;
426 if(!next_block())
return false;
454 inline bool next_block() {
460 if(
k==wz)
return false;
489 template<
class c_
class>
498 ijk=*(
cp++);decode();
507 if(
cp==
op)
return false;
508 ijk=*(
cp++);decode();
519 inline void decode() {
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
A class for looping over all particles in a container_periodic or container_periodic_poly class.
Definition c_loops.hh:398
c_loop_all_periodic(c_class &con)
Definition c_loops.hh:404
bool start()
Definition c_loops.hh:409
bool inc()
Definition c_loops.hh:421
Class for looping over all of the particles in a container.
Definition c_loops.hh:172
c_loop_all(c_class &con)
Definition c_loops.hh:178
bool inc()
Definition c_loops.hh:190
bool start()
Definition c_loops.hh:182
Base class for looping over particles in a container.
Definition c_loops.hh:85
int * co
Definition c_loops.hh:111
const int nx
Definition c_loops.hh:88
double ** p
Definition c_loops.hh:105
int q
Definition c_loops.hh:126
double y()
Definition c_loops.hh:159
void pos(int &pid, double &x, double &y, double &z, double &r)
Definition c_loops.hh:148
int ijk
Definition c_loops.hh:123
const int nxyz
Definition c_loops.hh:99
double x()
Definition c_loops.hh:156
int pid()
Definition c_loops.hh:165
const int nz
Definition c_loops.hh:92
const int ps
Definition c_loops.hh:102
int ** id
Definition c_loops.hh:108
const int nxy
Definition c_loops.hh:96
int j
Definition c_loops.hh:117
int k
Definition c_loops.hh:120
const int ny
Definition c_loops.hh:90
void pos(double &x, double &y, double &z)
Definition c_loops.hh:137
c_loop_base(c_class &con)
Definition c_loops.hh:131
double z()
Definition c_loops.hh:162
int i
Definition c_loops.hh:114
Class for looping over the particles in a range of blocks within a container.
Definition c_loops.hh:222
bool inc()
Definition c_loops.hh:254
c_loop_block_range(c_class &con)
Definition c_loops.hh:228
bool start()
Definition c_loops.hh:232
void setup_range(int ijk_start_in, int ijk_stop_in)
Definition c_loops.hh:243
Class for looping over all of the particles specified in a pre-assembled particle_order class,...
Definition c_loops.hh:476
int * cp
Definition c_loops.hh:481
bool start()
Definition c_loops.hh:495
particle_order & vo
Definition c_loops.hh:479
int * op
Definition c_loops.hh:483
c_loop_order_periodic(c_class &con, particle_order &vo_)
Definition c_loops.hh:490
bool inc()
Definition c_loops.hh:506
Class for looping over all of the particles specified in a pre-assembled particle_order class.
Definition c_loops.hh:341
c_loop_order(c_class &con, particle_order &vo_)
Definition c_loops.hh:355
bool start()
Definition c_loops.hh:360
particle_order & vo
Definition c_loops.hh:344
int * op
Definition c_loops.hh:348
int * cp
Definition c_loops.hh:346
bool inc()
Definition c_loops.hh:371
Class for looping over a subset of particles in a container.
Definition c_loops.hh:291
void setup_box(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, bool bounds_test=true)
Definition c_loops.cc:101
bool start()
Definition c_loops.cc:82
void setup_sphere(double vx, double vy, double vz, double r, bool bounds_test=true)
Definition c_loops.cc:27
void setup_intbox(int ai_, int bi_, int aj_, int bj_, int ak_, int bk_)
Definition c_loops.cc:47
c_loop_subset(c_class &con)
Definition c_loops.hh:301
c_loop_subset_mode mode
Definition c_loops.hh:296
bool inc()
Definition c_loops.hh:311
A class for storing ordering information when particles are added to a container.
Definition c_loops.hh:44
particle_order(int init_size=init_ordering_size)
Definition c_loops.hh:58
int * op
Definition c_loops.hh:50
int size
Definition c_loops.hh:53
void add(int ijk, int q)
Definition c_loops.hh:70
~particle_order()
Definition c_loops.hh:62
int * o
Definition c_loops.hh:47
Master configuration file for setting various compile-time options.
int
Definition TestServer.py:515
const int init_ordering_size
Definition config.hh:38
c_loop_subset_mode
Definition c_loops.hh:26
@ no_check
Definition c_loops.hh:29
@ sphere
Definition c_loops.hh:27
@ box
Definition c_loops.hh:28
const double default_radius
Definition config.hh:97