UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
v_compute.hh
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2// Modified version of Voro++'s source file
3
4// Voro++, a 3D cell-based Voronoi library
5//
6// Author : Chris H. Rycroft (LBL / UC Berkeley)
7// Email : chr@alum.mit.edu
8// Date : August 30th 2011
9
13#ifndef VOROPP_V_COMPUTE_HH
14#define VOROPP_V_COMPUTE_HH
15
16#include "config.hh"
17#include "worklist.hh"
18#include "cell.hh"
19
20namespace voro {
21
29 int ijk;
31 int l;
33 int di;
35 int dj;
37 int dk;
38};
39
41template <class c_class>
43 public:
45 const c_class &con;
48 const double boxx;
51 const double boxy;
54 const double boxz;
57 const double xsp;
60 const double ysp;
63 const double zsp;
65 const int hx;
67 const int hy;
69 const int hz;
73 const int hxy;
76 const int hxyz;
79 const int ps;
80
81 // TODO: these are all things we could just access via the container ref con, above? no reason for them to live on this class?
84 int **id;
88 double **p;
91 int *co;
92
93 voro_compute(c_class &con_,int hx_,int hy_,int hz_);
97 delete [] qu;
98 delete [] mask;
99 }
103 xsp(Other.xsp), ysp(Other.ysp), zsp(Other.zsp),
104 hx(Other.hx), hy(Other.hy), hz(Other.hz), hxy(Other.hxy), hxyz(Other.hxyz), ps(Other.ps),
105 id(Other.id), p(Other.p), co(Other.co), bxsq(Other.bxsq),
106 mv(Other.mv), qu_size(Other.qu_size), wl(Other.wl), mrad(Other.mrad),
107 mask(Other.mask), qu(Other.qu), qu_l(Other.qu_l)
108 {
109 Other.qu = nullptr;
110 Other.mask = nullptr;
111 }
112 // Note: Move assignment not implemented due to const members on this class (and it has not been needed yet)
114
115 template<class v_cell>
116 bool compute_cell(v_cell &c,int ijk,int s,int ci,int cj,int ck);
117 void find_voronoi_cell(double x,double y,double z,int ci,int cj,int ck,int ijk,particle_record &w,double &mrs);
118 private:
121 const double bxsq;
124 unsigned int mv;
126 int qu_size;
127
128 // TODO: can get via 'con' -- no reason for wl to live on this class?
130 const unsigned int *wl;
133 double *mrad;
136 unsigned int *mask;
139 int *qu;
142 int *qu_l;
143 template<class v_cell>
144 bool corner_test(v_cell &c,double xl,double yl,double zl,double xh,double yh,double zh,typename c_class::radius_info& radi) const;
145 template<class v_cell>
146 inline bool edge_x_test(v_cell &c,double x0,double yl,double zl,double x1,double yh,double zh,typename c_class::radius_info& radi) const;
147 template<class v_cell>
148 inline bool edge_y_test(v_cell &c,double xl,double y0,double zl,double xh,double y1,double zh,typename c_class::radius_info& radi) const;
149 template<class v_cell>
150 inline bool edge_z_test(v_cell &c,double xl,double yl,double z0,double xh,double yh,double z1,typename c_class::radius_info& radi) const;
151 template<class v_cell>
152 inline bool face_x_test(v_cell &c,double xl,double y0,double z0,double y1,double z1,typename c_class::radius_info& radi) const;
153 template<class v_cell>
154 inline bool face_y_test(v_cell &c,double x0,double yl,double z0,double x1,double z1,typename c_class::radius_info& radi) const;
155 template<class v_cell>
156 inline bool face_z_test(v_cell &c,double x0,double y0,double zl,double x1,double y1,typename c_class::radius_info& radi) const;
157 bool compute_min_max_radius(int di,int dj,int dk,double fx,double fy,double fz,double gx,double gy,double gz,double& crs,double mrs,const typename c_class::radius_info& radi) const;
158 bool compute_min_radius(int di,int dj,int dk,double fx,double fy,double fz,double mrs) const;
159 inline void add_to_mask(int ei,int ej,int ek,int *&qu_e);
160 inline void scan_bits_mask_add(unsigned int q,unsigned int *mijk,int ei,int ej,int ek,int *&qu_e);
161 inline void scan_all(int ijk,double x,double y,double z,int di,int dj,int dk,particle_record &w,double &mrs);
162 void add_list_memory(int*& qu_s,int*& qu_e);
165 inline void reset_mask() {
166 for(unsigned int *mp(mask);mp<mask+hxyz;mp++) *mp=0;
167 }
168};
169
170}
171
172#endif
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Header file for the voronoicell and related classes.
Template for carrying out Voronoi cell computations.
Definition v_compute.hh:42
voro_compute(const voro_compute< c_class > &Other)=delete
const double boxy
Definition v_compute.hh:51
const double zsp
Definition v_compute.hh:63
voro_compute< c_class > & operator=(const voro_compute< c_class > &Other)=delete
const int hxy
Definition v_compute.hh:73
const double ysp
Definition v_compute.hh:60
int * co
Definition v_compute.hh:91
voro_compute< c_class > & operator=(voro_compute< c_class > &&Other)=delete
const double boxz
Definition v_compute.hh:54
const double xsp
Definition v_compute.hh:57
double ** p
Definition v_compute.hh:88
voro_compute(voro_compute< c_class > &&Other) noexcept
Definition v_compute.hh:102
~voro_compute()
Definition v_compute.hh:96
const int hy
Definition v_compute.hh:67
const int hxyz
Definition v_compute.hh:76
const int hz
Definition v_compute.hh:69
const double boxx
Definition v_compute.hh:48
int ** id
Definition v_compute.hh:84
void find_voronoi_cell(double x, double y, double z, int ci, int cj, int ck, int ijk, particle_record &w, double &mrs)
Definition v_compute.cc:73
const int hx
Definition v_compute.hh:65
bool compute_cell(v_cell &c, int ijk, int s, int ci, int cj, int ck)
Definition v_compute.cc:293
const int ps
Definition v_compute.hh:79
const c_class & con
Definition v_compute.hh:45
Master configuration file for setting various compile-time options.
Definition c_loops.cc:15
Structure for holding information about a particle.
Definition v_compute.hh:27
int dj
Definition v_compute.hh:35
int di
Definition v_compute.hh:33
int dk
Definition v_compute.hh:37
int l
Definition v_compute.hh:31
int ijk
Definition v_compute.hh:29
Header file for setting constants used in the block worklists that are used during cell computation.