#include <deal.II/grid/grid_generator.h>
// We would like to use boundaries which are not straight lines, so we import
// some classes which predefine some boundary descriptions:
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
// Output of grids in various graphics formats:
#include <deal.II/grid/grid_out.h>
// complicated topic; if you're confused about what exactly is happening
// here, you may want to look at the
// @ref GlossBoundaryIndicator "glossary entry on this topic".)
- const HyperShellBoundary<2> boundary_description(center);
- triangulation.set_boundary (0, boundary_description);
+ const PolarManifold<2> boundary_description(center);
+ triangulation.set_manifold (0, boundary_description);
// In order to demonstrate how to write a loop over all cells, we will
// refine the grid in five steps towards the inner circle of the domain:
// follows. Note that this sets the boundary object used for part "0" of the
// boundary back to a default object, over which the triangulation has full
// control.
- triangulation.set_boundary (0);
+ triangulation.set_manifold (0);
// An alternative to doing so, and one that is frequently more convenient,
// would have been to declare the boundary object before the triangulation
// object. In that case, the triangulation would have let lose of the
* and returns its space representation.
*/
template <int spacedim>
-class PolarManifold : public ManifoldChart<spacedim,spacedim>
+class PolarManifold : public FlatManifold<spacedim>
{
public:
PolarManifold(const Point<spacedim> center = Point<spacedim>());
const std::vector<double> &weights) const;
- virtual Point<spacedim>
- pull_back (const Point<spacedim> &space_point) const;
-
- virtual Point<spacedim>
- push_forward (const Point<spacedim> &chart_point) const;
-
private:
Point<spacedim> center;
};
virtual
void
create_notification (const Triangulation<dim, spacedim> &tria);
- } DEAL_II_DEPRECATED;
+ }; // DEAL_II_DEPRECATED;
/**
* A structure that is used as an
grid_tools.inst.in
intergrid_map.inst.in
manifold.inst.in
+ manifold_lib.inst.in
tria_accessor.inst.in
tria_boundary.inst.in
tria_boundary_lib.inst.in
{}
-template <int spacedim>
-Point<spacedim>
-PolarManifold<spacedim>::push_forward (const Point<spacedim> &chart_point) const
-{
- return chart_point;
-}
template <int spacedim>
Point<spacedim>
-PolarManifold<spacedim>::pull_back (const Point<spacedim> &space_point) const
+PolarManifold<spacedim>::
+get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
+ const std::vector<double> &weights) const
{
- return space_point;
+ Assert(surrounding_points.size() == weights.size(),
+ ExcDimensionMismatch(surrounding_points.size(), weights.size()));
+
+ double radius = 0;
+ for(unsigned int i=0; i<surrounding_points.size(); ++i)
+ radius += weights[i]*surrounding_points[i].norm();
+
+ Point<spacedim> p = FlatManifold<spacedim>::get_new_point(surrounding_points, weights);
+
+ p = p*(radius/p.norm());
+ return p;
}
+
+
+// explicit instantiations
+#include "manifold_lib.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: tria_boundary_lib.inst.in 30130 2013-07-23 13:01:18Z heltai $
+//
+// Copyright (C) 1999 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+ template class PolarManifold<deal_II_dimension>;
+// template class ConeBoundary<deal_II_dimension>;
+// template class HyperBallBoundary<deal_II_dimension>;
+// template class HalfHyperBallBoundary<deal_II_dimension>;
+// template class HyperShellBoundary<deal_II_dimension>;
+// template class HalfHyperShellBoundary<deal_II_dimension>;
+//
+// #if deal_II_dimension != 3
+// template class HyperBallBoundary<deal_II_dimension,deal_II_dimension+1>;
+// #endif
+// #if deal_II_dimension == 3
+// template class CylinderBoundary<deal_II_dimension-1,deal_II_dimension>;
+// #endif
+ }
+
+