Reference documentation for deal.II version 8.5.1
grid_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2001 - 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__grid_tools_H
17 #define dealii__grid_tools_H
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/geometry_info.h>
22 #include <deal.II/dofs/dof_handler.h>
23 #include <deal.II/fe/mapping.h>
24 #include <deal.II/fe/mapping_q1.h>
25 #include <deal.II/grid/tria.h>
26 #include <deal.II/grid/tria_accessor.h>
27 #include <deal.II/grid/tria_iterator.h>
28 #include <deal.II/hp/dof_handler.h>
29 
30 #include <bitset>
31 #include <list>
32 #include <set>
33 
34 DEAL_II_NAMESPACE_OPEN
35 
36 namespace parallel
37 {
38  namespace distributed
39  {
40  template <int, int> class Triangulation;
41  }
42 }
43 
44 namespace hp
45 {
46  template <int, int> class MappingCollection;
47 }
48 
49 class SparsityPattern;
50 
51 namespace internal
52 {
53  template<int dim, int spacedim, class MeshType>
54  class ActiveCellIterator
55  {
56  public:
57  typedef typename MeshType::active_cell_iterator type;
58  };
59 
60  template<int dim, int spacedim>
61  class ActiveCellIterator<dim, spacedim, ::DoFHandler<dim, spacedim> >
62  {
63  public:
64 #ifndef _MSC_VER
65  typedef typename ::DoFHandler<dim, spacedim>::active_cell_iterator type;
66 #else
68 #endif
69  };
70 
71  template<int dim, int spacedim>
72  class ActiveCellIterator<dim, spacedim, ::hp::DoFHandler<dim, spacedim> >
73  {
74  public:
75 #ifndef _MSC_VER
76  typedef typename ::hp::DoFHandler<dim, spacedim>::active_cell_iterator type;
77 #else
79 #endif
80  };
81 }
82 
91 namespace GridTools
92 {
97 
104  template <int dim, int spacedim>
105  double diameter (const Triangulation<dim, spacedim> &tria);
106 
133  template <int dim, int spacedim>
134  double volume (const Triangulation<dim,spacedim> &tria,
136 
141  template <int dim, int spacedim>
142  double
144 
148  template <int dim, int spacedim>
149  double
151 
161  template <int dim>
162  double cell_measure (const std::vector<Point<dim> > &all_vertices,
163  const unsigned int (&vertex_indices)[GeometryInfo<dim>::vertices_per_cell]);
164 
170  template <int dim, typename T>
171  double cell_measure (const T &, ...);
172 
178 
195  template <int dim, int spacedim>
196  void delete_unused_vertices (std::vector<Point<spacedim> > &vertices,
197  std::vector<CellData<dim> > &cells,
198  SubCellData &subcelldata);
199 
215  template <int dim, int spacedim>
216  void delete_duplicated_vertices (std::vector<Point<spacedim> > &all_vertices,
217  std::vector<CellData<dim> > &cells,
218  SubCellData &subcelldata,
219  std::vector<unsigned int> &considered_vertices,
220  const double tol=1e-12);
221 
227 
251  template <int dim, typename Transformation, int spacedim>
252  void transform (const Transformation &transformation,
253  Triangulation<dim,spacedim> &triangulation);
254 
260  template <int dim, int spacedim>
261  void shift (const Tensor<1,spacedim> &shift_vector,
262  Triangulation<dim,spacedim> &triangulation);
263 
264 
272  void rotate (const double angle,
273  Triangulation<2> &triangulation);
274 
287  template<int dim>
288  void
289  rotate (const double angle,
290  const unsigned int axis,
291  Triangulation<dim,3> &triangulation);
292 
351  template <int dim>
352  void laplace_transform (const std::map<unsigned int,Point<dim> > &new_points,
353  Triangulation<dim> &tria,
354  const Function<dim,double> *coefficient = 0,
355  const bool solve_for_absolute_positions = false);
356 
362  template <int dim, int spacedim>
363  std::map<unsigned int,Point<spacedim> >
365 
373  template <int dim, int spacedim>
374  void scale (const double scaling_factor,
375  Triangulation<dim, spacedim> &triangulation);
376 
387  template <int dim, int spacedim>
388  void distort_random (const double factor,
389  Triangulation<dim, spacedim> &triangulation,
390  const bool keep_boundary=true);
391 
427  template<int dim, int spacedim>
428  void
430  const bool isotropic = false,
431  const unsigned int max_iterations = 100);
432 
458  template<int dim, int spacedim>
459  void
461  const double max_ratio = 1.6180339887,
462  const unsigned int max_iterations = 5);
463 
469 
481  template <int dim, template <int, int> class MeshType, int spacedim>
482  unsigned int
483  find_closest_vertex (const MeshType<dim, spacedim> &mesh,
484  const Point<spacedim> &p);
485 
510  template<int dim, template <int, int> class MeshType, int spacedim>
511 #ifndef _MSC_VER
512  std::vector<typename MeshType<dim, spacedim>::active_cell_iterator>
513 #else
514  std::vector<typename ::internal::ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim> >::type>
515 #endif
516  find_cells_adjacent_to_vertex (const MeshType<dim,spacedim> &container,
517  const unsigned int vertex_index);
518 
519 
552  template <int dim, template <int,int> class MeshType, int spacedim>
553 #ifndef _MSC_VER
554  typename MeshType<dim,spacedim>::active_cell_iterator
555 #else
556  typename ::internal::ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim> >::type
557 #endif
558  find_active_cell_around_point (const MeshType<dim,spacedim> &mesh,
559  const Point<spacedim> &p);
560 
606  template <int dim, template<int, int> class MeshType, int spacedim>
607 #ifndef _MSC_VER
608  std::pair<typename MeshType<dim, spacedim>::active_cell_iterator, Point<dim> >
609 #else
610  std::pair<typename ::internal::ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim> >::type, Point<dim> >
611 #endif
613  const MeshType<dim,spacedim> &mesh,
614  const Point<spacedim> &p);
615 
637  template <int dim, int spacedim>
638  std::pair<typename hp::DoFHandler<dim, spacedim>::active_cell_iterator, Point<dim> >
640  const hp::DoFHandler<dim,spacedim> &mesh,
641  const Point<spacedim> &p);
642 
664  template <class MeshType>
665  std::vector<typename MeshType::active_cell_iterator>
666  get_active_child_cells (const typename MeshType::cell_iterator &cell);
667 
678  template <class MeshType>
679  void
680  get_active_neighbors (const typename MeshType::active_cell_iterator &cell,
681  std::vector<typename MeshType::active_cell_iterator> &active_neighbors);
682 
734  template <class MeshType>
735  std::vector<typename MeshType::active_cell_iterator>
737  (const MeshType &mesh,
738  const std_cxx11::function<bool (const typename MeshType::active_cell_iterator &)> &predicate);
739 
755  template <class MeshType>
756  std::vector<typename MeshType::active_cell_iterator>
757  compute_ghost_cell_halo_layer (const MeshType &mesh);
758 
759 
768  template <int dim, int spacedim>
769  std::vector<std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> >
770  vertex_to_cell_map(const Triangulation<dim,spacedim> &triangulation);
771 
783  template <int dim, int spacedim>
784  std::map<unsigned int, types::global_vertex_index>
787 
801  template<int dim, int spacedim>
802  std::pair<unsigned int, double>
804 
810 
819  template <int dim, int spacedim>
820  void
822  DynamicSparsityPattern &connectivity);
823 
829  template <int dim, int spacedim>
830  void
832  SparsityPattern &connectivity) DEAL_II_DEPRECATED;
833 
842  template <int dim, int spacedim>
843  void
845  DynamicSparsityPattern &connectivity);
846 
859  template <int dim, int spacedim>
860  void
861  partition_triangulation (const unsigned int n_partitions,
862  Triangulation<dim, spacedim> &triangulation);
863 
906  template <int dim, int spacedim>
907  void
908  partition_triangulation (const unsigned int n_partitions,
909  const SparsityPattern &cell_connection_graph,
910  Triangulation<dim,spacedim> &triangulation);
911 
922  template <int dim, int spacedim>
923  void
925  std::vector<types::subdomain_id> &subdomain);
926 
941  template <int dim, int spacedim>
942  unsigned int
944  const types::subdomain_id subdomain);
945 
946 
976  template <int dim, int spacedim>
977  std::vector<bool>
979 
985 
1014  template <typename MeshType>
1015  std::list<std::pair<typename MeshType::cell_iterator,
1016  typename MeshType::cell_iterator> >
1017  get_finest_common_cells (const MeshType &mesh_1,
1018  const MeshType &mesh_2);
1019 
1029  template <int dim, int spacedim>
1030  bool
1032  const Triangulation<dim, spacedim> &mesh_2);
1033 
1043  template <typename MeshType>
1044  bool
1045  have_same_coarse_mesh (const MeshType &mesh_1,
1046  const MeshType &mesh_2);
1047 
1053 
1069  template <int dim, int spacedim>
1072  Triangulation<dim,spacedim> &triangulation);
1073 
1074 
1075 
1076 
1083 
1084 
1124  template <class MeshType>
1125  std::vector<typename MeshType::active_cell_iterator>
1126  get_patch_around_cell(const typename MeshType::active_cell_iterator &cell);
1127 
1128 
1152  template <class Container>
1153  std::vector<typename Container::cell_iterator>
1154  get_cells_at_coarsest_common_level(const std::vector<typename Container::active_cell_iterator> &patch_cells);
1155 
1224  template <class Container>
1225  void
1227  const std::vector<typename Container::active_cell_iterator> &patch,
1230  typename Container::active_cell_iterator> &patch_to_global_tria_map);
1231 
1268  template <class DoFHandlerType>
1269  std::map< types::global_dof_index,std::vector<typename DoFHandlerType::active_cell_iterator> >
1270  get_dof_to_support_patch_map(DoFHandlerType &dof_handler);
1271 
1272 
1279 
1285  template<typename CellIterator>
1286  struct PeriodicFacePair
1287  {
1291  CellIterator cell[2];
1292 
1297  unsigned int face_idx[2];
1298 
1304  std::bitset<3> orientation;
1305 
1319  };
1320 
1321 
1387  template<typename FaceIterator>
1388  bool
1389  orthogonal_equality (std::bitset<3> &orientation,
1390  const FaceIterator &face1,
1391  const FaceIterator &face2,
1392  const int direction,
1395  const FullMatrix<double> &matrix = FullMatrix<double>());
1396 
1397 
1401  template<typename FaceIterator>
1402  bool
1403  orthogonal_equality (const FaceIterator &face1,
1404  const FaceIterator &face2,
1405  const int direction,
1408  const FullMatrix<double> &matrix = FullMatrix<double>());
1409 
1410 
1469  template <typename MeshType>
1470  void
1472  (const MeshType &mesh,
1473  const types::boundary_id b_id1,
1474  const types::boundary_id b_id2,
1475  const int direction,
1476  std::vector<PeriodicFacePair<typename MeshType::cell_iterator> > &matched_pairs,
1478  const FullMatrix<double> &matrix = FullMatrix<double>());
1479 
1480 
1503  template <typename MeshType>
1504  void
1506  (const MeshType &mesh,
1507  const types::boundary_id b_id,
1508  const int direction,
1509  std::vector<PeriodicFacePair<typename MeshType::cell_iterator> > &matched_pairs,
1510  const ::Tensor<1,MeshType::space_dimension> &offset = ::Tensor<1,MeshType::space_dimension>(),
1511  const FullMatrix<double> &matrix = FullMatrix<double>());
1512 
1518 
1541  template <int dim, int spacedim>
1543  const bool reset_boundary_ids=false);
1544 
1576  template <int dim, int spacedim>
1578  const bool compute_face_ids=false);
1579 
1580 
1586 
1587 
1592  int,
1593  << "The number of partitions you gave is " << arg1
1594  << ", but must be greater than zero.");
1599  int,
1600  << "The subdomain id " << arg1
1601  << " has no cells associated with it.");
1606 
1611  double,
1612  << "The scaling factor must be positive, but it is " << arg1 << ".");
1616  template <int N>
1618  Point<N>,
1619  << "The point <" << arg1
1620  << "> could not be found inside any of the "
1621  << "coarse grid cells.");
1625  template <int N>
1627  Point<N>,
1628  << "The point <" << arg1
1629  << "> could not be found inside any of the "
1630  << "subcells of a coarse grid cell.");
1631 
1636  unsigned int,
1637  << "The given vertex with index " << arg1
1638  << " is not used in the given triangulation.");
1639 
1640 
1643 } /*namespace GridTools*/
1644 
1645 
1646 
1647 /* ----------------- Template function --------------- */
1648 
1649 #ifndef DOXYGEN
1650 
1651 namespace GridTools
1652 {
1653  template <int dim, typename T>
1654  double cell_measure (const T &, ...)
1655  {
1656  Assert(false, ExcNotImplemented());
1657  return std::numeric_limits<double>::quiet_NaN();
1658  }
1659 
1660  template <int dim, typename Predicate, int spacedim>
1661  void transform (const Predicate &predicate,
1662  Triangulation<dim, spacedim> &triangulation)
1663  {
1664  std::vector<bool> treated_vertices (triangulation.n_vertices(),
1665  false);
1666 
1667  // loop over all active cells, and
1668  // transform those vertices that
1669  // have not yet been touched. note
1670  // that we get to all vertices in
1671  // the triangulation by only
1672  // visiting the active cells.
1674  cell = triangulation.begin_active (),
1675  endc = triangulation.end ();
1676  for (; cell!=endc; ++cell)
1677  for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
1678  if (treated_vertices[cell->vertex_index(v)] == false)
1679  {
1680  // transform this vertex
1681  cell->vertex(v) = predicate(cell->vertex(v));
1682  // and mark it as treated
1683  treated_vertices[cell->vertex_index(v)] = true;
1684  };
1685 
1686 
1687  // now fix any vertices on hanging nodes so that we don't create any holes
1688  if (dim==2)
1689  {
1691  cell = triangulation.begin_active(),
1692  endc = triangulation.end();
1693  for (; cell!=endc; ++cell)
1694  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
1695  if (cell->face(face)->has_children() &&
1696  !cell->face(face)->at_boundary())
1697  {
1698  // this line has children
1699  cell->face(face)->child(0)->vertex(1)
1700  = (cell->face(face)->vertex(0) +
1701  cell->face(face)->vertex(1)) / 2;
1702  }
1703  }
1704  else if (dim==3)
1705  {
1707  cell = triangulation.begin_active(),
1708  endc = triangulation.end();
1709  for (; cell!=endc; ++cell)
1710  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
1711  if (cell->face(face)->has_children() &&
1712  !cell->face(face)->at_boundary())
1713  {
1714  // this face has hanging nodes
1715  cell->face(face)->child(0)->vertex(1)
1716  = (cell->face(face)->vertex(0) + cell->face(face)->vertex(1)) / 2.0;
1717  cell->face(face)->child(0)->vertex(2)
1718  = (cell->face(face)->vertex(0) + cell->face(face)->vertex(2)) / 2.0;
1719  cell->face(face)->child(1)->vertex(3)
1720  = (cell->face(face)->vertex(1) + cell->face(face)->vertex(3)) / 2.0;
1721  cell->face(face)->child(2)->vertex(3)
1722  = (cell->face(face)->vertex(2) + cell->face(face)->vertex(3)) / 2.0;
1723 
1724  // center of the face
1725  cell->face(face)->child(0)->vertex(3)
1726  = (cell->face(face)->vertex(0) + cell->face(face)->vertex(1)
1727  + cell->face(face)->vertex(2) + cell->face(face)->vertex(3)) / 4.0;
1728  }
1729  }
1730 
1731  // Make sure FEValues notices that the mesh has changed
1732  triangulation.signals.mesh_movement();
1733  }
1734 
1735 
1736 
1737  template <class MeshType>
1738  std::vector<typename MeshType::active_cell_iterator>
1739  get_active_child_cells (const typename MeshType::cell_iterator &cell)
1740  {
1741  std::vector<typename MeshType::active_cell_iterator> child_cells;
1742 
1743  if (cell->has_children())
1744  {
1745  for (unsigned int child=0;
1746  child<cell->n_children(); ++child)
1747  if (cell->child (child)->has_children())
1748  {
1749  const std::vector<typename MeshType::active_cell_iterator>
1750  children = get_active_child_cells<MeshType> (cell->child(child));
1751  child_cells.insert (child_cells.end(),
1752  children.begin(), children.end());
1753  }
1754  else
1755  child_cells.push_back (cell->child(child));
1756  }
1757 
1758  return child_cells;
1759  }
1760 
1761 
1762 
1763  template <class MeshType>
1764  void
1765  get_active_neighbors(const typename MeshType::active_cell_iterator &cell,
1766  std::vector<typename MeshType::active_cell_iterator> &active_neighbors)
1767  {
1768  active_neighbors.clear ();
1769  for (unsigned int n=0; n<GeometryInfo<MeshType::dimension>::faces_per_cell; ++n)
1770  if (! cell->at_boundary(n))
1771  {
1772  if (MeshType::dimension == 1)
1773  {
1774  // check children of neighbor. note
1775  // that in 1d children of the neighbor
1776  // may be further refined. In 1d the
1777  // case is simple since we know what
1778  // children bound to the present cell
1779  typename MeshType::cell_iterator
1780  neighbor_child = cell->neighbor(n);
1781  if (!neighbor_child->active())
1782  {
1783  while (neighbor_child->has_children())
1784  neighbor_child = neighbor_child->child (n==0 ? 1 : 0);
1785 
1786  Assert (neighbor_child->neighbor(n==0 ? 1 : 0)==cell,
1787  ExcInternalError());
1788  }
1789  active_neighbors.push_back (neighbor_child);
1790  }
1791  else
1792  {
1793  if (cell->face(n)->has_children())
1794  // this neighbor has children. find
1795  // out which border to the present
1796  // cell
1797  for (unsigned int c=0; c<cell->face(n)->number_of_children(); ++c)
1798  active_neighbors.push_back (cell->neighbor_child_on_subface(n,c));
1799  else
1800  {
1801  // the neighbor must be active
1802  // himself
1803  Assert(cell->neighbor(n)->active(), ExcInternalError());
1804  active_neighbors.push_back(cell->neighbor(n));
1805  }
1806  }
1807  }
1808  }
1809 }
1810 
1811 #endif
1812 
1813 DEAL_II_NAMESPACE_CLOSE
1814 
1815 /*---------------------------- grid_tools.h ---------------------------*/
1816 /* end of #ifndef dealii__grid_tools_H */
1817 #endif
1818 /*---------------------------- grid_tools.h ---------------------------*/
void remove_hanging_nodes(Triangulation< dim, spacedim > &tria, const bool isotropic=false, const unsigned int max_iterations=100)
Definition: grid_tools.cc:3943
static ::ExceptionBase & ExcScalingFactorNotPositive(double arg1)
unsigned int n_vertices() const
std::map< unsigned int, Point< spacedim > > get_all_vertices_at_boundary(const Triangulation< dim, spacedim > &tria)
Definition: grid_tools.cc:799
void copy_boundary_to_manifold_id(Triangulation< dim, spacedim > &tria, const bool reset_boundary_ids=false)
Definition: grid_tools.cc:3844
double diameter(const Triangulation< dim, spacedim > &tria)
Definition: grid_tools.cc:66
void distort_random(const double factor, Triangulation< dim, spacedim > &triangulation, const bool keep_boundary=true)
Definition: grid_tools.cc:831
void delete_duplicated_vertices(std::vector< Point< spacedim > > &all_vertices, std::vector< CellData< dim > > &cells, SubCellData &subcelldata, std::vector< unsigned int > &considered_vertices, const double tol=1e-12)
Definition: grid_tools.cc:464
double maximal_cell_diameter(const Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:2350
static ::ExceptionBase & ExcPointNotFoundInCoarseGrid(Point< N > arg1)
bool have_same_coarse_mesh(const Triangulation< dim, spacedim > &mesh_1, const Triangulation< dim, spacedim > &mesh_2)
Definition: grid_tools.cc:2293
std::pair< unsigned int, double > get_longest_direction(typename Triangulation< dim, spacedim >::active_cell_iterator cell)
Definition: grid_tools.cc:3913
bool orthogonal_equality(std::bitset< 3 > &orientation, const FaceIterator &face1, const FaceIterator &face2, const int direction, const Tensor< 1, FaceIterator::AccessorType::space_dimension > &offset=Tensor< 1, FaceIterator::AccessorType::space_dimension >(), const FullMatrix< double > &matrix=FullMatrix< double >())
Definition: grid_tools.cc:3577
void scale(const double scaling_factor, Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:653
double volume(const Triangulation< dim, spacedim > &tria, const Mapping< dim, spacedim > &mapping=(StaticMappingQ1< dim, spacedim >::mapping))
Definition: grid_tools.cc:121
std::vector< std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > vertex_to_cell_map(const Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:1643
static ::ExceptionBase & ExcNonExistentSubdomain(int arg1)
std::vector< typename MeshType::active_cell_iterator > get_active_child_cells(const typename MeshType::cell_iterator &cell)
active_cell_iterator begin_active(const unsigned int level=0) const
Definition: tria.cc:10668
std::map< unsigned int, types::global_vertex_index > compute_local_to_global_vertex_index_map(const parallel::distributed::Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:1687
std::bitset< 3 > orientation
Definition: grid_tools.h:1304
void get_vertex_connectivity_of_cells(const Triangulation< dim, spacedim > &triangulation, DynamicSparsityPattern &connectivity)
Definition: grid_tools.cc:2030
cell_iterator end() const
Definition: tria.cc:10736
static ::ExceptionBase & ExcTriangulationHasBeenRefined()
Definition: tria.h:76
void laplace_transform(const std::map< unsigned int, Point< dim > > &new_points, Triangulation< dim > &tria, const Function< dim, double > *coefficient=0, const bool solve_for_absolute_positions=false)
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
double cell_measure(const std::vector< Point< dim > > &all_vertices, const unsigned int(&vertex_indices)[GeometryInfo< dim >::vertices_per_cell])
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:564
#define Assert(cond, exc)
Definition: exceptions.h:313
Signals signals
Definition: tria.h:2183
Abstract base class for mapping classes.
Definition: dof_tools.h:46
void get_active_neighbors(const typename MeshType::active_cell_iterator &cell, std::vector< typename MeshType::active_cell_iterator > &active_neighbors)
void collect_periodic_faces(const MeshType &mesh, const types::boundary_id b_id1, const types::boundary_id b_id2, const int direction, std::vector< PeriodicFacePair< typename MeshType::cell_iterator > > &matched_pairs, const Tensor< 1, MeshType::space_dimension > &offset=::Tensor< 1, MeshType::space_dimension >(), const FullMatrix< double > &matrix=FullMatrix< double >())
Definition: grid_tools.cc:3707
#define DeclException0(Exception0)
Definition: exceptions.h:541
unsigned int face_idx[2]
Definition: grid_tools.h:1297
void remove_anisotropy(Triangulation< dim, spacedim > &tria, const double max_ratio=1.6180339887, const unsigned int max_iterations=5)
Definition: grid_tools.cc:3978
void build_triangulation_from_patch(const std::vector< typename Container::active_cell_iterator > &patch, Triangulation< Container::dimension, Container::space_dimension > &local_triangulation, std::map< typename Triangulation< Container::dimension, Container::space_dimension >::active_cell_iterator, typename Container::active_cell_iterator > &patch_to_global_tria_map)
Definition: grid_tools.cc:3013
void copy_material_to_manifold_id(Triangulation< dim, spacedim > &tria, const bool compute_face_ids=false)
Definition: grid_tools.cc:3887
void rotate(const double angle, Triangulation< 2 > &triangulation)
Definition: grid_tools.cc:634
void partition_triangulation(const unsigned int n_partitions, Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:2056
Triangulation< dim, spacedim >::DistortedCellList fix_up_distorted_child_cells(const typename Triangulation< dim, spacedim >::DistortedCellList &distorted_cells, Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:2894
unsigned int subdomain_id
Definition: types.h:42
Definition: hp.h:102
std::vector< typename MeshType::active_cell_iterator > compute_ghost_cell_halo_layer(const MeshType &mesh)
Definition: grid_tools.cc:1621
double minimal_cell_diameter(const Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:2335
std::map< types::global_dof_index, std::vector< typename DoFHandlerType::active_cell_iterator > > get_dof_to_support_patch_map(DoFHandlerType &dof_handler)
Definition: grid_tools.cc:3193
void transform(const Transformation &transformation, Triangulation< dim, spacedim > &triangulation)
unsigned int find_closest_vertex(const MeshType< dim, spacedim > &mesh, const Point< spacedim > &p)
Definition: grid_tools.cc:1053
std::vector< typename MeshType< dim, spacedim >::active_cell_iterator > find_cells_adjacent_to_vertex(const MeshType< dim, spacedim > &container, const unsigned int vertex_index)
Definition: grid_tools.cc:1100
void get_subdomain_association(const Triangulation< dim, spacedim > &triangulation, std::vector< types::subdomain_id > &subdomain)
Definition: grid_tools.cc:2140
void get_face_connectivity_of_cells(const Triangulation< dim, spacedim > &triangulation, DynamicSparsityPattern &connectivity)
Definition: grid_tools.cc:1971
void delete_unused_vertices(std::vector< Point< spacedim > > &vertices, std::vector< CellData< dim > > &cells, SubCellData &subcelldata)
Definition: grid_tools.cc:368
FullMatrix< double > matrix
Definition: grid_tools.h:1318
static ::ExceptionBase & ExcNotImplemented()
std::vector< bool > get_locally_owned_vertices(const Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:2172
std::vector< typename Container::cell_iterator > get_cells_at_coarsest_common_level(const std::vector< typename Container::active_cell_iterator > &patch_cells)
Definition: grid_tools.cc:2974
unsigned char boundary_id
Definition: types.h:110
static ::ExceptionBase & ExcVertexNotUsed(unsigned int arg1)
std::vector< typename MeshType::active_cell_iterator > compute_active_cell_halo_layer(const MeshType &mesh, const std_cxx11::function< bool(const typename MeshType::active_cell_iterator &)> &predicate)
Definition: grid_tools.cc:1583
std::list< std::pair< typename MeshType::cell_iterator, typename MeshType::cell_iterator > > get_finest_common_cells(const MeshType &mesh_1, const MeshType &mesh_2)
Definition: grid_tools.cc:2202
static ::ExceptionBase & ExcPointNotFound(Point< N > arg1)
MeshType< dim, spacedim >::active_cell_iterator find_active_cell_around_point(const MeshType< dim, spacedim > &mesh, const Point< spacedim > &p)
Definition: grid_tools.cc:1298
void shift(const Tensor< 1, spacedim > &shift_vector, Triangulation< dim, spacedim > &triangulation)
Definition: grid_tools.cc:625
unsigned int count_cells_with_subdomain_association(const Triangulation< dim, spacedim > &triangulation, const types::subdomain_id subdomain)
Definition: grid_tools.cc:2155
std::vector< typename MeshType::active_cell_iterator > get_patch_around_cell(const typename MeshType::active_cell_iterator &cell)
Definition: grid_tools.cc:2931
static ::ExceptionBase & ExcInternalError()