153 c_vector<double, DATA_SIZE> data;
158 status.MPI_ERROR = MPI_SUCCESS;
172 unsigned local_element_index=0u;
175 for (
unsigned global_element_index=0; global_element_index<
mpMesh->GetNumElements(); global_element_index++)
177 if (
mpMesh->CalculateDesignatedOwnershipOfElement(global_element_index))
181 while (&(*iter) != p_elem)
184 local_element_index++;
185 assert(iter !=
mpMesh->GetElementIteratorEnd());
188 Visit(p_elem, local_element_index, data);
193 MPI_Recv(&data[0], DATA_SIZE, MPI_DOUBLE, MPI_ANY_SOURCE, global_element_index, PETSC_COMM_WORLD, &status);
203 unsigned previous_index = 0u;
204 unsigned local_index = 0u;
206 iter !=
mpMesh->GetElementIteratorEnd();
207 ++iter, local_index++)
209 unsigned element_index = iter->GetIndex();
211 if (previous_index>0u)
213 assert(element_index > previous_index);
215 previous_index = element_index;
216 if (
mpMesh->CalculateDesignatedOwnershipOfElement(element_index))
219 Visit(&(*iter), local_index, data);
221 MPI_Ssend(&data[0], DATA_SIZE, MPI_DOUBLE, 0, element_index, PETSC_COMM_WORLD);