|
template<int dim, int spacedim> |
static void | compute_number_cache (const Triangulation< dim, spacedim > &triangulation, const unsigned int level_objects, internal::TriangulationImplementation::NumberCache< 1 > &number_cache) |
|
template<int dim, int spacedim> |
static void | compute_number_cache (const Triangulation< dim, spacedim > &triangulation, const unsigned int level_objects, internal::TriangulationImplementation::NumberCache< 2 > &number_cache) |
|
template<int dim, int spacedim> |
static void | compute_number_cache (const Triangulation< dim, spacedim > &triangulation, const unsigned int level_objects, internal::TriangulationImplementation::NumberCache< 3 > &number_cache) |
|
template<int spacedim> |
static void | create_triangulation (const std::vector< Point< spacedim >> &v, const std::vector< CellData< 1 >> &cells, const SubCellData &, Triangulation< 1, spacedim > &triangulation) |
|
template<int spacedim> |
static void | create_triangulation (const std::vector< Point< spacedim >> &v, const std::vector< CellData< 2 >> &cells, const SubCellData &subcelldata, Triangulation< 2, spacedim > &triangulation) |
|
template<int spacedim> |
static void | create_triangulation (const std::vector< Point< spacedim >> &v, const std::vector< CellData< 3 >> &cells, const SubCellData &subcelldata, Triangulation< 3, spacedim > &triangulation) |
|
template<int spacedim> |
static void | delete_children (Triangulation< 1, spacedim > &triangulation, typename Triangulation< 1, spacedim >::cell_iterator &cell, std::vector< unsigned int > &, std::vector< unsigned int > &) |
|
template<int spacedim> |
static void | create_children (Triangulation< 2, spacedim > &triangulation, unsigned int &next_unused_vertex, typename Triangulation< 2, spacedim >::raw_line_iterator &next_unused_line, typename Triangulation< 2, spacedim >::raw_cell_iterator &next_unused_cell, typename Triangulation< 2, spacedim >::cell_iterator &cell) |
|
template<int spacedim> |
static Triangulation< 1, spacedim >::DistortedCellList | execute_refinement (Triangulation< 1, spacedim > &triangulation, const bool) |
|
template<int spacedim> |
static Triangulation< 2, spacedim >::DistortedCellList | execute_refinement (Triangulation< 2, spacedim > &triangulation, const bool check_for_distorted_cells) |
|
template<int spacedim> |
static Triangulation< 3, spacedim >::DistortedCellList | execute_refinement (Triangulation< 3, spacedim > &triangulation, const bool check_for_distorted_cells) |
|
template<int spacedim> |
static void | prevent_distorted_boundary_cells (const Triangulation< 1, spacedim > &) |
|
template<int dim, int spacedim> |
static void | prepare_refinement_dim_dependent (const Triangulation< dim, spacedim > &) |
|
template<int dim, int spacedim> |
static bool | coarsening_allowed (const typename Triangulation< dim, spacedim >::cell_iterator &cell) |
|
A class into which we put many of the functions that implement functionality of the Triangulation class. The main reason for this class is as follows: the majority of the functions in Triangulation need to be implemented differently for dim==1, dim==2, and dim==3. However, their implementation is largly independent of the spacedim template parameter. So we would like to write things like
Unfortunately, C++ doesn't allow this: member functions of class templates have to be either not specialized at all, or fully specialized. No partial specialization is allowed. One possible solution would be to just duplicate the bodies of the functions and have equally implemented functions
but that is clearly an unsatisfactory solution. Rather, what we do is introduce the current Implementation class in which we can write these functions as member templates over spacedim, i.e. we can have
template <int dim_, int spacedim_>
template <int spacedim>
The outer template parameters are here unused, only the inner ones are of real interest.
One may ask why we put these functions into an class rather than an anonymous namespace, for example?
First, these implementation functions need to be friends of the Triangulation class. It is simpler to make the entire class a friend rather than listing all members of an implementation namespace as friends of the Triangulation class (there is no such thing as a "friend
namespace XXX" directive).
Ideally, we would make this class a member class of the Triangulation<dim,spacedim> class, since then our implementation functions have immediate access to the alias and static functions of the surrounding Triangulation class. I.e., we do not have to write "typename Triangulation<dim,spacedim>::active_cell_iterator" but can write "active_cell_iterator" right away. This is, in fact, the way it was implemented first, but we ran into a bug in gcc4.0:
struct Implementation;
};
struct Implementation;
};
Here, friendship (per C++ standard) is supposed to extend to all members of the befriended class, including its 'Implementation' member class. But gcc4.0 gets this wrong: the members of Triangulation::Implementation are not friends of TriaAccessor and the other way around. Ideally, one would fix this by saying
struct Implementation;
friend class TriaAccessor::Implementation;
};
struct Implementation;
friend class Triangulation::Implementation;
};
but that's not legal because in ** we don't know yet that TriaAccessor has a member class Implementation and so we can't make it a friend. The only way forward at this point was to make Implementation a class in the internal namespace so that we can forward declare it and make it a friend of the respective other outer class – not quite what we wanted but the only way I could see to make it work...
Definition at line 1386 of file tria.cc.