MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / testIntersection

Function testIntersection

Tests/Particles/Intersection/main.cpp:25–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void testIntersection()
26{
27 TestParams params;
28 get_test_params(params, "intersect");
29
30 int is_per[] = {AMREX_D_DECL(params.is_periodic,
31 params.is_periodic,
32 params.is_periodic)};
33
34 Vector<IntVect> rr(params.nlevs-1);
35 for (int lev = 1; lev < params.nlevs; lev++) {
36 rr[lev-1] = IntVect(AMREX_D_DECL(2,2,2));
37 }
38
39 RealBox real_box;
40 for (int n = 0; n < AMREX_SPACEDIM; n++)
41 {
42 real_box.setLo(n, 0.0);
43 real_box.setHi(n, 1.0);
44 }
45
46 IntVect domain_lo(AMREX_D_DECL(0 , 0, 0));
47 IntVect domain_hi(AMREX_D_DECL(params.size[0]-1, params.size[1]-1, params.size[2]-1));
48 const Box base_domain(domain_lo, domain_hi);
49
50 Vector<Geometry> geom(params.nlevs);
51 geom[0].define(base_domain, &real_box, CoordSys::cartesian, is_per);
52 for (int lev = 1; lev < params.nlevs; lev++) {
53 geom[lev].define(amrex::refine(geom[lev-1].Domain(), rr[lev-1]),
54 &real_box, CoordSys::cartesian, is_per);
55 }
56
57 Vector<BoxArray> ba(params.nlevs);
58 IntVect lo(0);
59 IntVect size = params.size;
60 for (int lev = 0; lev < params.nlevs; ++lev)
61 {
62 ba[lev].define(Box(lo, lo+params.size-1));
63 ba[lev].maxSize(params.max_grid_size);
64 lo += size/2;
65 size *= 2;
66 }
67
68 Vector<ParticleLocator<DenseBins<Box>>> ploc(params.nlevs);
69
70 for (int lev = 0; lev < params.nlevs; ++lev)
71 {
72 ploc[lev].build(ba[lev], geom[lev]);
73
74 auto assign_grid = ploc[lev].getGridAssignor();
75
76 for (int i = 0; i < ba[lev].size(); ++i)
77 {
78 const Box& box = ba[lev][i];
79
80 Gpu::HostVector<IntVect> host_cells;
81 for (IntVect iv = box.smallEnd(); iv <= box.bigEnd(); box.next(iv)) { host_cells.push_back(iv); }
82 //host_cells.push_back(box.smallEnd());

Callers 1

mainFunction · 0.70

Calls 15

copyAsyncFunction · 0.85
get_test_paramsFunction · 0.70
refineFunction · 0.50
ParallelForFunction · 0.50
setLoMethod · 0.45
setHiMethod · 0.45
defineMethod · 0.45
DomainMethod · 0.45
buildMethod · 0.45
getGridAssignorMethod · 0.45
sizeMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected