* an additional
* @p{ConstraintMatrix} argument,
* see below.
+ *
+ * Since this function operates
+ * on patches of cells, it is
+ * required that the underlying
+ * grid is refined at least once
+ * for every coarse grid cell. If
+ * this is not the case, an
+ * exception will be raised.
*/
template <int dim, class InVector, class OutVector>
- static void extrapolate(const DoFHandler<dim>& dof1,
- const InVector& z1,
- const DoFHandler<dim>& dof2,
- OutVector& z2);
+ static void extrapolate (const DoFHandler<dim>& dof1,
+ const InVector& z1,
+ const DoFHandler<dim>& dof2,
+ OutVector& z2);
/**
* Gives the patchwise
* elements on grids with hanging
* nodes (locally refined grids).
*
- * This function is interesting
- * for e.g. extrapolating
- * patchwise a piecewise linear
- * solution to a piecewise
- * quadratic solution.
+ * Otherwise, the same holds as
+ * for the other @p{extrapolate}
+ * function.
*/
template <int dim, class InVector, class OutVector>
- static void extrapolate(const DoFHandler<dim>& dof1,
- const InVector& z1,
- const DoFHandler<dim>& dof2,
- const ConstraintMatrix& constraints,
- OutVector& z2);
+ static void extrapolate (const DoFHandler<dim>& dof1,
+ const InVector& z1,
+ const DoFHandler<dim>& dof2,
+ const ConstraintMatrix& constraints,
+ OutVector& z2);
/**
* The numbering of the degrees
* Exception
*/
DeclException0 (ExcFEMustBePrimitive);
-
/**
* Exception
*/
<< "hanging nodes but without providing hanging node "
<< "constraints. Use the respective function with "
<< "additional ConstraintMatrix argument(s), instead.");
-
+ /**
+ * Exception
+ */
+ DeclException0 (ExcGridNotRefinedAtLeastOnce);
/**
* Exception
*/
template <int dim, typename number>
-void FETools::get_interpolation_difference_matrix(const FiniteElement<dim> &fe1,
- const FiniteElement<dim> &fe2,
- FullMatrix<number> &difference_matrix)
+void FETools::get_interpolation_difference_matrix (const FiniteElement<dim> &fe1,
+ const FiniteElement<dim> &fe2,
+ FullMatrix<number> &difference_matrix)
{
Assert (fe1.n_components() == fe2.n_components(),
ExcDimensionMismatch(fe1.n_components(), fe2.n_components()));
template <int dim, class InVector, class OutVector>
-void FETools::interpolation_difference(const DoFHandler<dim> &dof1,
- const InVector &u1,
- const FiniteElement<dim> &fe2,
- OutVector &u1_difference)
+void FETools::interpolation_difference (const DoFHandler<dim> &dof1,
+ const InVector &u1,
+ const FiniteElement<dim> &fe2,
+ OutVector &u1_difference)
{
Assert(dof1.get_fe().n_components() == fe2.n_components(),
ExcDimensionMismatch(dof1.get_fe().n_components(), fe2.n_components()));
const unsigned int dofs_per_cell = dof2.get_fe().dofs_per_cell;
const Triangulation<dim> &tria=dof1.get_tria();
Vector<typename OutVector::value_type> dof_values(dofs_per_cell);
-
+
+ // make sure that each cell on the
+ // coarsest level is at least once
+ // refined. otherwise, we can't
+ // treat these cells and would
+ // generate a bogus result
+ {
+ typename DoFHandler<dim>::cell_iterator cell = dof2.begin(0),
+ endc = dof2.end(0);
+ for (; cell!=endc; ++cell)
+ Assert (cell->has_children(), ExcGridNotRefinedAtLeastOnce());
+ }
+
+ // then traverse grid bottom up
for (unsigned int level=0; level<tria.n_levels()-1; ++level)
{
typename DoFHandler<dim>::cell_iterator cell=dof2.begin(level),
<p>
This is the list of changes made after the release of
-<acronym>deal.II</acronym> version ??.??. It is subdivided into changes
+<acronym>deal.II</acronym> version 4.0. It is subdivided into changes
made to the three sub-libraries <a href="#base">base</a>,
<a href="#lac">lac</a>, and <a href="#deal.II">deal.II</a>, as well as
changes to the <a href="#general">general infrastructure,
<h3>deal.II</h3>
<ol>
+ <li> <p>
+ Fixed: The <code class="member">FETools::extrapolate</code>
+ function operates on patches of cells, but didn't check whether
+ the grid is at least refined once everywhere. If this was not
+ the case, it would generate wrong results. It now checks for
+ this, and if the grid has unrefined coarse grid cells, an
+ exception is generated.
+ <br>
+ (WB 2002/06/25)
+ </p>
+
<li> <p>
- Improved: <code class="class">FEFaceValuesBase</code> has a new
- function <code class="member">orientation</code> accessing a unique
- and consistent orientation for each face.
- <br>
- (GK 2003/06/23)
+ Improved: <code class="class">FEFaceValuesBase</code> has a new
+ function <code class="member">orientation</code> accessing a unique
+ and consistent orientation for each face.
+ <br>
+ (GK 2003/06/23)
<li> <p>
Changed: Embedding and restriction matrices for intergrid transfer are