Cycle cycle = v_cycle);
/**
- * Experimental constructor for cases in which no DoFHandler is available.
- *
- * @warning Not intended for general use.
+ * Constructor. Same as above but you can determine the multigrid
+ * levels to use yourself.
*/
Multigrid(const unsigned int minlevel,
const unsigned int maxlevel,
/**
* Set the highest level for which the multilevel method is performed. By
- * default, this is the finest level of the Triangulation; therefore, this
- * function will only accept arguments smaller than the current #maxlevel
- * and not smaller than the current #minlevel.
+ * default, this is the finest level of the Triangulation. Accepted are
+ * values not smaller than the current #minlevel.
*/
void set_maxlevel (const unsigned int);
Multigrid<VectorType>::reinit (const unsigned int min_level,
const unsigned int max_level)
{
+ Assert (min_level <= max_level,
+ ExcLowerRangeType<unsigned int>(max_level, min_level));
minlevel=min_level;
maxlevel=max_level;
+ // solution, t and defect2 are resized in cycle()
defect.resize(minlevel, maxlevel);
}
void
Multigrid<VectorType>::set_maxlevel (const unsigned int l)
{
- Assert (l <= maxlevel, ExcIndexRange(l,minlevel,maxlevel+1));
- Assert (l >= minlevel, ExcIndexRange(l,minlevel,maxlevel+1));
- maxlevel = l;
+ reinit(minlevel, l);
}
Multigrid<VectorType>::set_minlevel (const unsigned int l,
const bool relative)
{
- Assert (l <= maxlevel, ExcIndexRange(l,minlevel,maxlevel+1));
- minlevel = (relative)
- ? (maxlevel-l)
- : l;
+ const unsigned int new_minlevel = (relative)
+ ? (maxlevel-l)
+ : l;
+ reinit(new_minlevel, maxlevel);
}