template <int dim>
static void colorize_hyper_rectangle (Triangulation<dim> &tria);
- /**
- * Declaration of the above
- * function for 1d.
- */
- static void colorize_hyper_rectangle (Triangulation<1> &tria);
-
/**
* Perform the action specified
* by the @p colorize flag of
const double epsilon);
/**
- * Declaration of the above
- * function for 1d.
+ * Assign boundary number zero to
+ * the inner shell boundary and 1
+ * to the outer.
*/
+ template<int dim>
static
void
- colorize_subdivided_hyper_rectangle (Triangulation<1> &tria,
- const Point<1> &p1,
- const Point<1> &p2,
- const double epsilon);
-
+ colorize_hyper_shell (Triangulation<dim>& tria,
+ const Point<dim>& center,
+ const double inner_radius,
+ const double outer_radius);
+
/**
* Solve the Laplace equation for
* @p laplace_transformation
#if deal_II_dimension == 1
// Implementation for 1D only
+template <int dim>
void
-GridGenerator::colorize_hyper_rectangle (Triangulation<1> &)
+GridGenerator::colorize_hyper_rectangle (Triangulation<dim> &)
{
// nothing to do in 1d
}
#if deal_II_dimension == 1
// Implementation for 1D only
+template <int dim>
void
-GridGenerator::colorize_subdivided_hyper_rectangle (Triangulation<1> &,
- const Point<1> &,
- const Point<1> &,
+GridGenerator::colorize_subdivided_hyper_rectangle (Triangulation<dim> &,
+ const Point<dim> &,
+ const Point<dim> &,
const double )
{
// nothing to do in 1d
Assert (false, ExcNotImplemented());
}
+// Implementation for 1D only
+template <int dim>
+void GridGenerator::colorize_hyper_shell (Triangulation<dim> &,
+ const Point<dim> &,
+ const double,
+ const double)
+{
+ Assert (false, ExcNotImplemented());
+}
+
// Implementation for 1D only
template <int dim>
void GridGenerator::cylinder_shell (Triangulation<dim>&,
#endif
+#if deal_II_dimension != 1
+
+// Empty implementation for 1d is above
+template <int dim>
+void
+GridGenerator::colorize_hyper_shell(
+ Triangulation<dim>& tria,
+ const Point<dim>& center,
+ const double inner_radius,
+ const double outer_radius)
+{
+ double divide = .5*(inner_radius+outer_radius);
+ divide *= divide;
+
+ for (typename Triangulation<dim>::cell_iterator it = tria.begin();
+ it != tria.end(); ++it)
+ for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+ if (it->at_boundary(f))
+ {
+ // Take first vertex of
+ // boundary face
+ Point<dim> p = it->face(f)->vertex(0);
+ p -= center;
+ if (p.square() > divide)
+ it->face(f)->set_boundary_indicator(1);
+ }
+}
+
+
+#endif
+
+
// explicit instantiations
template void
GridGenerator::hyper_cube<deal_II_dimension> (
Triangulation<deal_II_dimension> &,
const double, const double, const double, const unsigned int, bool);
+template void
+GridGenerator::colorize_hyper_shell(
+ Triangulation<deal_II_dimension>& tria,
+ const Point<deal_II_dimension>& center,
+ const double inner_radius, const double outer_radius);
template void
GridGenerator::