template <int dim>
-FE_RaviartThomas<dim>::FE_RaviartThomas (const unsigned int degree)
+FE_RaviartThomas<dim>::FE_RaviartThomas (const unsigned int rt_order)
:
- FiniteElement<dim> (FiniteElementData<dim>(get_dpo_vector(degree),
- dim, degree+1),
- get_ria_vector (degree),
- std::vector<std::vector<bool> >(FiniteElementData<dim>(get_dpo_vector(degree),dim,degree+1).dofs_per_cell,
+ FiniteElement<dim> (FiniteElementData<dim>(get_dpo_vector(rt_order),
+ dim, rt_order+1),
+ get_ria_vector (rt_order),
+ std::vector<std::vector<bool> >(FiniteElementData<dim>(get_dpo_vector(rt_order),dim,rt_order+1).dofs_per_cell,
std::vector<bool>(dim,true))),
- degree(degree),
- polynomials (create_polynomials(degree)),
- renumber (compute_renumber(degree))
+ rt_order(rt_order),
+ polynomials (create_polynomials(rt_order)),
+ renumber (compute_renumber(rt_order))
{
Assert (dim >= 2, ExcNotUsefulInThisDimension());
// the number of degrees of freedom
// per cell
Assert (((dim==2) &&
- (this->dofs_per_cell == 2*(degree+1)*(degree+2)))
+ (this->dofs_per_cell == 2*(rt_order+1)*(rt_order+2)))
||
((dim==3) &&
- (this->dofs_per_cell == 3*(degree+1)*(degree+1)*(degree+2))),
+ (this->dofs_per_cell == 3*(rt_order+1)*(rt_order+1)*(rt_order+2))),
ExcInternalError());
Assert (renumber.size() == this->dofs_per_cell,
ExcInternalError());
std::ostrstream namebuf;
#endif
- namebuf << "FE_RaviartThomas<" << dim << ">(" << degree << ")";
+ namebuf << "FE_RaviartThomas<" << dim << ">(" << rt_order << ")";
#ifndef HAVE_STD_STRINGSTREAM
namebuf << std::ends;
FiniteElement<dim> *
FE_RaviartThomas<dim>::clone() const
{
- return new FE_RaviartThomas<dim>(degree);
+ return new FE_RaviartThomas<dim>(rt_order);
}
// this case is too easy, so
// special case it
- if (degree == 0)
+ if (rt_order == 0)
{
this->interface_constraints(0,0) = this->interface_constraints(1,0) = .5;
return;
// need inside deal.II
const std::vector<Polynomials::Polynomial<double> >
face_polynomials (Polynomials::Hierarchical::
- generate_complete_basis (degree));
+ generate_complete_basis (rt_order));
Assert (face_polynomials.size() == this->dofs_per_face, ExcInternalError());
FullMatrix<double> face_interpolation (2*this->dofs_per_face, this->dofs_per_face);
for (unsigned int subface=0; subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
for (unsigned int i=0; i<this->dofs_per_face; ++i)
{
- const double p_face (1.*i/degree/2 + (subface == 0 ? 0. : .5));
- const double p_subface (1.*i/degree);
+ const double p_face (1.*i/rt_order/2 + (subface == 0 ? 0. : .5));
+ const double p_subface (1.*i/rt_order);
for (unsigned int j=0; j<this->dofs_per_face; ++j)
{
FE_RaviartThomas<2>::initialize_restriction ()
{
const unsigned int dim = 2;
- switch (degree)
+ switch (rt_order)
{
case 0:
{
{
case 2:
{
- Assert (degree+1 == this->dofs_per_face, ExcInternalError());
+ Assert (rt_order+1 == this->dofs_per_face, ExcInternalError());
// associate support points
// with mid-face points if a
case 3:
{
// same as in 2d
- Assert ((degree+1)*(degree+1) == this->dofs_per_face, ExcInternalError());
+ Assert ((rt_order+1)*(rt_order+1) == this->dofs_per_face, ExcInternalError());
// start with the face shape
// functions
template <int dim>
std::vector<unsigned int>
-FE_RaviartThomas<dim>::get_dpo_vector (const unsigned int degree)
+FE_RaviartThomas<dim>::get_dpo_vector (const unsigned int rt_order)
{
// the element is face-based (not
// to be confused with George
// W. Bush's Faith Based
// Initiative...), and we have
- // (degree+1)^(dim-1) DoFs per face
+ // (rt_order+1)^(dim-1) DoFs per face
unsigned int dofs_per_face = 1;
for (unsigned int d=0; d<dim-1; ++d)
- dofs_per_face *= degree+1;
+ dofs_per_face *= rt_order+1;
// and then there are interior dofs
const unsigned int
- interior_dofs = dim*degree*dofs_per_face;
+ interior_dofs = dim*rt_order*dofs_per_face;
std::vector<unsigned int> dpo(dim+1);
dpo[dim-1] = dofs_per_face;
template <int dim>
std::vector<bool>
-FE_RaviartThomas<dim>::get_ria_vector (const unsigned int degree)
+FE_RaviartThomas<dim>::get_ria_vector (const unsigned int rt_order)
{
unsigned int dofs_per_cell, dofs_per_face;
switch (dim)
{
case 2:
- dofs_per_face = degree+1;
- dofs_per_cell = 2*(degree+1)*(degree+2);
+ dofs_per_face = rt_order+1;
+ dofs_per_cell = 2*(rt_order+1)*(rt_order+2);
break;
case 3:
- dofs_per_face = (degree+1)*(degree+1);
- dofs_per_cell = 3*(degree+1)*(degree+1)*(degree+2);
+ dofs_per_face = (rt_order+1)*(rt_order+1);
+ dofs_per_cell = 3*(rt_order+1)*(rt_order+1)*(rt_order+2);
break;
default:
Assert (false, ExcNotImplemented());
}
- Assert (FiniteElementData<dim>(get_dpo_vector(degree),dim).dofs_per_cell ==
+ Assert (FiniteElementData<dim>(get_dpo_vector(rt_order),dim).dofs_per_cell ==
dofs_per_cell,
ExcInternalError());
- Assert (FiniteElementData<dim>(get_dpo_vector(degree),dim).dofs_per_face ==
+ Assert (FiniteElementData<dim>(get_dpo_vector(rt_order),dim).dofs_per_face ==
dofs_per_face,
ExcInternalError());
template <>
std::vector<AnisotropicPolynomials<2> >
-FE_RaviartThomas<2>::create_polynomials (const unsigned int degree)
+FE_RaviartThomas<2>::create_polynomials (const unsigned int rt_order)
{
const unsigned int dim = 2;
// see the book by Brezzi and
// Fortin
const std::vector<Polynomials::Polynomial<double> > pols[2]
- = { Polynomials::Hierarchical::generate_complete_basis (degree+1),
- Polynomials::Hierarchical::generate_complete_basis (degree)};
+ = { Polynomials::Hierarchical::generate_complete_basis (rt_order+1),
+ Polynomials::Hierarchical::generate_complete_basis (rt_order)};
// create spaces (k+1,k) and (k,k+1)
std::vector<std::vector<Polynomials::Polynomial<double> > >
template <>
std::vector<AnisotropicPolynomials<3> >
-FE_RaviartThomas<3>::create_polynomials (const unsigned int degree)
+FE_RaviartThomas<3>::create_polynomials (const unsigned int rt_order)
{
const unsigned int dim = 3;
// see the book by Brezzi and
// Fortin
const std::vector<Polynomials::Polynomial<double> > pols[2]
- = { Polynomials::Hierarchical::generate_complete_basis (degree+1),
- Polynomials::Hierarchical::generate_complete_basis (degree)};
+ = { Polynomials::Hierarchical::generate_complete_basis (rt_order+1),
+ Polynomials::Hierarchical::generate_complete_basis (rt_order)};
// create spaces (k+1,k,k),
// (k,k+1,k) and (k,k,k+1)
template <>
std::vector<std::pair<unsigned int, unsigned int> >
-FE_RaviartThomas<2>::compute_renumber (const unsigned int degree)
+FE_RaviartThomas<2>::compute_renumber (const unsigned int rt_order)
{
const unsigned int dim = 2;
std::vector<std::pair<unsigned int, unsigned int> > ret_val;
// to explain the following: the
- // first (degree+1) shape functions
+ // first (rt_order+1) shape functions
// are on face 0, and point in
// y-direction, so are for the
// second vector component. then
- // there are (degree+1) shape
+ // there are (rt_order+1) shape
// functions on face 1, which is
// for the x vector component, and
// so on. since the order of face
- // degrees of freedom is arbitrary,
+ // rt_orders of freedom is arbitrary,
// we simply use the same order as
// that provided by the 1d
// polynomial class on which this
// element is based. after
- // 4*(degree+1), the remaining
+ // 4*(rt_order+1), the remaining
// shape functions are all bubbles,
// so we can number them in any way
// we want. we do so by first
// comments below
// face 0
- for (unsigned int i=0; i<degree+1; ++i)
+ for (unsigned int i=0; i<rt_order+1; ++i)
ret_val.push_back (std::make_pair (1U, i));
// face 1
- for (unsigned int i=0; i<degree+1; ++i)
- ret_val.push_back (std::make_pair (0U, (degree+2)*i+1));
+ for (unsigned int i=0; i<rt_order+1; ++i)
+ ret_val.push_back (std::make_pair (0U, (rt_order+2)*i+1));
// face 2
- for (unsigned int i=0; i<degree+1; ++i)
- ret_val.push_back (std::make_pair (1U, (degree+1)+i));
+ for (unsigned int i=0; i<rt_order+1; ++i)
+ ret_val.push_back (std::make_pair (1U, (rt_order+1)+i));
// face 3
- for (unsigned int i=0; i<degree+1; ++i)
- ret_val.push_back (std::make_pair (0U, (degree+2)*i));
+ for (unsigned int i=0; i<rt_order+1; ++i)
+ ret_val.push_back (std::make_pair (0U, (rt_order+2)*i));
// then go on with interior bubble
// functions, first for the
// x-direction, then for the
// y-direction
- for (unsigned int x=0; x<degree; ++x)
- for (unsigned int y=0; y<degree+1; ++y)
+ for (unsigned int x=0; x<rt_order; ++x)
+ for (unsigned int y=0; y<rt_order+1; ++y)
{
- const unsigned int index_in_component = (x+2) + y*(degree+2);
- Assert (index_in_component < (degree+1)*(degree+2),
+ const unsigned int index_in_component = (x+2) + y*(rt_order+2);
+ Assert (index_in_component < (rt_order+1)*(rt_order+2),
ExcInternalError());
ret_val.push_back (std::make_pair(0U, index_in_component));
}
- for (unsigned int x=0; x<degree+1; ++x)
- for (unsigned int y=0; y<degree; ++y)
+ for (unsigned int x=0; x<rt_order+1; ++x)
+ for (unsigned int y=0; y<rt_order; ++y)
{
- const unsigned int index_in_component = 2*(degree+1) + y + x*degree;
- Assert (index_in_component < (degree+1)*(degree+2),
+ const unsigned int index_in_component = 2*(rt_order+1) + y + x*rt_order;
+ Assert (index_in_component < (rt_order+1)*(rt_order+2),
ExcInternalError());
ret_val.push_back (std::make_pair(1U, index_in_component));
}
// make sure we have actually used
// up all elements of the tensor
// product polynomial
- Assert (ret_val.size() == 2*(degree+1)*(degree+2),
+ Assert (ret_val.size() == 2*(rt_order+1)*(rt_order+2),
ExcInternalError());
std::vector<bool> test[dim] = { std::vector<bool>(ret_val.size()/dim, false),
std::vector<bool>(ret_val.size()/dim, false) };
template <>
std::vector<std::pair<unsigned int, unsigned int> >
-FE_RaviartThomas<3>::compute_renumber (const unsigned int /*degree*/)
+FE_RaviartThomas<3>::compute_renumber (const unsigned int /*rt_order*/)
{
Assert (false, ExcNotImplemented());
return std::vector<std::pair<unsigned int, unsigned int> > ();
// Return computed values if we
// know them easily. Otherwise, it
// is always safe to return true.
- switch (degree)
+ switch (rt_order)
{
case 0:
{
};
};
- default: // other degree
+ default: // other rt_order
return true;
};
unsigned int
FE_RaviartThomas<dim>::get_degree () const
{
- return degree;
+ return rt_order;
}