<h3>Specific improvements</h3>
<ol>
+ <li> Fixed: parallel::distributed::Triangulation<...>::load now has an
+ additional parameter autopartition to control p4est's behaviour of
+ rebalancing triangulations between mpi nodes upon reading. It is
+ particularly useful to disable this behaviour when data is stored
+ seperately (see tests mpi/p4est_save_0?).
+ <br>
+ (Alexander Grayver, Matthias Maier, 2014/04/26)
+ </li>
+
<li> Fixed: GridTools::find_active_cell_around_point() could get into an infinite
loop if the point we are looking for is in fact not within the domain. This is now
fixed.
void save(const char *filename) const;
/**
- * Load the refinement information saved with save() back in. The mesh
- * must contain the same coarse mesh that was used in save() before calling
- * this function. You do not
- * need to load with the same number of MPI processes that you saved
- * with. Rather, if a mesh is loaded with a different number of MPI
- * processes than used at the time of saving, the mesh is repartitioned
- * appropriately. Cell-based data that was saved with register_data_attach()
- * can be read in with notify_ready_to_unpack() after calling load().
- */
- void load(const char *filename);
+ * Load the refinement information saved with save() back in. The
+ * mesh must contain the same coarse mesh that was used in save()
+ * before calling this function.
+ *
+ * You do not need to load with the same number of MPI processes that
+ * you saved with. Rather, if a mesh is loaded with a different
+ * number of MPI processes than used at the time of saving, the mesh
+ * is repartitioned appropriately. Cell-based data that was saved
+ * with register_data_attach() can be read in with
+ * notify_ready_to_unpack() after calling load().
+ *
+ * If you use p4est version > 0.3.4.2 the @p autopartition flag tells
+ * p4est to ignore the partitioning that the triangulation had when
+ * it was saved and make it uniform upon loading. If @p autopartition
+ * set to false, the triangulation is only repartitioned if needed
+ * (i.e. if a different number of MPI processes is encountered).
+ */
+ void load(const char *filename, bool autopartition = true);
/**
* Used to inform in the callbacks of register_data_attach() and
template <int dim, int spacedim>
void
Triangulation<dim,spacedim>::
- load(const char *filename)
+ load(const char *filename, bool autopartition)
{
Assert(this->n_cells()>0, ExcMessage("load() only works if Triangulation already contains the same coarse mesh!"));
Assert(this->n_levels()==1, ExcMessage("Triangulation may only contain coarse cells when calling load()."));
parallel_forest = dealii::internal::p4est::functions<dim>::load_ext (
filename, mpi_communicator,
attached_size, attached_size>0,
- 1, 0,
+ autopartition, 0,
this,
&connectivity);
#else
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tr);
- tr.load(filename.c_str());
+ tr.load(filename.c_str(), false);
if (myid == 0)
{
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tr);
- tr.load(filename.c_str());
+ tr.load(filename.c_str(), false);
FE_Q<dim> fe(1);
DoFHandler<dim> dh(tr);
parallel::distributed::Triangulation<dim> tr (MPI_COMM_WORLD);
GridGenerator::hyper_cube (tr);
- tr.load (filename.c_str());
+ tr.load (filename.c_str(), false);
FE_Q<dim> fe (1);
DoFHandler<dim> dh (tr);