* declaration is used for the
* default argument in
* @p{set_boundary}.
- */
- static const StraightBoundary<dim> straight_boundary;
+ *
+ * The proper way would have been
+ * to use a static object here,
+ * rather than a pointer to an
+ * object. However, we have to
+ * work around a bug in gcc2.95,
+ * where the compiler tries to
+ * instantiate @p{Triangulation}
+ * while instantiating
+ * @p{Boundary} (which it needs
+ * to do, since local typedefs
+ * are involved), but then tries
+ * to in turn instantiate
+ * @p{StraightBoundary} because
+ * of this member variable. This
+ * is not needed since the member
+ * variable is a static one, but
+ * the compiler tries anyway and
+ * finds that it can't since the
+ * base class @p{Boundary} is not
+ * yet complete...
+ */
+ static const StraightBoundary<dim> *straight_boundary;
public:
* straight line.
*/
void set_boundary (unsigned int number,
- const Boundary<dim> &boundary_object = straight_boundary);
+ const Boundary<dim> &boundary_object = *straight_boundary);
/**
* Return a constant reference to
#include <cmath>
+
+// initialize the @p{straight_boundary} pointer of the triangulation
+// class. for the reasons why it is done like this, see the
+// documentation of that member variable
+namespace
+{
+ const StraightBoundary<deal_II_dimension> dummy_straight_boundary;
+};
+
+
template <int dim>
-const StraightBoundary<dim> Triangulation<dim>::straight_boundary;
+const StraightBoundary<dim> *
+Triangulation<dim>::straight_boundary = &dummy_straight_boundary;
// set default boundary for all possible components
for (unsigned int i=0;i<255;++i)
{
- boundary[i] = &straight_boundary;
- straight_boundary.subscribe();
+ boundary[i] = straight_boundary;
+ boundary[i]->subscribe();
}
};
for (unsigned int i=0; i<255; ++i)
{
boundary[i]->unsubscribe ();
- boundary[i] = &straight_boundary;
- straight_boundary.subscribe ();
+ boundary[i] = straight_boundary;
+ boundary[i]->subscribe ();
};
number_cache = TriaNumberCache<dim>();