Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<double> genPoints()
- {
- std::vector<double> pts;
- int n_pts_1d = 16;
- for (int i = 1; i < n_pts_1d; i++) {
- double x = ((double)i) / n_pts_1d;
- for (int j = 1; j < n_pts_1d; j++) {
- double y = ((double)j) / n_pts_1d;
- for (int k = 1; k < n_pts_1d; k++) {
- double z = ((double)k) / n_pts_1d;
- pts.push_back(x);
- pts.push_back(y);
- pts.push_back(z);
- }
- }
- }
- return pts;
- }
- std::vector<ot::TreeNode> buildOct()
- {
- std::vector<double> pts = genPoints();
- double gSize[3] = {1.0, 1.0, 1.0};
- int dim = 3;
- int maxOctDepth = 8;
- int maxPtsPerOctant = 1;
- bool incCorner = true;
- std::vector<ot::TreeNode> linOct, balOct, newLinOct;
- ot::points2Octree(pts, gSize, linOct, dim, maxOctDepth, maxPtsPerOctant, MPI_COMM_WORLD);
- par::sampleSort<ot::TreeNode>(linOct, newLinOct, MPI_COMM_WORLD);
- ot::balanceOctree (newLinOct, balOct, dim, maxOctDepth, incCorner, MPI_COMM_WORLD);
- return balOct;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement