diff --git a/mesh_handle/competences/element_data_competences.hxx b/mesh_handle/competences/element_data_competences.hxx index 093f617014..ca93f62a7f 100644 --- a/mesh_handle/competences/element_data_competences.hxx +++ b/mesh_handle/competences/element_data_competences.hxx @@ -146,6 +146,7 @@ class element_data_mesh_competence_impl: public t8_crtp_basic { sc_array_destroy (sc_array_wrapper); } + protected: /** Repartition the element data so it follows a newly partitioned forest. * The element data currently belongs to \a forest_from; this moves it to the layout of \a forest_to, which must * have been created by partitioning \a forest_from. @@ -179,7 +180,6 @@ class element_data_mesh_competence_impl: public t8_crtp_basic { set_element_data (std::move (partitioned_data)); } - protected: std::vector m_element_data; /**< Vector storing the (local) element data. */ }; diff --git a/mesh_handle/mesh.hxx b/mesh_handle/mesh.hxx index 2c4ae04572..3bf24c27b9 100644 --- a/mesh_handle/mesh.hxx +++ b/mesh_handle/mesh.hxx @@ -533,7 +533,11 @@ class mesh: public TMeshCompetencePack::template applyget_element_data ().empty (); + // We need to make sure that the variable is the same on all processes. + int local_data_set = !this->get_element_data ().empty (); + int global_data_set; + sc_MPI_Allreduce (&local_data_set, &global_data_set, 1, sc_MPI_INT, sc_MPI_LOR, t8_forest_get_mpicomm (m_forest)); + data_set = global_data_set; } // True if the data is interpolated in this commit: Only if data is set and the elements change. bool interpolate = false;