* actually be created if we don't have p4est available.
*/
template <int dim, int spacedim = dim>
- class Triangulation : public dealii::Triangulation<dim,spacedim>
+ class Triangulation : public dealii::parallel::Triangulation<dim,spacedim>
{
private:
/**
*/
Triangulation ();
- public:
-
- /**
- * Destructor.
- */
- virtual ~Triangulation ();
-
- /**
- * Return the subdomain id of those cells that are owned by the current
- * processor. All cells in the triangulation that do not have this
- * subdomain id are either owned by another processor or have children
- * that only exist on other processors.
- */
- types::subdomain_id locally_owned_subdomain () const;
-
};
}
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2008 - 2013 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
/**
* Constructor.
*/
-#ifdef DEAL_II_WITH_MPI
Triangulation (MPI_Comm mpi_communicator,
const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing smooth_grid = (dealii::Triangulation<dim,spacedim>::none),
const bool check_for_distorted_cells = false);
-#else
- Triangulation ();
-#endif
/**
* Destructor.
*/
virtual ~Triangulation ();
-#ifdef DEAL_II_WITH_MPI
/**
* Return MPI communicator used by this triangulation.
*/
virtual MPI_Comm get_communicator () const;
-#endif
/**
* Implementation of the same function as in the base class.
protected:
-#ifdef DEAL_II_WITH_MPI
/**
* MPI communicator to be used for the triangulation. We create a unique
* communicator for this class, which is a duplicate of the one passed
* to the constructor.
*/
MPI_Comm mpi_communicator;
-#endif
/**
* The subdomain id to be used for the current processor.
{
template <int dim, int spacedim>
Triangulation<dim,spacedim>::Triangulation ()
+ :
+ dealii::parallel::Triangulation<dim,spacedim>(MPI_COMM_SELF)
{
Assert (false, ExcNotImplemented());
}
-
-
- template <int dim, int spacedim>
- Triangulation<dim,spacedim>::~Triangulation ()
- {
- Assert (false, ExcNotImplemented());
- }
-
-
-
- template <int dim, int spacedim>
- types::subdomain_id
- Triangulation<dim,spacedim>::locally_owned_subdomain () const
- {
- Assert (false, ExcNotImplemented());
- return 0;
- }
-
-
-#ifdef DEAL_II_WITH_MPI
- template <int dim, int spacedim>
- MPI_Comm
- Triangulation<dim,spacedim>::get_communicator () const
- {
- Assert (false, ExcNotImplemented());
- return MPI_COMM_WORLD;
- }
-#endif
}
}
namespace parallel
{
-#ifdef DEAL_II_WITH_MPI
template <int dim, int spacedim>
Triangulation<dim,spacedim>::Triangulation (MPI_Comm mpi_communicator,
const typename dealii::Triangulation<dim,spacedim>::MeshSmoothing smooth_grid,
my_subdomain (Utilities::MPI::this_mpi_process (this->mpi_communicator)),
n_subdomains(Utilities::MPI::n_mpi_processes(mpi_communicator))
{
+#ifndef DEAL_II_WITH_MPI
+ Assert(false, ExcMessage("You compiled deal.II without MPI support, for "
+ "which parallel::Triangulation is not available."));
+#endif
number_cache.n_locally_owned_active_cells.resize (n_subdomains);
}
void
Triangulation<dim,spacedim>::copy_triangulation (const dealii::Triangulation<dim, spacedim> &old_tria)
{
+#ifndef DEAL_II_WITH_MPI
+ Assert(false, ExcNotImplemented());
+#endif
if (const dealii::parallel::Triangulation<dim,spacedim> *
old_tria_x = dynamic_cast<const dealii::parallel::Triangulation<dim,spacedim> *>(&old_tria))
{
}
}
-#else
- template <int dim, int spacedim>
- Triangulation<dim,spacedim>::Triangulation()
- {
- Assert (false, ExcNotImplemented());
- }
-
- template <int dim, int spacedim>
- void
- Triangulation<dim,spacedim>::copy_triangulation (const dealii::Triangulation<dim, spacedim> &)
- {
- Assert (false, ExcNotImplemented());
- }
-
-#endif
template <int dim, int spacedim>
std::size_t
{
std::size_t mem=
this->dealii::Triangulation<dim,spacedim>::memory_consumption()
-#ifdef DEAL_II_WITH_MPI
+ MemoryConsumption::memory_consumption(mpi_communicator)
-#endif
+ MemoryConsumption::memory_consumption(my_subdomain)
+ MemoryConsumption::memory_consumption(number_cache.n_locally_owned_active_cells)
+ MemoryConsumption::memory_consumption(number_cache.n_global_active_cells)
return number_cache.n_locally_owned_active_cells;
}
-#ifdef DEAL_II_WITH_MPI
template <int dim, int spacedim>
MPI_Comm
Triangulation<dim,spacedim>::get_communicator () const
return mpi_communicator;
}
+#ifdef DEAL_II_WITH_MPI
template <int dim, int spacedim>
void
Triangulation<dim,spacedim>::update_number_cache ()