const vector<vector<Point<dim> > > &shape_grads_transform,
const Boundary<dim> &boundary) const;
+ /**
+ * Return the ansatz points of the
+ * ansatz functions on the unit cell.
+ *
+ * The function assumes that the
+ * #unit_points# array already has the
+ * right size. The order of points in
+ * the array matches that returned by
+ * the #cell->get_dof_indices# function.
+ *
+ * For one space dimension there is a
+ * standard implementation assuming
+ * equidistant off-points on the unit
+ * line. For all other dimensions, an
+ * overwritten function has to be provided.
+ */
+ virtual void get_unit_ansatz_points (vector<Point<dim> > &unit_points) const;
+
/**
* Compute the off-points of the finite
* element basis functions on the given
* #ansatz_points# array already has the
* right size. The order of points in
* the array matches that returned by
- * the #face->get_dof_indices# function.
+ * the #cell->get_dof_indices# function.
*
* For one space dimension there is a
* standard implementation assuming
virtual Point<dim> shape_grad(const unsigned int i,
const Point<dim>& p) const;
+ /**
+ * Refer to the base class for detailed
+ * information on this function.
+ */
+ virtual void get_unit_ansatz_points (vector<Point<dim> > &ansatz_points) const;
+
/**
* Refer to the base class for detailed
* information on this function.
virtual Point<dim> shape_grad(const unsigned int i,
const Point<dim>& p) const;
+ /**
+ * Refer to the base class for detailed
+ * information on this function.
+ */
+ virtual void get_unit_ansatz_points (vector<Point<dim> > &ansatz_points) const;
+
/**
* Refer to the base class for detailed
* information on this function.
virtual Point<dim> shape_grad(const unsigned int i,
const Point<dim>& p) const;
+ /**
+ * Refer to the base class for detailed
+ * information on this function.
+ */
+ virtual void get_unit_ansatz_points (vector<Point<dim> > &ansatz_points) const;
+
/**
* Refer to the base class for detailed
* information on this function.
virtual Point<dim> shape_grad(const unsigned int i,
const Point<dim>& p) const;
+ /**
+ * Refer to the base class for detailed
+ * information on this function.
+ */
+ virtual void get_unit_ansatz_points (vector<Point<dim> > &ansatz_points) const;
+
/**
* Refer to the base class for detailed
* information on this function.
+template <>
+void FiniteElement<1>::get_unit_ansatz_points (vector<Point<1> > &unit_points) const {
+ Assert (unit_points.size() == total_dofs,
+ ExcWrongFieldDimension(unit_points.size(), total_dofs));
+ // compute ansatz points. The first ones
+ // belong to vertex one, the second ones
+ // to vertex two, all following are
+ // equally spaced along the line
+ unsigned int next = 0;
+ // first the dofs in the vertices
+ for (unsigned int i=0; i<dofs_per_vertex; ++i)
+ ansatz_points[next++] = Point<1>(0);
+ for (unsigned int i=0; i<dofs_per_vertex; ++i)
+ ansatz_points[next++] = Point<1>(1);
+
+ // now dofs on line
+ for (unsigned int i=0; i<dofs_per_line; ++i)
+ ansatz_points[next++] = Point<1>((i+1.0)/(dofs_per_line+1.0));
+};
+
+
+
template <>
void FiniteElement<1>::get_ansatz_points (const DoFHandler<1>::cell_iterator &cell,
const Boundary<1> &,
// now dofs on line
for (unsigned int i=0; i<dofs_per_line; ++i)
ansatz_points[next++] = cell->vertex(0) +
- Point<1>((i+1.0)/(total_dofs+1.0)*h);
+ Point<1>((i+1.0)/(dofs_per_line+1.0)*h);
};
#endif
Assert (ansatz_points.size() == dofs_per_face,
ExcWrongFieldDimension(ansatz_points.size(), dofs_per_face));
- static vector<Point<dim> > dummy(total_dofs);
+ vector<Point<dim> > dummy(total_dofs);
fill_fe_values (cell, global_unit_points,
jacobians, compute_jacobians,
dummy, false,
+template <int dim>
+void FiniteElement<dim>::get_unit_ansatz_points (vector<Point<dim> > &) const {
+ Assert (false, ExcPureFunctionCalled());
+};
+
+
+
template <int dim>
void FiniteElement<dim>::get_ansatz_points (const DoFHandler<dim>::cell_iterator &,
const Boundary<dim> &,
+template <>
+void FECubicSub<1>::get_unit_ansatz_points (vector<Point<1> > &unit_points) const {
+ FiniteElement<1>::get_unit_ansatz_points (unit_points);
+};
+
+
+
template <>
void FECubicSub<1>::get_ansatz_points (const typename DoFHandler<1>::cell_iterator &cell,
const Boundary<1> &boundary,
+template <>
+void FECubicSub<2>::get_unit_ansatz_points (vector<Point<2> > &unit_points) const {
+ Assert (unit_points.size() == total_dofs,
+ ExcWrongFieldDimension (unit_points.size(), total_dofs));
+
+ unit_points[0] = Point<2>(0,0);
+ unit_points[1] = Point<2>(1,0);
+ unit_points[2] = Point<2>(1,1);
+ unit_points[3] = Point<2>(0,1);
+ unit_points[4] = Point<2>(1./3,0);
+ unit_points[5] = Point<2>(2./3,0);
+ unit_points[6] = Point<2>(1,1./3);
+ unit_points[7] = Point<2>(1,2./3);
+ unit_points[8] = Point<2>(1./3,1);
+ unit_points[9] = Point<2>(2./3,1);
+ unit_points[10]= Point<2>(0,1./3);
+ unit_points[11]= Point<2>(0,2./3);
+ unit_points[12]= Point<2>(1./3,1./3);
+ unit_points[13]= Point<2>(2./3,1./3);
+ unit_points[14]= Point<2>(2./3,2./3);
+ unit_points[15]= Point<2>(1./3,2./3);
+};
+
+
+
template <>
void FECubicSub<2>::get_ansatz_points (const typename DoFHandler<2>::cell_iterator &cell,
const Boundary<2>&,
+template <>
+void FELinear<1>::get_unit_ansatz_points (vector<Point<1> > &ansatz_points) const {
+ FiniteElement<1>::get_unit_ansatz_points (ansatz_points);
+};
+
+
+
template <>
void FELinear<1>::get_ansatz_points (const typename DoFHandler<1>::cell_iterator &cell,
const Boundary<1> &boundary,
+template <>
+void FELinear<2>::get_unit_ansatz_points (vector<Point<2> > &unit_points) const {
+ Assert (unit_points.size() == total_dofs,
+ ExcWrongFieldDimension (unit_points.size(), total_dofs));
+
+ unit_points[0] = Point<2> (0,0);
+ unit_points[1] = Point<2> (1,0);
+ unit_points[2] = Point<2> (1,1);
+ unit_points[3] = Point<2> (0,1);
+};
+
+
#endif
const Boundary<dim> &,
vector<Point<dim> > &ansatz_points) const {
Assert (ansatz_points.size() == total_dofs,
- ExcWrongFieldDimension (ansatz_points.size(), 1<<(dim-1)));
+ ExcWrongFieldDimension (ansatz_points.size(), total_dofs));
for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
ansatz_points[vertex] = cell->vertex(vertex);
+template <>
+void FEQuadraticSub<1>::get_unit_ansatz_points (vector<Point<1> > &unit_points) const {
+ FiniteElement<1>::get_unit_ansatz_points (unit_points);
+};
+
+
+
template <>
void FEQuadraticSub<1>::get_ansatz_points (const typename DoFHandler<1>::cell_iterator &cell,
const Boundary<1> &boundary,
+template <>
+void FEQuadraticSub<2>::get_unit_ansatz_points (vector<Point<2> > &unit_points) const {
+ Assert (unit_points.size() == total_dofs,
+ ExcWrongFieldDimension (unit_points.size(), total_dofs));
+
+ unit_points[0] = Point<2> (0,0);
+ unit_points[1] = Point<2> (1,0);
+ unit_points[2] = Point<2> (1,1);
+ unit_points[3] = Point<2> (0,1);
+ unit_points[4] = Point<2> (0.5,0);
+ unit_points[5] = Point<2> (1,0.5);
+ unit_points[6] = Point<2> (0.5,1);
+ unit_points[7] = Point<2> (0,0.5);
+ unit_points[8] = Point<2> (0.5,0.5);
+};
+
+
+
template <>
void FEQuadraticSub<2>::get_ansatz_points (const typename DoFHandler<2>::cell_iterator &cell,
const Boundary<2>&,
+template <>
+void FEQuarticSub<1>::get_unit_ansatz_points (vector<Point<1> > &unit_points) const {
+ FiniteElement<1>::get_unit_ansatz_points (unit_points);
+};
+
+
+
template <>
void FEQuarticSub<1>::get_ansatz_points (const typename DoFHandler<1>::cell_iterator &cell,
const Boundary<1> &boundary,
+template <>
+void FEQuarticSub<2>::get_unit_ansatz_points (vector<Point<2> > &unit_points) const {
+ Assert (unit_points.size() == total_dofs,
+ ExcWrongFieldDimension (unit_points.size(), total_dofs));
+
+ unit_points[0] = Point<2>(0,0);
+ unit_points[1] = Point<2>(1,0);
+ unit_points[2] = Point<2>(1,1);
+ unit_points[3] = Point<2>(0,1);
+ unit_points[4] = Point<2>(1./4,0);
+ unit_points[5] = Point<2>(2./4,0);
+ unit_points[6] = Point<2>(3./4,0);
+ unit_points[7] = Point<2>(1,1./4);
+ unit_points[8] = Point<2>(1,2./4);
+ unit_points[9] = Point<2>(1,3./4);
+ unit_points[10] = Point<2>(1./4,1);
+ unit_points[11] = Point<2>(2./4,1);
+ unit_points[12] = Point<2>(3./4,1);
+ unit_points[13] = Point<2>(0,1./4);
+ unit_points[14] = Point<2>(0,2./4);
+ unit_points[15] = Point<2>(0,3./4);
+ unit_points[16] = Point<2>(1./4,1./4);
+ unit_points[17] = Point<2>(3./4,1./4);
+ unit_points[18] = Point<2>(3./4,3./4);
+ unit_points[19] = Point<2>(1./4,3./4);
+ unit_points[20] = Point<2>(1./2,1./4);
+ unit_points[21] = Point<2>(3./4,1./2);
+ unit_points[22] = Point<2>(1./2,3./4);
+ unit_points[23] = Point<2>(1./4,1./2);
+ unit_points[24] = Point<2>(1./2,1./2);
+};
+
+
+
template <>
void FEQuarticSub<2>::get_ansatz_points (const typename DoFHandler<2>::cell_iterator &cell,
const Boundary<2>&,