/**
* Create a coordinate-parallel
- * parallelepiped from the two
+ * brick from the two
* diagonally opposite corner
* points @p p1 and @p p2.
*
* for the surfaces in
* @p y-direction are 2 and 3,
* the ones for @p z are 4 and
- * 5.
+ * 5. Additionally, material ids
+ * are assigned to the cells
+ * according to the octant their
+ * center is in: being in the right half
+ * plane for any coordinate
+ * direction <i>x<sub>i</sub></i>
+ * adds 2<sup>i</sup>. For
+ * instance, the center point
+ * (1,-1,1) yields a material id 5.
*
- * The triangulation needs to be
+ * @note The triangulation needs to be
* void upon calling this
* function.
*/
* for the surfaces in
* @p y-direction are 2 and 3,
* the ones for @p z are 4 and
- * 5.
+ * 5. Additionally, material ids
+ * are assigned to the cells
+ * according to the octant their
+ * center is in: being in the right half
+ * plane for any coordinate
+ * direction <i>x<sub>i</sub></i>
+ * adds 2<sup>i</sup>. For
+ * instance, the center point
+ * (1,-1,1) yields a material id 5.
*
* @note The triangulation needs to be
* void upon calling this
void
GridGenerator::colorize_hyper_rectangle (Triangulation<dim> &)
{
- // nothing to do in 1d
+ // Nothing to do in 1D
}
template <int dim>
void
-GridGenerator::
-subdivided_hyper_rectangle (Triangulation<dim> &tria,
- const std::vector<unsigned int> &repetitions,
- const Point<dim> &p_1,
- const Point<dim> &p_2,
- const bool colorize)
+GridGenerator::subdivided_hyper_rectangle (
+ Triangulation<dim> &tria,
+ const std::vector<unsigned int> &repetitions,
+ const Point<dim> &p_1,
+ const Point<dim> &p_2,
+ const bool colorize)
{
// contributed by Joerg R. Weimar
// (j.weimar@jweimar.de) 2003
// Implementation for 1D only
template <int dim>
void
-GridGenerator::colorize_subdivided_hyper_rectangle (Triangulation<dim> &,
- const Point<dim> &,
- const Point<dim> &,
- const double )
+GridGenerator::colorize_subdivided_hyper_rectangle (
+ Triangulation<dim>& tria,
+ const Point<dim>&,
+ const Point<dim>&,
+ const double)
{
- // nothing to do in 1d
+ for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
+ cell != tria.end(); ++cell)
+ if (cell->center()(0) > 0)
+ cell->set_material_id(1);
// boundary indicators are set to
// 0 (left) and 1 (right) by default.
}
}
}
+ for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
+ cell != tria.end(); ++cell)
+ {
+ char id = 0;
+ for (unsigned int d=0;d<dim;++d)
+ if (cell->center()(d) > 0) id += 1 << d;
+ cell->set_material_id(id);
+ }
}
#endif
<ol>
+<li> Improved: All GrowingVectorMemory objects of one type will access
+the same memory pool. Therefore, it is now not a crime to just create
+one and discard later. Furthermore, logging of statistics has been
+switched off by default, such that linear solvers remain silent.
+<br>
+(GK 2007/12/16)
+</li>
+
<li> Fixed: Vector::operator/= can't work when the scaling factor is zero,
but it happened to check whether the factor was positive. That's of course
bogus, the check should have been whether it is non-zero. This has now been
<ol>
+ <li> <p>Improved: GridGenerator::subdivided_hyper_rectangle now also colorizes
+ cells according to the octant they are in.
+ <br>
+ (GK 2007/12/20)
+ </p></li>
+
+
<li> <p>New: The DataOut, DataOutRotation, DataOutStack, and DataOutFaces
can now deal with vector-valued data if the functions in DataOutBase
that write in a particular graphical output format can deal with it.
they were all output as logically independent scalar components;
most visualization programs then allowed to display vector fields
by composing them of individual scalar fields for each vector component.
- <p>
+ </p><p>
With the new scheme, the DataOut_DoFData::add_data_vector() functions
inherited by the classes listed above take an additional parameter
that may be used to indicate that certain components of the data