const std::vector< std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> >
&get_vertex_to_cell_map() const;
+ /**
+ * Return the cached vertex_to_cell_centers_directions as computed by
+ * GridTools::vertex_to_cell_centers_directions().
+ */
+ const std::vector<std::vector<Tensor<1,spacedim>>>
+ &get_vertex_to_cell_centers_directions() const;
+
/**
* Exception for uninitialized cache fields.
*/
* GridTools::vertex_to_cell_map()
*/
std::vector< std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> > vertex_to_cells;
+
+ /**
+ * Store vertex to cell center directions, as generated by
+ * GridTools::vertex_to_cell_centers_directions.
+ */
+ std::vector<std::vector<Tensor<1,spacedim>>> vertex_to_cell_centers;
};
DEAL_II_NAMESPACE_CLOSE
* Cache vertex_to_cell_map, as returned by GridTools::vertex_to_cell_map().
*/
cache_vertex_to_cell_map = 0x0001,
+
+ /**
+ * Cache vertex_to_cell_centers_directions, as returned by
+ * GridTools::vertex_to_cell_centers_directions()
+ */
+ cache_vertex_to_cell_centers_directions = cache_vertex_to_cell_map | 0x0002,
};
StreamType &operator << (StreamType &s, TriangulationInfoCacheFlags u)
{
s << " TriangulationInfoCacheFlags";
- if (u & cache_vertex_to_cell_map) s << "|vertex_to_cell_map" ;
+ if (u & cache_vertex_to_cell_map) s << "|vertex_to_cell_map";
+ if (u & cache_vertex_to_cell_centers_directions) s << "|vertex_to_cells_centers_directions";
return s;
}
template<int dim, int spacedim>
TriangulationInfoCache<dim,spacedim>::TriangulationInfoCache(
- const Triangulation<dim, spacedim> &tria,
- const TriangulationInfoCacheFlags &flags,
- const Mapping<dim, spacedim> &mapping) :
+ const Triangulation<dim, spacedim> &tria,
+ const TriangulationInfoCacheFlags &flags,
+ const Mapping<dim, spacedim> &mapping) :
tria(&tria),
flags(flags),
mapping(&mapping)
update();
});
- if(tria.n_active_cells()>0)
+ if (tria.n_active_cells()>0)
update();
}
template<int dim, int spacedim>
void TriangulationInfoCache<dim,spacedim>::update(bool topology_is_unchanged)
{
- if(topology_is_unchanged == false) {
- if (cache_vertex_to_cell_map & flags)
+ if (topology_is_unchanged == false)
+ {
+ if (cache_vertex_to_cell_map & flags)
vertex_to_cells = GridTools::vertex_to_cell_map(*tria);
- }
+ }
+
+ if (cache_vertex_to_cell_centers_directions & flags)
+ vertex_to_cell_centers =
+ GridTools::vertex_to_cell_centers_directions(*tria, vertex_to_cells);
}
+
+
template<int dim, int spacedim>
const std::vector<std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> > &
TriangulationInfoCache<dim,spacedim>::get_vertex_to_cell_map() const
+template<int dim, int spacedim>
+const std::vector<std::vector<Tensor<1,spacedim>>> &
+TriangulationInfoCache<dim,spacedim>::get_vertex_to_cell_centers_directions() const
+{
+ Assert(flags & cache_vertex_to_cell_centers_directions,
+ ExcAccessToInvalidCacheObject(cache_vertex_to_cell_centers_directions, flags));
+ return vertex_to_cell_centers;
+}
DEAL_II_NAMESPACE_CLOSE