+/*------------------------------------------------------------------------*/
+
+
+/**
+ * Structure which is passed to the #Triangulation<dim>::create_triangulation#
+ * function. It contains all data needed to construct a cell, namely the
+ * indices of the vertices and the material indicator.
+ */
+template <int dim>
+struct CellData {
+ int vertices[GeometryInfo<dim>::vertices_per_cell];
+ unsigned char material_id;
+};
+
+
+
+
+
+/**
+ * Structure to be passed to the #Triangulation<dim>::create_triangulation#
+ * function to describe boundary information.
+ *
+ * This structure is the same for all dimensions, since we use an input
+ * function which is the same for all dimensions. The content of objects
+ * of this structure varies with the dimensions, however.
+ *
+ * Since in one space dimension, there is no boundary information apart
+ * from the two end points of the interval, this structure does not contain
+ * anything and exists only for consistency, to allow a common interface
+ * for all space dimensions. All fields should always be empty.
+ *
+ * Boundary data in 2D consists
+ * of a list of lines which belong to a given boundary component. A
+ * boundary component is a list of lines which are given a common
+ * number describing the boundary condition to hold on this part of the
+ * boundary. The triangulation creation function gives lines not in this
+ * list either the boundary indicator zero (if on the boundary) or 255
+ * (if in the interior). Explicitely giving a line the indicator 255
+ * will result in an error, as well as giving an interior line a boundary
+ * indicator.
+ */
+struct SubCellData {
+ /**
+ * Each record of this vector describes
+ * a line on the boundary and its boundary
+ * indicator.
+ */
+ vector<CellData<1> > boundary_lines;
+
+ /**
+ * Each record of this vector describes
+ * a quad on the boundary and its boundary
+ * indicator.
+ */
+ vector<CellData<2> > boundary_quads;
+
+ /**
+ * This function checks whether the vectors
+ * which may not be used in a given
+ * dimension are really empty. I.e.,
+ * whether the #boundary_*# arrays are
+ * empty when in one space dimension
+ * and whether the #boundary_quads#
+ * array is empty when in two dimensions.
+ *
+ * Since this structure is the same for all
+ * dimensions, the actual dimension has
+ * to be given as a parameter.
+ */
+ bool check_consistency (const unsigned int dim) const;
+};
+
+
+
+
/*------------------------------------------------------------------------*/
-
-/**
- * Structure which is passed to the #Triangulation<dim>::create_triangulation#
- * function. It contains all data needed to construct a cell, namely the
- * indices of the vertices and the material indicator.
- */
-template <int dim>
-struct CellData {
- int vertices[GeometryInfo<dim>::vertices_per_cell];
- unsigned char material_id;
-};
-
-
-
-
-
-/**
- * Structure to be passed to the #Triangulation<dim>::create_triangulation#
- * function to describe boundary information.
- *
- * This structure is the same for all dimensions, since we use an input
- * function which is the same for all dimensions. The content of objects
- * of this structure varies with the dimensions, however.
- *
- * Since in one space dimension, there is no boundary information apart
- * from the two end points of the interval, this structure does not contain
- * anything and exists only for consistency, to allow a common interface
- * for all space dimensions. All fields should always be empty.
- *
- * Boundary data in 2D consists
- * of a list of lines which belong to a given boundary component. A
- * boundary component is a list of lines which are given a common
- * number describing the boundary condition to hold on this part of the
- * boundary. The triangulation creation function gives lines not in this
- * list either the boundary indicator zero (if on the boundary) or 255
- * (if in the interior). Explicitely giving a line the indicator 255
- * will result in an error, as well as giving an interior line a boundary
- * indicator.
- */
-struct SubCellData {
- /**
- * Each record of this vector describes
- * a line on the boundary and its boundary
- * indicator.
- */
- vector<CellData<1> > boundary_lines;
-
- /**
- * Each record of this vector describes
- * a quad on the boundary and its boundary
- * indicator.
- */
- vector<CellData<2> > boundary_quads;
-
- /**
- * This function checks whether the vectors
- * which may not be used in a given
- * dimension are really empty. I.e.,
- * whether the #boundary_*# arrays are
- * empty when in one space dimension
- * and whether the #boundary_quads#
- * array is empty when in two dimensions.
- *
- * Since this structure is the same for all
- * dimensions, the actual dimension has
- * to be given as a parameter.
- */
- bool check_consistency (const unsigned int dim) const;
-};
-
-
-
-
-
/**
* This class implements an input mechanism for grid data. It allows to
* read a grid structure into a triangulation object. Future versions
+
template <>
MGDoFHandler<1>::raw_cell_iterator
MGDoFHandler<1>::last_raw () const {
#endif
+
#if deal_II_dimension == 2
template <>
+
template <int dim>
typename MGDoFHandler<dim>::raw_line_iterator
MGDoFHandler<dim>::begin_raw_line (const unsigned int level) const {
+
template <int dim>
typename MGDoFDimensionInfo<dim>::active_quad_iterator
MGDoFHandler<dim>::end_active_quad (const unsigned int level) const {
+
template <int dim>
void MGDoFHandler<dim>::distribute_dofs (const FiniteElementBase<dim> &fe) {
// first distribute global dofs
+
#if deal_II_dimension == 1
template <>
#endif
+
+
#if deal_II_dimension == 2
template <>
#endif
+
#if deal_II_dimension == 2
template <>
// this calls the destructor which
// must free the space
mg_vertex_dofs.resize (0);
-
-
+
+
////////////////////////////
// CONSTRUCTION
-1);
};
+
// now allocate space for the
// vertices. To this end, we need
// to construct as many objects as
// vertex we pass by belongs to
mg_vertex_dofs.resize (tria->vertices.size());
- vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
- vector<unsigned int> max_level (tria->vertices.size(), 0);
+ // here again, gcc2.8 fails to
+ // construct the vector properly
+ // using parameters to the constructor
+// vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
+// vector<unsigned int> max_level (tria->vertices.size(), 0);
+ vector<unsigned int> min_level, max_level;
+ min_level.resize (tria->vertices.size(), tria->n_levels());
+ max_level.resize (tria->vertices.size(), 0);
Triangulation<dim>::cell_iterator cell = tria->begin(),
endc = tria->end();
max_level[vertex_index] = cell->level();
};
+
// now allocate the needed space
for (unsigned int vertex=0; vertex<tria->vertices.size(); ++vertex)
{
#include <cmath>
+
+bool SubCellData::check_consistency (const unsigned int dim) const {
+ switch (dim)
+ {
+ case 1:
+ return ((boundary_lines.size() == 0) &&
+ (boundary_quads.size() == 0));
+ case 2:
+ return (boundary_quads.size() == 0);
+ };
+ return true;
+};
+
+
+
+
+
+
+
template <int dim>
Triangulation<dim>::Triangulation (const MeshSmoothing smooth_grid) :
smooth_grid(smooth_grid)
+
template <>
MGDoFHandler<1>::raw_cell_iterator
MGDoFHandler<1>::last_raw () const {
#endif
+
#if deal_II_dimension == 2
template <>
+
template <int dim>
typename MGDoFHandler<dim>::raw_line_iterator
MGDoFHandler<dim>::begin_raw_line (const unsigned int level) const {
+
template <int dim>
typename MGDoFDimensionInfo<dim>::active_quad_iterator
MGDoFHandler<dim>::end_active_quad (const unsigned int level) const {
+
template <int dim>
void MGDoFHandler<dim>::distribute_dofs (const FiniteElementBase<dim> &fe) {
// first distribute global dofs
+
#if deal_II_dimension == 1
template <>
#endif
+
+
#if deal_II_dimension == 2
template <>
#endif
+
#if deal_II_dimension == 2
template <>
// this calls the destructor which
// must free the space
mg_vertex_dofs.resize (0);
-
-
+
+
////////////////////////////
// CONSTRUCTION
-1);
};
+
// now allocate space for the
// vertices. To this end, we need
// to construct as many objects as
// vertex we pass by belongs to
mg_vertex_dofs.resize (tria->vertices.size());
- vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
- vector<unsigned int> max_level (tria->vertices.size(), 0);
+ // here again, gcc2.8 fails to
+ // construct the vector properly
+ // using parameters to the constructor
+// vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
+// vector<unsigned int> max_level (tria->vertices.size(), 0);
+ vector<unsigned int> min_level, max_level;
+ min_level.resize (tria->vertices.size(), tria->n_levels());
+ max_level.resize (tria->vertices.size(), 0);
Triangulation<dim>::cell_iterator cell = tria->begin(),
endc = tria->end();
max_level[vertex_index] = cell->level();
};
+
// now allocate the needed space
for (unsigned int vertex=0; vertex<tria->vertices.size(); ++vertex)
{
-bool SubCellData::check_consistency (const unsigned int dim) const {
- switch (dim)
- {
- case 1:
- return ((boundary_lines.size() == 0) &&
- (boundary_quads.size() == 0));
- case 2:
- return (boundary_quads.size() == 0);
- };
- return true;
-};
-
-
-
-
template <int dim>
DataIn<dim>::DataIn () :