def _make_accel_eval(self, equations, cache_nnps=True): pytest.importorskip('pysph.base.gpu_nnps') from pysph.base.gpu_nnps import ZOrderGPUNNPS as GPUNNPS arrays = [self.pa] kernel = CubicSpline(dim=self.dim) a_eval = AccelerationEval( particle_arrays=arrays, equations=equations, kernel=kernel, backend='opencl' ) comp = SPHCompiler(a_eval, integrator=None) comp.compile() self.sph_compiler = comp nnps = GPUNNPS(dim=kernel.dim, particles=arrays, cache=cache_nnps) nnps.update() a_eval.set_nnps(nnps) return a_eval
def setUp(self): PeriodicBox2DTestCaseOpenCL.setUp(self) from pysph.base.gpu_nnps import ZOrderGPUNNPS self.orig_n = self.fluid.get_number_of_particles() self.nnps = ZOrderGPUNNPS( dim=2, particles=[self.fluid], domain=self.domain, radius_scale=self.kernel.radius_scale)