15 Chi::log.
Log() <<
"Identifying unique boundary-ids.";
18 std::set<uint64_t> local_bndry_ids_set;
20 for (
auto& face : cell.faces_)
21 if (not face.has_neighbor_)
22 local_bndry_ids_set.insert(face.neighbor_id_);
25 std::vector<uint64_t> local_bndry_ids(local_bndry_ids_set.begin(),
26 local_bndry_ids_set.end());
27 int local_num_bndry_ids = (int)local_bndry_ids.size();
31 std::vector<int> locI_bndry_count(
Chi::mpi.process_count,0);
33 MPI_Allgather(&local_num_bndry_ids,
36 locI_bndry_count.data(),
43 std::vector<int> locI_bndry_ids_displs(
Chi::mpi.process_count,0);
44 size_t total_num_global_bndry_ids=locI_bndry_count[0];
47 locI_bndry_ids_displs[locI] = locI_bndry_ids_displs[locI-1] +
48 locI_bndry_count[locI-1];
49 total_num_global_bndry_ids += locI_bndry_count[locI];
54 std::vector<uint64_t> globl_bndry_ids(total_num_global_bndry_ids);
56 MPI_Allgatherv(local_bndry_ids.data(),
58 MPI_UNSIGNED_LONG_LONG,
59 globl_bndry_ids.data(),
60 locI_bndry_count.data(),
61 locI_bndry_ids_displs.data(),
62 MPI_UNSIGNED_LONG_LONG,
65 std::set<uint64_t> globl_bndry_ids_set(globl_bndry_ids.begin(),
66 globl_bndry_ids.end());
68 std::vector<uint64_t> unique_bdnry_ids(globl_bndry_ids_set.begin(),
69 globl_bndry_ids_set.end());
70 return unique_bdnry_ids;
static chi::MPI_Info & mpi
LogStream Log(LOG_LVL level=LOG_0)
const MPI_Comm & comm
MPI communicator.
const int & process_count
Total number of processes.
LocalCellHandler local_cells
std::vector< uint64_t > GetDomainUniqueBoundaryIDs() const