typedef typename dealii::Triangulation<dim,spacedim>::active_cell_iterator active_cell_iterator;
typedef typename dealii::Triangulation<dim,spacedim>::cell_iterator cell_iterator;
+ /**
+ * Configuration flags for distributed Triangulations to be set in the
+ * constructor. Settings can be combined using bitwise OR.
+ */
+ enum Settings
+ {
+ /**
+ * Default settings, other options are disabled.
+ */
+ partition_metis = 0x0,
+
+ /**
+ *
+ */
+ partition_zorder = 0x1,
+
+ /**
+ *
+ */
+ partition_custom_signal = 0x2,
+
+ /**
+ * This flags needs to be set to use the geometric multigrid
+ * functionality. This option requires additional computation and
+ * communication. Note: geometric multigrid is still a work in
+ * progress.
+ */
+ construct_multigrid_hierarchy = 0x8,
+ };
+
+
/**
* Constructor.
*
Triangulation (MPI_Comm mpi_communicator,
const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing =
(dealii::Triangulation<dim,spacedim>::none),
- const bool allow_artificial_cells = false);
+ const bool allow_artificial_cells = false,
+ const Settings settings = partition_metis);
/**
* Destructor.
bool with_artificial_cells() const;
private:
+
+ /**
+ * Settings
+ */
+ Settings settings;
+
/**
* A flag to decide whether or not artificial cells are allowed.
*/
template <int dim, int spacedim>
Triangulation<dim,spacedim>::Triangulation (MPI_Comm mpi_communicator,
const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing smooth_grid,
- const bool allow_artificial_cells):
+ const bool allow_artificial_cells,
+ const Settings settings):
dealii::parallel::Triangulation<dim,spacedim>(mpi_communicator,smooth_grid,false),
- allow_artificial_cells(allow_artificial_cells)
+ allow_artificial_cells(allow_artificial_cells),
+ settings (settings)
{}
template <int dim, int spacedim>
void Triangulation<dim,spacedim>::partition()
{
- dealii::GridTools::partition_triangulation (this->n_subdomains, *this);
+ if (settings & partition_metis)
+ {
+ dealii::GridTools::partition_triangulation (this->n_subdomains, *this);
+ if (settings & construct_multigrid_hierarchy)
+ dealii::GridTools::partition_multigrid_levels(...);
+ }
+ else if (settings & partition_zorder)
+ {
+ dealii::GridTools::partition_triangulation_zorder (this->n_subdomains, *this);
+ if (settings & construct_multigrid_hierarchy)
+ dealii::GridTools::partition_multigrid_levels(...);
+ }
+ else
+ {
+ // signal thing
+ }
true_subdomain_ids_of_cells.resize(this->n_active_cells());