66 {
67 if (!shells || !mask || nb_shells < 0 ||
nspmd <= 0 || numnod <= 0)
68 {
69 return nullptr;
70 }
71
73 const int max_node_id = numnod;
74
75
76 for (int shell_idx = 0; shell_idx < nb_shells; ++shell_idx)
77 {
78 for (
int process_idx = 0; process_idx <
nspmd; ++process_idx)
79 {
81 {
82 (*ghost_data)[process_idx].push_back(shell_idx + 1);
83 }
84 }
85 }
86
87
88 if (nb_shells > 0)
89 {
90 for (
int process_idx = 0; process_idx <
nspmd; ++process_idx)
91 {
92 auto &shell_list = (*ghost_data)[process_idx];
93 std::sort(shell_list.begin(), shell_list.end());
94 auto new_end = std::unique(shell_list.begin(), shell_list.end());
95 shell_list.erase(new_end, shell_list.end());
96 }
97 }
98
99 return ghost_data;
100 }
bool is_shell_ghost_on_proc(int shell_index, int process_id, int *shells, int *mask, int nspmd, int max_node_id)
std::vector< std::vector< int > > Ghosts