#include <deal.II/grid/intergrid_map.h>
#include <deal.II/distributed/tria.h>
+#include <deal.II/distributed/shared_tria.h>
#include <iostream>
#include <cmath>
return tria;
}
+ template<int dim, int spacedim>
+ const Triangulation<dim, spacedim> &
+ get_tria(const parallel::shared::Triangulation<dim, spacedim> &tria)
+ {
+ return tria;
+ }
+
template<int dim, template<int, int> class Container, int spacedim>
const Triangulation<dim,spacedim> &
get_tria(const Container<dim,spacedim> &container)
return tria;
}
+ template<int dim, int spacedim>
+ Triangulation<dim, spacedim> &
+ get_tria(parallel::shared::Triangulation<dim, spacedim> &tria)
+ {
+ return tria;
+ }
+
template<int dim, template<int, int> class Container, int spacedim>
const Triangulation<dim,spacedim> &
get_tria(Container<dim,spacedim> &container)
template
std::list<std::pair<X::cell_iterator, X::cell_iterator> >
get_finest_common_cells (const X &mesh_1,
- const X &mesh_2);
+ const X &mesh_2);
template
#endif
}
-// now also instantiate these functions for parallel::shared::Triangulation
+// now also instantiate a few additional functions for parallel::distributed::Triangulation
for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
namespace GridTools \{
- template
- std::vector<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, parallel::shared::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type>
- compute_active_cell_halo_layer (const parallel::shared::Triangulation<deal_II_dimension, deal_II_space_dimension> &,
- const std_cxx11::function<bool (const dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension,
- parallel::shared::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type&)> &);
- \}
-
-#endif
-}
-
-
-// now also instantiate these functions for parallel::distributed::Triangulation
-for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS)
-{
-
-#if deal_II_dimension <= deal_II_space_dimension
- namespace GridTools \{
-
- template
- unsigned int
- find_closest_vertex (const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &,
- const Point<deal_II_space_dimension> &);
-
- template
- std::vector<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type>
- find_cells_adjacent_to_vertex(const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &,
- const unsigned int);
- template
- dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type
- find_active_cell_around_point (const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &,
- const Point<deal_II_space_dimension> &p);
-
- template
- std::pair<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type, Point<deal_II_dimension> >
- find_active_cell_around_point (const Mapping<deal_II_dimension, deal_II_space_dimension> &,
- const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &,
- const Point<deal_II_space_dimension> &);
-
- template
- std::vector<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type>
- compute_active_cell_halo_layer (const parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> &,
- const std_cxx11::function<bool (const dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension,
- parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type&)> &);
-
- template
- std::vector<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> >::type>
- compute_ghost_cell_halo_layer (const parallel::distributed::Triangulation<deal_II_dimension, deal_II_space_dimension> &);
-
template
std::map<unsigned int,types::global_vertex_index>
compute_local_to_global_vertex_index_map(const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &triangulation);
-
- template
- std::list<std::pair<parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension>::cell_iterator, parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension>::cell_iterator> >
- get_finest_common_cells (const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &mesh_1,
- const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &mesh_2);
-
-
- template
- bool
- have_same_coarse_mesh (const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &mesh_1,
- const parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension> &mesh_2);
-
\}
#endif
}
-for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS)
+// instantiate the following functions only for the "sequential" containers. this
+// is a misnomer here, however: the point is simply that we only instantiate
+// these functions for certain *iterator* types, and the iterator types are
+// the same for sequential and parallel containers; consequently, we get duplicate
+// instantiation errors if we instantiate for *all* container types, rather than
+// only the sequential ones
+for (X : SEQUENTIAL_TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
namespace GridTools \{
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/intergrid_map.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/distributed/shared_tria.h>
DEAL_II_NAMESPACE_OPEN
}
-// specialization for grid==tria
+// specialization for triangulation classes
template <int dim, int spacedim>
unsigned int
get_n_levels (const Triangulation<dim, spacedim> &grid)
// we can ask directly.
return grid.n_levels();
}
+
+ template <int dim, int spacedim>
+ unsigned int
+ get_n_levels (const parallel::distributed::Triangulation<dim, spacedim> &grid)
+ {
+ // if GridClass==Triangulation, then
+ // we can ask directly.
+ return grid.n_levels();
+ }
+
+ template <int dim, int spacedim>
+ unsigned int
+ get_n_levels (const parallel::shared::Triangulation<dim, spacedim> &grid)
+ {
+ // if GridClass==Triangulation, then
+ // we can ask directly.
+ return grid.n_levels();
+ }
}