* your hanging node constraints
* object.
*/
- template <int dim, typename number>
- static void interpolate (const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
- const DoFHandler<dim> &dof2,
- Vector<number> &u2);
+ template <int dim, class InVector, class OutVector>
+ static void interpolate (const DoFHandler<dim>& dof1,
+ const InVector& u1,
+ const DoFHandler<dim>& dof2,
+ OutVector& u2);
/**
* Gives the interpolation of a
* at the DoF values on the
* discontinuities.
*/
- template <int dim, typename number>
- static void interpolate (const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
- const DoFHandler<dim> &dof2,
- const ConstraintMatrix &constraints,
- Vector<number> &u2);
+ template <int dim, class InVector, class OutVector>
+ static void interpolate (const DoFHandler<dim>& dof1,
+ const InVector& u1,
+ const DoFHandler<dim>& dof2,
+ const ConstraintMatrix& constraints,
+ OutVector& u2);
/**
* function is simply an identity
* mapping.
*/
- template <int dim, typename number>
- static void back_interpolate (const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
- const FiniteElement<dim> &fe2,
- Vector<number> &u1_interpolated);
+ template <int dim, class InVector, class OutVector>
+ static void back_interpolate (const DoFHandler<dim>& dof1,
+ const InVector& u1,
+ const FiniteElement<dim>& fe2,
+ OutVector& u1_interpolated);
/**
* Gives the interpolation of the
* function is simply an identity
* mapping.
*/
- template <int dim, typename number>
- static void back_interpolate (const DoFHandler<dim> &dof1,
- const ConstraintMatrix &constraints1,
- const Vector<number> &u1,
- const DoFHandler<dim> &dof2,
- const ConstraintMatrix &constraints2,
- Vector<number> &u1_interpolated);
+ template <int dim, class InVector, class OutVector>
+ static void back_interpolate (const DoFHandler<dim>& dof1,
+ const ConstraintMatrix& constraints1,
+ const InVector& u1,
+ const DoFHandler<dim>& dof2,
+ const ConstraintMatrix& constraints2,
+ OutVector& u1_interpolated);
/**
* Gives $(Id-I_h)z1$ for a given
* additional
* @p{ConstraintMatrix} object.
*/
- template <int dim, typename number>
+ template <int dim, class InVector, class OutVector>
static void interpolation_difference(const DoFHandler<dim> &dof1,
- const Vector<number> &z1,
+ const InVector &z1,
const FiniteElement<dim> &fe2,
- Vector<number> &z1_difference);
+ OutVector &z1_difference);
/**
* Gives $(Id-I_h)z1$ for a given
* nodes (locally refined grids)
* are involved.
*/
- template <int dim, typename number>
- static void interpolation_difference(const DoFHandler<dim> &dof1,
- const ConstraintMatrix &constraints1,
- const Vector<number> &z1,
- const DoFHandler<dim> &dof2,
- const ConstraintMatrix &constraints2,
- Vector<number> &z1_difference);
+ template <int dim, class InVector, class OutVector>
+ static void interpolation_difference(const DoFHandler<dim>& dof1,
+ const ConstraintMatrix& constraints1,
+ const InVector& z1,
+ const DoFHandler<dim>& dof2,
+ const ConstraintMatrix& constraints2,
+ OutVector& z1_difference);
/**
* Gives the patchwise
* @p{ConstraintMatrix} argument,
* see below.
*/
- template <int dim, typename number>
- static void extrapolate(const DoFHandler<dim> &dof1,
- const Vector<number> &z1,
- const DoFHandler<dim> &dof2,
- Vector<number> &z2);
+ template <int dim, class InVector, class OutVector>
+ static void extrapolate(const DoFHandler<dim>& dof1,
+ const InVector& z1,
+ const DoFHandler<dim>& dof2,
+ OutVector& z2);
/**
* Gives the patchwise
* solution to a piecewise
* quadratic solution.
*/
- template <int dim, typename number>
- static void extrapolate(const DoFHandler<dim> &dof1,
- const Vector<number> &z1,
- const DoFHandler<dim> &dof2,
- const ConstraintMatrix &constraints,
- Vector<number> &z2);
+ 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);
/**
* The numbering of the degrees
#include <base/quadrature.h>
#include <lac/full_matrix.h>
#include <lac/vector.h>
+#include <lac/block_vector.h>
#include <grid/tria.h>
#include <grid/tria_iterator.h>
#include <fe/fe_tools.h>
}
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::interpolate(const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
+ const InVector &u1,
const DoFHandler<dim> &dof2,
- Vector<number> &u2)
+ OutVector &u2)
{
ConstraintMatrix dummy;
dummy.close();
}
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::interpolate(const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
+ const InVector &u1,
const DoFHandler<dim> &dof2,
const ConstraintMatrix &constraints,
- Vector<number> &u2)
+ OutVector &u2)
{
Assert(&dof1.get_tria()==&dof2.get_tria(), ExcTriangulationMismatch());
Assert(dof1.get_fe().n_components() == dof2.get_fe().n_components(),
const unsigned int dofs_per_cell1=dof1.get_fe().dofs_per_cell;
const unsigned int dofs_per_cell2=dof2.get_fe().dofs_per_cell;
- Vector<number> u1_local(dofs_per_cell1);
- Vector<number> u2_local(dofs_per_cell2);
+ Vector<double> u1_local(dofs_per_cell1);
+ Vector<double> u2_local(dofs_per_cell2);
- FullMatrix<number> interpolation_matrix(dofs_per_cell2,
+ FullMatrix<double> interpolation_matrix(dofs_per_cell2,
dofs_per_cell1);
FETools::get_interpolation_matrix(dof1.get_fe(), dof2.get_fe(),
interpolation_matrix);
}
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::back_interpolate(const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
+ const InVector &u1,
const FiniteElement<dim> &fe2,
- Vector<number> &u1_interpolated)
+ OutVector &u1_interpolated)
{
Assert(dof1.get_fe().n_components() == fe2.n_components(),
ExcDimensionMismatch(dof1.get_fe().n_components(), fe2.n_components()));
const unsigned int dofs_per_cell1=dof1.get_fe().dofs_per_cell;
- Vector<number> u1_local(dofs_per_cell1);
- Vector<number> u1_int_local(dofs_per_cell1);
+ Vector<double> u1_local(dofs_per_cell1);
+ Vector<double> u1_int_local(dofs_per_cell1);
typename DoFHandler<dim>::active_cell_iterator cell = dof1.begin_active(),
endc = dof1.end();
- FullMatrix<number> interpolation_matrix(dofs_per_cell1, dofs_per_cell1);
+ FullMatrix<double> interpolation_matrix(dofs_per_cell1, dofs_per_cell1);
FETools::get_back_interpolation_matrix(dof1.get_fe(), fe2,
interpolation_matrix);
for (; cell!=endc; ++cell)
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::back_interpolate(const DoFHandler<dim> &dof1,
const ConstraintMatrix &constraints1,
- const Vector<number> &u1,
+ const InVector &u1,
const DoFHandler<dim> &dof2,
const ConstraintMatrix &constraints2,
- Vector<number> &u1_interpolated)
+ OutVector &u1_interpolated)
{
// For discontinuous elements
// without constraints take the
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::interpolation_difference(const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
+ const InVector &u1,
const FiniteElement<dim> &fe2,
- Vector<number> &u1_difference)
+ 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=dof1.get_fe().dofs_per_cell;
- Vector<number> u1_local(dofs_per_cell);
- Vector<number> u1_diff_local(dofs_per_cell);
+ Vector<double> u1_local(dofs_per_cell);
+ Vector<double> u1_diff_local(dofs_per_cell);
- FullMatrix<number> difference_matrix(dofs_per_cell, dofs_per_cell);
+ FullMatrix<double> difference_matrix(dofs_per_cell, dofs_per_cell);
FETools::get_interpolation_difference_matrix(dof1.get_fe(), fe2,
difference_matrix);
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::interpolation_difference(const DoFHandler<dim> &dof1,
const ConstraintMatrix &constraints1,
- const Vector<number> &u1,
+ const InVector &u1,
const DoFHandler<dim> &dof2,
const ConstraintMatrix &constraints2,
- Vector<number> &u1_difference)
+ OutVector &u1_difference)
{
// For discontinuous elements
// without constraints take the
}
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::extrapolate(const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
+ const InVector &u1,
const DoFHandler<dim> &dof2,
- Vector<number> &u2)
+ OutVector &u2)
{
ConstraintMatrix dummy;
dummy.close();
-template <int dim, typename number>
+template <int dim, class InVector, class OutVector>
void FETools::extrapolate(const DoFHandler<dim> &dof1,
- const Vector<number> &u1,
+ const InVector &u1,
const DoFHandler<dim> &dof2,
const ConstraintMatrix &constraints,
- Vector<number> &u2)
+ OutVector &u2)
{
Assert(dof1.get_fe().n_components() == dof2.get_fe().n_components(),
ExcDimensionMismatch(dof1.get_fe().n_components(), dof2.get_fe().n_components()));
Assert(u1.size()==dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs()));
Assert(u2.size()==dof2.n_dofs(), ExcDimensionMismatch(u2.size(), dof2.n_dofs()));
- Vector<number> u3(dof2.n_dofs());
+ OutVector u3;
+ u3.reinit(u2);
interpolate(dof1, u1, dof2, constraints, u3);
const unsigned int dofs_per_cell = dof2.get_fe().dofs_per_cell;
const Triangulation<dim> &tria=dof1.get_tria();
- Vector<number> dof_values(dofs_per_cell);
+ Vector<double> dof_values(dofs_per_cell);
for (unsigned int level=0; level<tria.n_levels()-1; ++level)
{
/*-------------- Explicit Instantiations -------------------------------*/
+//TODO:[RH] Why do the instantiations for float and double differ?
+
template
void FETools::get_interpolation_matrix<deal_II_dimension>
(const FiniteElement<deal_II_dimension> &,
(const FiniteElement<deal_II_dimension> &,
const FiniteElement<deal_II_dimension> &,
FullMatrix<double> &);
+template
+void FETools::get_interpolation_matrix<deal_II_dimension>
+(const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<float> &);
+template
+void FETools::get_back_interpolation_matrix<deal_II_dimension>
+(const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<float> &);
+template
+void FETools::get_interpolation_difference_matrix<deal_II_dimension>
+(const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<float> &);
+
+
template
void FETools::interpolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<double> &,
- const DoFHandler<deal_II_dimension> &,
- Vector<double> &);
+(const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, Vector<double> &);
template
void FETools::interpolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<double> &,
- const DoFHandler<deal_II_dimension> &,
- const ConstraintMatrix &,
+(const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
Vector<double> &);
template
void FETools::back_interpolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<double> &,
- const FiniteElement<deal_II_dimension> &,
- Vector<double> &);
+(const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const FiniteElement<deal_II_dimension> &, Vector<double> &);
template
void FETools::back_interpolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const ConstraintMatrix &,
+(const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
const Vector<double> &,
- const DoFHandler<deal_II_dimension> &,
- const ConstraintMatrix &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
Vector<double> &);
template
void FETools::interpolation_difference<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<double> &,
- const FiniteElement<deal_II_dimension> &,
- Vector<double> &);
+(const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const FiniteElement<deal_II_dimension> &, Vector<double> &);
template
void FETools::interpolation_difference<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const ConstraintMatrix &,
+(const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
const Vector<double> &,
- const DoFHandler<deal_II_dimension> &,
- const ConstraintMatrix &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
Vector<double> &);
template
void FETools::extrapolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<double> &,
- const DoFHandler<deal_II_dimension> &,
- Vector<double> &);
+(const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, Vector<double> &);
template
-void FETools::get_interpolation_matrix<deal_II_dimension>
-(const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<float> &);
+void FETools::interpolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, Vector<float> &);
template
-void FETools::get_back_interpolation_matrix<deal_II_dimension>
-(const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<float> &);
+void FETools::back_interpolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const FiniteElement<deal_II_dimension> &, Vector<float> &);
template
-void FETools::get_interpolation_difference_matrix<deal_II_dimension>
-(const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<float> &);
+void FETools::interpolation_difference<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const FiniteElement<deal_II_dimension> &, Vector<float> &);
+template
+void FETools::extrapolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, Vector<float> &);
+
+
+template
+void FETools::interpolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
template
void FETools::interpolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<float> &,
- const DoFHandler<deal_II_dimension> &,
- Vector<float> &);
+(const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
template
void FETools::back_interpolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<float> &,
- const FiniteElement<deal_II_dimension> &,
- Vector<float> &);
+(const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
+template
+void FETools::back_interpolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
template
void FETools::interpolation_difference<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<float> &,
- const FiniteElement<deal_II_dimension> &,
- Vector<float> &);
+(const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
+template
+void FETools::interpolation_difference<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
template
void FETools::extrapolate<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Vector<float> &,
- const DoFHandler<deal_II_dimension> &,
- Vector<float> &);
+(const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+
+
+template
+void FETools::interpolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+template
+void FETools::back_interpolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
+template
+void FETools::interpolation_difference<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
+template
+void FETools::extrapolate<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+
+
template
void
FETools::hierarchic_to_lexicographic_numbering<deal_II_dimension>