class SparsityPattern;
+namespace internal
+{
+ template<int dim, int spacedim, class Container>
+ class ActiveCellIterator
+ {
+ public:
+ typedef typename Container::active_cell_iterator type;
+ };
+
+ template<int dim, int spacedim>
+ class ActiveCellIterator<dim, spacedim, dealii::DoFHandler<dim, spacedim> >
+ {
+ public:
+#ifndef _MSC_VER
+ typedef typename dealii::DoFHandler<dim, spacedim>::active_cell_iterator type;
+#else
+ typedef TriaActiveIterator < dealii::DoFCellAccessor < dealii::DoFHandler<dim, spacedim>, false > > type;
+#endif
+ };
+
+ template<int dim, int spacedim>
+ class ActiveCellIterator<dim, spacedim, dealii::hp::DoFHandler<dim, spacedim> >
+ {
+ public:
+#ifndef _MSC_VER
+ typedef typename dealii::hp::DoFHandler<dim, spacedim>::active_cell_iterator type;
+#else
+ typedef TriaActiveIterator < dealii::DoFCellAccessor < dealii::hp::DoFHandler<dim, spacedim>, false > > type;
+#endif
+ };
+}
/**
* This namespace is a collection of algorithms working on triangulations,
* to be checked for this case.
*/
template<int dim, template <int, int> class Container, int spacedim>
- std::vector<typename Container<dim,spacedim>::active_cell_iterator>
+#ifndef _MSC_VER
+ std::vector<typename Container<dim, spacedim>::active_cell_iterator>
+#else
+ std::vector<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type>
+#endif
find_cells_adjacent_to_vertex (const Container<dim,spacedim> &container,
const unsigned int vertex_index);
* will have to decide what to do in that case.
*/
template <int dim, template <int,int> class Container, int spacedim>
+#ifndef _MSC_VER
typename Container<dim,spacedim>::active_cell_iterator
+#else
+ typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type
+#endif
find_active_cell_around_point (const Container<dim,spacedim> &container,
const Point<spacedim> &p);
* will have to decide what to do in that case.
*/
template <int dim, template<int, int> class Container, int spacedim>
- std::pair<typename Container<dim,spacedim>::active_cell_iterator, Point<dim> >
+#ifndef _MSC_VER
+ std::pair<typename Container<dim, spacedim>::active_cell_iterator, Point<dim> >
+#else
+ std::pair<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type, Point<dim> >
+#endif
find_active_cell_around_point (const Mapping<dim,spacedim> &mapping,
const Container<dim,spacedim> &container,
const Point<spacedim> &p);
* will have to decide what to do in that case.
*/
template <int dim, int spacedim>
- std::pair<typename hp::DoFHandler<dim,spacedim>::active_cell_iterator, Point<dim> >
+ std::pair<typename hp::DoFHandler<dim, spacedim>::active_cell_iterator, Point<dim> >
find_active_cell_around_point (const hp::MappingCollection<dim,spacedim> &mapping,
const hp::DoFHandler<dim,spacedim> &container,
const Point<spacedim> &p);
#include <deal.II/fe/mapping.h>
#include <deal.II/lac/vector.h>
#include <deal.II/grid/filtered_iterator.h>
-
+#ifdef _MSC_VER
+#include <deal.II/dofs/dof_accessor.h>
+#endif
#include <utility>
DEAL_II_NAMESPACE_OPEN
const DH &dof,
const InputVector &solution,
#ifndef _MSC_VER
- const typename DH::active_cell_iterator &cell,
+ const typename DH::active_cell_iterator &cell,
#else
- const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
+ const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
#endif
Tensor<order, dim> &derivative,
const unsigned int component = 0);
approximate_derivative_tensor(const DH &dof,
const InputVector &solution,
#ifndef _MSC_VER
- const typename DH::active_cell_iterator &cell,
+ const typename DH::active_cell_iterator &cell,
#else
- const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
+ const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
#endif
Tensor<order, dim> &derivative,
const unsigned int component = 0);
qp = get_reference_coordinates (cell, p);
if (!qp)
{
- const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
+ const std::pair<typename dealii::internal::ActiveCellIterator<dim, dim, DH>::type, Point<dim> > my_pair
= GridTools::find_active_cell_around_point (mapping, *dh, p);
AssertThrow (my_pair.first->is_locally_owned(),
ExcPointNotAvailableHere());
qp = get_reference_coordinates (cell, p);
if (!qp)
{
- const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
+ const std::pair<typename dealii::internal::ActiveCellIterator<dim, dim, DH>::type, Point<dim> > my_pair
= GridTools::find_active_cell_around_point (mapping, *dh, p);
AssertThrow (my_pair.first->is_locally_owned(),
ExcPointNotAvailableHere());
qp = get_reference_coordinates (cell, p);
if (!qp)
{
- const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
+ const std::pair<typename dealii::internal::ActiveCellIterator<dim, dim, DH>::type, Point<dim> > my_pair
= GridTools::find_active_cell_around_point (mapping, *dh, p);
AssertThrow (my_pair.first->is_locally_owned(),
ExcPointNotAvailableHere());
qp = get_reference_coordinates (cell, points[0]);
if (!qp)
{
- const std::pair<typename DH::active_cell_iterator, Point<dim> >
+ const std::pair<typename dealii::internal::ActiveCellIterator<dim, dim, DH>::type, Point<dim> >
my_pair = GridTools::find_active_cell_around_point
(mapping, *dh, points[0]);
AssertThrow (my_pair.first->is_locally_owned(),
// the next cell
if (left_over == true)
{
- const std::pair<typename DH::active_cell_iterator, Point<dim> > my_pair
+ const std::pair<typename dealii::internal::ActiveCellIterator<dim, dim, DH>::type, Point<dim> > my_pair
= GridTools::find_active_cell_around_point (mapping, *dh, points[first_outside]);
AssertThrow (my_pair.first->is_locally_owned(),
ExcPointNotAvailableHere());
template<int dim, template<int, int> class Container, int spacedim>
- std::vector<typename Container<dim,spacedim>::active_cell_iterator>
+#ifndef _MSC_VER
+ std::vector<typename Container<dim, spacedim>::active_cell_iterator>
+#else
+ std::vector<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type>
+#endif
find_cells_adjacent_to_vertex(const Container<dim,spacedim> &container,
const unsigned int vertex)
{
// use a set instead of a vector
// to ensure that cells are inserted only
// once
- std::set<typename Container<dim,spacedim>::active_cell_iterator> adjacent_cells;
+ std::set<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type> adjacent_cells;
- typename Container<dim,spacedim>::active_cell_iterator
+ typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type
cell = container.begin_active(),
endc = container.end();
// return the result as a vector, rather than the set we built above
return
- std::vector<typename Container<dim,spacedim>::active_cell_iterator>
+ std::vector<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type>
(adjacent_cells.begin(), adjacent_cells.end());
}
{
template <int dim, template<int, int> class Container, int spacedim>
void find_active_cell_around_point_internal(const Container<dim,spacedim> &container,
- std::set<typename Container<dim,spacedim>::active_cell_iterator> &searched_cells,
- std::set<typename Container<dim,spacedim>::active_cell_iterator> &adjacent_cells)
+#ifndef _MSC_VER
+ std::set<typename Container<dim, spacedim>::active_cell_iterator> &searched_cells,
+ std::set<typename Container<dim, spacedim>::active_cell_iterator> &adjacent_cells)
+#else
+ std::set<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type> &searched_cells,
+ std::set<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type> &adjacent_cells)
+#endif
{
- typedef typename Container<dim,spacedim>::active_cell_iterator cell_iterator;
+#ifndef _MSC_VER
+ typedef typename Container<dim, spacedim>::active_cell_iterator cell_iterator;
+#else
+ typedef typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type cell_iterator;
+#endif
// update the searched cells
searched_cells.insert(adjacent_cells.begin(), adjacent_cells.end());
}
template <int dim, template<int, int> class Container, int spacedim>
- typename Container<dim,spacedim>::active_cell_iterator
+#ifndef _MSC_VER
+ typename Container<dim, spacedim>::active_cell_iterator
+#else
+ typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type
+#endif
find_active_cell_around_point (const Container<dim,spacedim> &container,
const Point<spacedim> &p)
{
template <int dim, template <int, int> class Container, int spacedim>
- std::pair<typename Container<dim,spacedim>::active_cell_iterator, Point<dim> >
+#ifndef _MSC_VER
+ std::pair<typename Container<dim, spacedim>::active_cell_iterator, Point<dim> >
+#else
+ std::pair<typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type, Point<dim> >
+#endif
find_active_cell_around_point (const Mapping<dim,spacedim> &mapping,
const Container<dim,spacedim> &container,
const Point<spacedim> &p)
{
- typedef typename Container<dim,spacedim>::active_cell_iterator active_cell_iterator;
+ typedef typename dealii::internal::ActiveCellIterator<dim, spacedim, Container<dim, spacedim> >::type active_cell_iterator;
// The best distance is set to the
// maximum allowable distance from
std::map< std::pair<unsigned int,unsigned int>, unsigned int >
indexmap;
unsigned int index = 0;
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ for (typename dealii::internal::ActiveCellIterator<dim, spacedim, Triangulation<dim, spacedim> >::type
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell, ++index)
indexmap[std::pair<unsigned int,unsigned int>(cell->level(),cell->index())] = index;
// add entries in both directions
// for both cells
index = 0;
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ for (typename dealii::internal::ActiveCellIterator<dim, spacedim, Triangulation<dim, spacedim> >::type
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell, ++index)
{
// check for an easy return
if (n_partitions == 1)
{
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ for (typename dealii::internal::ActiveCellIterator<dim, spacedim, Triangulation<dim, spacedim> >::type
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
cell->set_subdomain_id (0);
// check for an easy return
if (n_partitions == 1)
{
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ for (typename dealii::internal::ActiveCellIterator<dim, spacedim, Triangulation<dim, spacedim> >::type
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
cell->set_subdomain_id (0);
// finally loop over all cells and set the
// subdomain ids
unsigned int index = 0;
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ for (typename dealii::internal::ActiveCellIterator<dim, spacedim, Triangulation<dim, spacedim> >::type
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell, ++index)
cell->set_subdomain_id (partition_indices[index]);
if (const parallel::distributed::Triangulation<dim,spacedim> *tr
= dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim> *>
(&triangulation))
- for (typename Triangulation<dim,spacedim>::active_cell_iterator
+ for (typename dealii::internal::ActiveCellIterator<dim, spacedim, Triangulation<dim, spacedim> >::type
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
if (cell->is_artificial()
const Point<deal_II_space_dimension> &);
template
- std::vector<X::active_cell_iterator>
- find_cells_adjacent_to_vertex(const X &,
- const unsigned int);
+ std::vector<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, X>::type>
+ find_cells_adjacent_to_vertex(const X &, const unsigned int);
+
template
- X::active_cell_iterator
- find_active_cell_around_point (const X &,
- const Point<deal_II_space_dimension> &p);
+ dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, X>::type
+ find_active_cell_around_point (const X &, const Point<deal_II_space_dimension> &p);
template
- std::pair<X::active_cell_iterator, Point<deal_II_dimension> >
+ std::pair<dealii::internal::ActiveCellIterator<deal_II_dimension, deal_II_space_dimension, X>::type, Point<deal_II_dimension> >
find_active_cell_around_point (const Mapping<deal_II_dimension, deal_II_space_dimension> &,
const X &,
const Point<deal_II_space_dimension> &);
const Point<deal_II_space_dimension> &);
template
- std::vector<parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension>::active_cell_iterator>
+ 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
- parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension>::active_cell_iterator
+ 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<parallel::distributed::Triangulation<deal_II_dimension,deal_II_space_dimension>::active_cell_iterator, Point<deal_II_dimension> >
+ 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> &);
for (deal_II_space_dimension : SPACE_DIMENSIONS)
{
- parallel::distributed::Triangulation<deal_II_space_dimension>::active_cell_iterator
+ dealii::internal::ActiveCellIterator<deal_II_space_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_space_dimension, deal_II_space_dimension> >::type
find_active_cell_around_point (const parallel::distributed::Triangulation<deal_II_space_dimension> &,
const Point<deal_II_space_dimension> &p);
- std::pair<parallel::distributed::Triangulation<deal_II_space_dimension>::active_cell_iterator, Point<deal_II_space_dimension> >
+ std::pair<dealii::internal::ActiveCellIterator<deal_II_space_dimension, deal_II_space_dimension, parallel::distributed::Triangulation<deal_II_space_dimension, deal_II_space_dimension> >::type, Point<deal_II_space_dimension> >
find_active_cell_around_point (const Mapping<deal_II_space_dimension> &,
const parallel::distributed::Triangulation<deal_II_space_dimension> &,
const Point<deal_II_space_dimension> &);
namespace internal
{
/**
- * Compute the derivative approximation on one cell. This computes the full
- * derivative tensor.
- */
- template <class DerivativeDescription, int dim,
- template <int, int> class DH, class InputVector, int spacedim>
+ * Compute the derivative approximation on one cell. This computes the full
+ * derivative tensor.
+ */
+ template <class DerivativeDescription, int dim, template <int, int> class DH, class InputVector, int spacedim>
void
approximate_cell (const Mapping<dim,spacedim> &mapping,
const DH<dim,spacedim> &dof_handler,
const InputVector &solution,
const unsigned int component,
- const typename DH<dim,spacedim>::active_cell_iterator &cell,
+ const TriaActiveIterator < dealii::DoFCellAccessor < DH < dim, spacedim >, false > > &cell,
typename DerivativeDescription::Derivative &derivative)
{
QMidpoint<dim> midpoint_rule;
// active neighbors of a cell
// reserve the maximal number of
// active neighbors
- std::vector<typename DH<dim,spacedim>::active_cell_iterator> active_neighbors;
+ std::vector<TriaActiveIterator < dealii::DoFCellAccessor < DH < dim, spacedim >, false > > > active_neighbors;
+
active_neighbors.reserve (GeometryInfo<dim>::faces_per_cell *
GeometryInfo<dim>::max_children_per_face);
// now loop over all active
// neighbors and collect the
// data we need
- typename std::vector<typename DH<dim,spacedim>::active_cell_iterator>::const_iterator
+ typename std::vector<TriaActiveIterator < dealii::DoFCellAccessor < DH < dim, spacedim >, false > > >::const_iterator
neighbor_ptr = active_neighbors.begin();
for (; neighbor_ptr!=active_neighbors.end(); ++neighbor_ptr)
{
- const typename DH<dim,spacedim>::active_cell_iterator
+ const TriaActiveIterator < dealii::DoFCellAccessor < DH < dim, spacedim >, false > >
neighbor = *neighbor_ptr;
// reinit fe values object...
template <class DerivativeDescription, int dim,
template <int, int> class DH, class InputVector, int spacedim>
void
- approximate (SynchronousIterators<std_cxx11::tuple<typename DH<dim,spacedim>::active_cell_iterator,Vector<float>::iterator> > const &cell,
- const Mapping<dim,spacedim> &mapping,
- const DH<dim,spacedim> &dof_handler,
- const InputVector &solution,
- const unsigned int component)
+ approximate(
+ SynchronousIterators<std_cxx11::tuple<TriaActiveIterator < dealii::DoFCellAccessor < DH < dim, spacedim >, false > >, Vector<float>::iterator> > const &cell,
+ const Mapping<dim,spacedim> &mapping,
+ const DH<dim,spacedim> &dof_handler,
+ const InputVector &solution,
+ const unsigned int component)
{
// if the cell is not locally owned, then there is nothing to do
if (std_cxx11::get<0>(cell.iterators)->is_locally_owned() == false)
typename DerivativeDescription::Derivative derivative;
// call the function doing the actual
// work on this cell
- approximate_cell<DerivativeDescription,dim,DH,InputVector>
+ approximate_cell<DerivativeDescription,dim,DH,InputVector, spacedim>
(mapping,dof_handler,solution,component,std_cxx11::get<0>(cell.iterators),derivative);
+
// evaluate the norm and fill the vector
//*derivative_norm_on_this_cell
*std_cxx11::get<1>(cell.iterators) = DerivativeDescription::derivative_norm (derivative);
Assert (component < dof_handler.get_fe().n_components(),
ExcIndexRange (component, 0, dof_handler.get_fe().n_components()));
- typedef std_cxx11::tuple<typename DH<dim,spacedim>::active_cell_iterator,Vector<float>::iterator>
+ typedef std_cxx11::tuple<TriaActiveIterator < dealii::DoFCellAccessor < DH < dim, spacedim >, false > >, Vector<float>::iterator>
Iterators;
SynchronousIterators<Iterators> begin(Iterators(dof_handler.begin_active(),
derivative_norm.begin())),
const DH &dof,
const InputVector &solution,
#ifndef _MSC_VER
- const typename DH::active_cell_iterator &cell,
+ const typename DH::active_cell_iterator &cell,
#else
- const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
+ const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
#endif
Tensor<order, dim> &derivative,
const unsigned int component)
approximate_derivative_tensor(const DH &dof,
const InputVector &solution,
#ifndef _MSC_VER
- const typename DH::active_cell_iterator &cell,
+ const typename DH::active_cell_iterator &cell,
#else
- const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
+ const TriaActiveIterator < dealii::DoFCellAccessor < DH, false > > &cell,
#endif
Tensor<order, dim> &derivative,
const unsigned int component)