17 #include <deal.II/fe/fe_rannacher_turek.h> 18 #include <deal.II/base/quadrature_lib.h> 19 #include <deal.II/lac/vector.h> 25 DEAL_II_NAMESPACE_OPEN
30 const unsigned int n_face_support_points) :
37 std::vector<bool>(4, false),
40 n_face_support_points(n_face_support_points)
52 std::vector<unsigned int> dpo(dim + 1, 0);
63 std::ostringstream namebuf;
64 namebuf <<
"FE_RannacherTurek" 66 <<
"(" << this->order <<
", " << this->n_face_support_points <<
")";
84 ::QGauss<dim-1> face_quadrature(this->n_face_support_points);
85 this->weights = face_quadrature.get_weights();
86 this->generalized_support_points.resize(4*face_quadrature.size());
87 for (
unsigned int q = 0;
88 q < face_quadrature.size();
91 this->generalized_support_points[0*face_quadrature.size() + q] =
93 this->generalized_support_points[1*face_quadrature.size() + q] =
95 this->generalized_support_points[2*face_quadrature.size() + q] =
97 this->generalized_support_points[3*face_quadrature.size() + q] =
108 std::vector<double> &nodal_dofs)
const 110 AssertDimension(support_point_values.size(), this->generalized_support_points.size());
114 std::vector<double> scalar_values(support_point_values.size());
115 for (
unsigned int q = 0; q < support_point_values.size(); ++q)
117 scalar_values[q] = support_point_values[q][0];
119 this->interpolate(nodal_dofs, scalar_values);
126 std::vector<double> &local_dofs,
127 const std::vector<double> &values)
const 129 AssertDimension(values.size(), this->generalized_support_points.size());
132 const unsigned int q_points_per_face = this->weights.size();
133 std::fill(local_dofs.begin(), local_dofs.end(), 0.0);
135 std::vector<double>::const_iterator value = values.begin();
136 for (
unsigned int face = 0;
137 face < ::GeometryInfo<dim>::faces_per_cell;
140 for (
unsigned int q = 0;
141 q < q_points_per_face;
144 local_dofs[face] += (*value) * this->weights[q];
154 std::vector<double> &local_dofs,
156 const unsigned int offset)
const 158 AssertDimension(values.size(), this->generalized_support_points.size());
162 std::vector<double> scalar_values(values.size());
163 for (
unsigned int q = 0; q < values.size(); ++q)
165 scalar_values[q] = values[q][offset];
167 this->interpolate(local_dofs, scalar_values);
174 std::vector<double> &local_dofs,
175 const VectorSlice<
const std::vector<std::vector<double> > > &values)
const 178 AssertDimension(values[0].size(), this->generalized_support_points.size());
182 std::vector<double> scalar_values(values[0].size());
183 for (
unsigned int q = 0; q < values[0].size(); ++q)
185 scalar_values[q] = values[0][q];
187 this->interpolate(local_dofs, scalar_values);
193 #include "fe_rannacher_turek.inst" 195 DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)
FE_RannacherTurek(const unsigned int order=0, const unsigned int n_face_support_points=2)
void initialize_support_points()
virtual void interpolate(std::vector< double > &local_dofs, const std::vector< double > &values) const 1
virtual FiniteElement< dim > * clone() const
#define Assert(cond, exc)
virtual std::string get_name() const
virtual void convert_generalized_support_point_values_to_nodal_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const
static ::ExceptionBase & ExcNotImplemented()
std::vector< unsigned int > get_dpo_vector()