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

Function testNeighborParticles

Tests/Particles/NeighborParticles/main.cpp:60–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void testNeighborParticles ()
61{
62 BL_PROFILE("testNeighborParticles");
63 TestParams params;
64 get_test_params(params, "nbor_parts");
65
66 RealBox real_box;
67 for (int n = 0; n < BL_SPACEDIM; n++)
68 {
69 real_box.setLo(n, 0.0);
70 real_box.setHi(n, params.size[n]);
71 }
72
73 IntVect domain_lo(AMREX_D_DECL(0, 0, 0));
74 IntVect domain_hi(AMREX_D_DECL(params.size[0]-1,params.size[1]-1,params.size[2]-1));
75 const Box domain(domain_lo, domain_hi);
76
77 int coord = 0;
78 int is_per[] = {AMREX_D_DECL(params.is_periodic,
79 params.is_periodic,
80 params.is_periodic)};
81 Geometry geom(domain, &real_box, coord, is_per);
82
83 BoxArray ba(domain);
84 ba.maxSize(params.max_grid_size);
85 DistributionMapping dm(ba);
86
87 const int ncells = 1;
88 MDParticleContainer pc(geom, dm, ba, ncells);
89
90 IntVect nppc(fixed_num_ppc);
91
92 if (ParallelDescriptor::MyProc() == dm[0]) {
93 amrex::PrintToFile("neighbor_test") << "About to initialize particles \n";
94 }
95
96 pc.InitParticles(nppc, 1.0, 0.0);
97
98 if (ParallelDescriptor::MyProc() == dm[0]) {
99 amrex::PrintToFile("neighbor_test") << "Check neighbors after init ... \n";
100 }
101 pc.checkNeighborParticles();
102
103 pc.fillNeighbors();
104
105 if (ParallelDescriptor::MyProc() == dm[0]) {
106 amrex::PrintToFile("neighbor_test") << "Check neighbors after fill ... \n";
107 }
108 pc.checkNeighborParticles();
109
110 pc.updateNeighbors();
111
112 if (ParallelDescriptor::MyProc() == dm[0]) {
113 amrex::PrintToFile("neighbor_test") << "Check neighbors after update ... \n";
114 }
115 pc.checkNeighborParticles();
116
117 if (ParallelDescriptor::MyProc() == dm[0]) {

Callers 1

mainFunction · 0.85

Calls 14

PrintToFileClass · 0.85
BarrierFunction · 0.85
reset_test_idMethod · 0.80
minAndMaxDistanceMethod · 0.80
setEnableInverseMethod · 0.80
get_test_paramsFunction · 0.70
CheckPairClass · 0.70
MyProcFunction · 0.50
setLoMethod · 0.45
setHiMethod · 0.45
InitParticlesMethod · 0.45

Tested by

no test coverage detected