34 unsigned int comp_index)
const
36 ASSERT_LT(basis_index, this->
dim()).error(
"Index of basis function is out of range.");
39 if (basis_index>0 && comp_index==basis_index-1)
40 return point[comp_index]-1;
42 return point[comp_index];
48 unsigned int comp_index)
const
50 ASSERT_LT(basis_index, this->
dim()).error(
"Index of basis function is out of range.");
63 arma::vec::fixed<1> sp; sp[0] = 0.;
64 arma::vec::fixed<2> bsp; bsp[0] = 1.; bsp[1] = 0.;
67 this->function_space_ = make_shared<RT0_space>(0);
69 this->dofs_.push_back(
Dof(0, 0, bsp, sp,
Value));
70 this->component_indices_.clear();
75 template<
unsigned int dim>
78 arma::vec::fixed<dim> sp;
81 this->function_space_ = make_shared<RT0_space>(dim);
83 for (
unsigned int sid=0; sid<RefElement<dim>::n_sides; ++sid)
86 for (
unsigned int i=0; i<RefElement<dim>::n_nodes_per_side; ++i)
90 arma::vec::fixed<dim+1> bsp;
91 bsp.subvec(1,dim) = sp;
92 bsp[0] = 1. - arma::sum(sp);
96 this->component_indices_.clear();
97 this->nonzero_components_.resize(this->dofs_.size(),
std::vector<bool>(this->n_components(),
true));
99 this->compute_node_matrix();
113 arma::vec::fixed<1> sp; sp[0] = 0.;
114 arma::vec::fixed<1> bsp; bsp[0] = 1.;
117 this->function_space_ = make_shared<RT0_space>(0);
119 this->dofs_.push_back(
Dof(0, 0, bsp, sp,
Value));
120 this->component_indices_.clear();
124 template<
unsigned int dim>
127 arma::vec::fixed<dim> sp;
130 this->function_space_ = make_shared<RT0_space>(dim);
132 for (
unsigned int sid=0; sid<RefElement<dim>::n_sides; ++sid)
135 for (
unsigned int i=0; i<RefElement<dim>::n_nodes_per_side; ++i)
139 arma::vec::fixed<dim+1> bsp;
140 bsp.subvec(1,dim) = sp;
141 bsp[0] = 1. - arma::sum(sp);
145 this->component_indices_.clear();
146 this->nonzero_components_.resize(this->dofs_.size(),
std::vector<bool>(this->n_components(),
true));
148 this->compute_node_matrix();
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
Discontinuous Raviart-Thomas element of order 0.
FE_RT0_disc()
Constructor.
Raviart-Thomas element of order 0.
unsigned int n_components_
Number of components of function values.
unsigned int space_dim_
Space dimension of function arguments (i.e. 1, 2 or 3).
double basis_value(unsigned int basis_index, const arma::vec &point, unsigned int comp_index) const override
Value of the i th basis function at point point.
RT0_space(unsigned int dim)
const arma::vec basis_grad(unsigned int basis_index, const arma::vec &point, unsigned int comp_index) const override
Gradient of the i th basis function at point point.
unsigned int dim() const override
Dimension of function space (number of basis functions).
Definitions of Raviart-Thomas finite elements.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
Definitions of particular quadrature rules on simplices.
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc.