*/
virtual std::string get_name () const;
- /**
- * Implementation of the corresponding function in the FiniteElement
- * class. Since the current element is interpolatory, the nodal
- * values are exactly the support point values. Furthermore, since
- * the current element is scalar, the support point values need to
- * be vectors of length 1.
- */
- virtual
- void
- convert_generalized_support_point_values_to_dof_values (const std::vector<Vector<double> > &support_point_values,
- std::vector<double> &nodal_values) const;
+ /**
+ * Implementation of the corresponding function in the FiniteElement
+ * class. Since the current element is interpolatory, the nodal
+ * values are exactly the support point values. Furthermore, since
+ * the current element is scalar, the support point values need to
+ * be vectors of length 1.
+ */
+ virtual
+ void
+ convert_generalized_support_point_values_to_dof_values (const std::vector<Vector<double> > &support_point_values,
+ std::vector<double> &nodal_values) const;
/**
* Return the matrix interpolating from a face of of one element to the face
std::unique_ptr<FiniteElement<dim,spacedim> >
clone() const;
- /**
- * Implementation of the corresponding function in the FiniteElement
- * class. Since the current element is interpolatory, the nodal
- * values are exactly the support point values. Furthermore, since
- * the current element is scalar, the support point values need to
- * be vectors of length 1.
- */
+ /**
+ * Implementation of the corresponding function in the FiniteElement
+ * class. Since the current element is interpolatory, the nodal
+ * values are exactly the support point values. Furthermore, since
+ * the current element is scalar, the support point values need to
+ * be vectors of length 1.
+ */
virtual
void
convert_generalized_support_point_values_to_dof_values (const std::vector<Vector<double> > &support_point_values,
:
FE_PolyFace<TensorProductPolynomials<dim-1>, dim, spacedim>
(TensorProductPolynomials<dim-1>(Polynomials::generate_complete_Lagrange_basis(internal::FE_FaceQ::get_QGaussLobatto_points(degree))),
- FiniteElementData<dim>(get_dpo_vector(degree), 1, degree, FiniteElementData<dim>::L2),
- std::vector<bool>(1,true))
+ FiniteElementData<dim>(get_dpo_vector(degree), 1, degree, FiniteElementData<dim>::L2),
+ std::vector<bool>(1,true))
{
// initialize unit face support points
const unsigned int codim = dim-1;
convert_generalized_support_point_values_to_dof_values (const std::vector<Vector<double> > &support_point_values,
std::vector<double> &nodal_values) const
{
- AssertDimension (support_point_values.size(),
- this->get_unit_support_points().size());
- AssertDimension (support_point_values.size(),
- nodal_values.size());
- AssertDimension (this->dofs_per_cell,
- nodal_values.size());
+ AssertDimension (support_point_values.size(),
+ this->get_unit_support_points().size());
+ AssertDimension (support_point_values.size(),
+ nodal_values.size());
+ AssertDimension (this->dofs_per_cell,
+ nodal_values.size());
- for (unsigned int i=0; i<this->dofs_per_cell; ++i)
- {
+ for (unsigned int i=0; i<this->dofs_per_cell; ++i)
+ {
AssertDimension (support_point_values[i].size(), 1);
nodal_values[i] = support_point_values[i](0);
- }
+ }
}
// ----------------------------- FE_FaceQ<1,spacedim> ------------------------
FE_FaceQ<1,spacedim>::FE_FaceQ (const unsigned int degree)
:
FiniteElement<1,spacedim> (FiniteElementData<1>(get_dpo_vector(degree), 1, degree, FiniteElementData<1>::L2),
- std::vector<bool>(1,true),
- std::vector<ComponentMask> (1, ComponentMask(1,true)))
+ std::vector<bool>(1,true),
+ std::vector<ComponentMask> (1, ComponentMask(1,true)))
{
this->unit_face_support_points.resize(1);
:
FE_PolyFace<PolynomialSpace<dim-1>, dim, spacedim>
(PolynomialSpace<dim-1>(Polynomials::Legendre::generate_complete_basis(degree)),
- FiniteElementData<dim>(get_dpo_vector(degree), 1, degree, FiniteElementData<dim>::L2),
- std::vector<bool>(1,true))
+ FiniteElementData<dim>(get_dpo_vector(degree), 1, degree, FiniteElementData<dim>::L2),
+ std::vector<bool>(1,true))
{}
FE_TraceQ<dim,spacedim>::FE_TraceQ (const unsigned int degree)
:
FE_PolyFace<TensorProductPolynomials<dim-1>, dim, spacedim> (
- TensorProductPolynomials<dim-1>(Polynomials::generate_complete_Lagrange_basis(QGaussLobatto<1>(degree+1).get_points())),
- FiniteElementData<dim>(get_dpo_vector(degree), 1, degree, FiniteElementData<dim>::L2),
- std::vector<bool>(1,true)),
+ TensorProductPolynomials<dim-1>(Polynomials::generate_complete_Lagrange_basis(QGaussLobatto<1>(degree+1).get_points())),
+ FiniteElementData<dim>(get_dpo_vector(degree), 1, degree, FiniteElementData<dim>::L2),
+ std::vector<bool>(1,true)),
fe_q (degree)
{
Assert (degree > 0,
convert_generalized_support_point_values_to_dof_values (const std::vector<Vector<double> > &support_point_values,
std::vector<double> &nodal_values) const
{
- AssertDimension (support_point_values.size(),
- this->get_unit_support_points().size());
- AssertDimension (support_point_values.size(),
- nodal_values.size());
- AssertDimension (this->dofs_per_cell,
- nodal_values.size());
-
- for (unsigned int i=0; i<this->dofs_per_cell; ++i)
- {
+ AssertDimension (support_point_values.size(),
+ this->get_unit_support_points().size());
+ AssertDimension (support_point_values.size(),
+ nodal_values.size());
+ AssertDimension (this->dofs_per_cell,
+ nodal_values.size());
+
+ for (unsigned int i=0; i<this->dofs_per_cell; ++i)
+ {
AssertDimension (support_point_values[i].size(), 1);
nodal_values[i] = support_point_values[i](0);
- }
+ }
}
template <int dim>
void test()
{
- Triangulation<dim> triangulation;
- FE_FaceQ<dim> fe(2);
- DoFHandler<dim> dof_handler(triangulation);
+ Triangulation<dim> triangulation;
+ FE_FaceQ<dim> fe(2);
+ DoFHandler<dim> dof_handler(triangulation);
- GridGenerator::hyper_cube (triangulation, 0, 1);
- triangulation.refine_global(6);
+ GridGenerator::hyper_cube (triangulation, 0, 1);
+ triangulation.refine_global(6);
- dof_handler.distribute_dofs (fe);
- Vector<double> solution(dof_handler.n_dofs());
+ dof_handler.distribute_dofs (fe);
+ Vector<double> solution(dof_handler.n_dofs());
- VectorTools::interpolate(dof_handler,
- ZeroFunction<dim>(),
- solution);
- deallog << "Success, dim = " << dim << std::endl;
+ VectorTools::interpolate(dof_handler,
+ ZeroFunction<dim>(),
+ solution);
+ deallog << "Success, dim = " << dim << std::endl;
}
int main()
{
- initlog();
+ initlog();
- test<2>();
- test<3>();
- return 0;
+ test<2>();
+ test<3>();
+ return 0;
}
template <int dim>
void test()
{
- Triangulation<dim> triangulation;
- FE_TraceQ<dim> fe(2);
- DoFHandler<dim> dof_handler(triangulation);
+ Triangulation<dim> triangulation;
+ FE_TraceQ<dim> fe(2);
+ DoFHandler<dim> dof_handler(triangulation);
- GridGenerator::hyper_cube (triangulation, 0, 1);
- triangulation.refine_global(6);
+ GridGenerator::hyper_cube (triangulation, 0, 1);
+ triangulation.refine_global(6);
- dof_handler.distribute_dofs (fe);
- Vector<double> solution(dof_handler.n_dofs());
+ dof_handler.distribute_dofs (fe);
+ Vector<double> solution(dof_handler.n_dofs());
- VectorTools::interpolate(dof_handler,
- ZeroFunction<dim>(),
- solution);
- deallog << "Success, dim = " << dim << std::endl;
+ VectorTools::interpolate(dof_handler,
+ ZeroFunction<dim>(),
+ solution);
+ deallog << "Success, dim = " << dim << std::endl;
}
int main()
{
- initlog();
+ initlog();
- test<2>();
- test<3>();
- return 0;
+ test<2>();
+ test<3>();
+ return 0;
}