namespace parallel
{
+ template <int dim, int spacedim = dim>
+ class Triangulation : public dealii::Triangulation<dim,spacedim>
+ {
+ public:
+
+ /**
+ * Constructor.
+ */
+ Triangulation (const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing smooth_grid = dealii::Triangulation<dim,spacedim>::none,
+ const bool check_for_distorted_cells = false) :
+ dealii::Triangulation<dim,spacedim>(smooth_grid,check_for_distorted_cells) {};
+
+ /**
+ * Destructor.
+ */
+ virtual ~Triangulation () {};
+
+ /**
+ * Return locally owned subdomain id,
+ * which is equivalent to the rank of the current mpi process in
+ * communicator provided to class constructor.
+ */
+ virtual types::subdomain_id locally_owned_subdomain () const = 0;
+
+ /**
+ * Return MPI communicator used by this triangulation.
+ */
+ virtual MPI_Comm get_communicator () const = 0;
+
+ /**
+ * Coarsen and refine the mesh according to refinement and
+ * coarsening flags set.
+ *
+ * This step is equivalent to the dealii::Triangulation class
+ * with an addition of calling dealii::GridTools::partition_triangulation() at the end.
+ */
+ virtual void execute_coarsening_and_refinement () = 0;
+
+ /**
+ * Create a triangulation.
+ *
+ * This function also partitions triangulation based on the
+ * MPI communicator provided to constructor.
+ */
+ virtual void create_triangulation (const std::vector< Point< spacedim > > &vertices,
+ const std::vector< CellData< dim > > &cells,
+ const SubCellData &subcelldata) = 0;
+
+ /**
+ * Return the number of active cells owned by each of the MPI
+ * processes that contribute to this triangulation. The element
+ * of this vector indexed by locally_owned_subdomain() equals
+ * the result of n_locally_owned_active_cells().
+ */
+ virtual const std::vector<unsigned int> &
+ n_locally_owned_active_cells_per_processor () const = 0;
+
+ /**
+ * Return the number of active cells in the triangulation that
+ * are locally owned, i.e. that have a subdomain_id equal to
+ * locally_owned_subdomain().
+ *
+ */
+ virtual unsigned int n_locally_owned_active_cells () const = 0;
+
+ /**
+ * Return the sum over all processors of the number of active
+ * cells owned by each processor. This equals the overall number
+ * of active cells in the shared triangulation.
+ */
+ virtual types::global_dof_index n_global_active_cells () const = 0;
+
+ /**
+ * Returns the global maximum level. This may be bigger than n_levels.
+ */
+ virtual unsigned int n_global_levels () const = 0;
+ };
+
+
namespace shared
{
* partition trianguation using MPI.
*/
template <int dim, int spacedim = dim>
- class Triangulation : public dealii::Triangulation<dim,spacedim>
+ class Triangulation : public dealii::parallel::Triangulation<dim,spacedim>
{
public:
typedef typename dealii::Triangulation<dim,spacedim>::active_cell_iterator active_cell_iterator;
template <int dim, int spacedim>
Triangulation<dim,spacedim>::Triangulation (MPI_Comm mpi_communicator,
- const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing):
- dealii::Triangulation<dim,spacedim>(),
+ const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing smooth_grid):
+ dealii::parallel::Triangulation<dim,spacedim>(smooth_grid,false),
mpi_communicator (Utilities::MPI::
duplicate_communicator(mpi_communicator)),
my_subdomain (Utilities::MPI::this_mpi_process (this->mpi_communicator)),