17 #include <deal.II/fe/fe_dgp_monomial.h> 18 #include <deal.II/fe/fe_tools.h> 22 DEAL_II_NAMESPACE_OPEN
42 const unsigned int start_index2d[6]= {0,1,4,10,20,35};
43 const double points2d[35][2]=
47 {0,0},{1,0},{0,1},{1,1},{0.5,0},{0,0.5},
48 {0,0},{1,0},{0,1},{1,1},{1./3.,0},{2./3.,0},{0,1./3.},{0,2./3.},{0.5,1},{1,0.5},
49 {0,0},{1,0},{0,1},{1,1},{0.25,0},{0.5,0},{0.75,0},{0,0.25},{0,0.5},{0,0.75},{1./3.,1},{2./3.,1},{1,1./3.},{1,2./3.},{0.5,0.5}
58 const unsigned int start_index3d[6]= {0,1,5,15};
59 const double points3d[35][3]=
62 {0,0,0},{1,0,0},{0,1,0},{0,0,1},
63 {0,0,0},{1,0,0},{0,1,0},{0,0,1},{0.5,0,0},{0,0.5,0},{0,0,0.5},{1,1,0},{1,0,1},{0,1,1}
68 void generate_unit_points (
const unsigned int,
72 void generate_unit_points (
const unsigned int k,
76 const double h = 1./k;
77 for (
unsigned int i=0; i<p.size(); ++i)
82 void generate_unit_points (
const unsigned int k,
87 for (
unsigned int i=0; i<p.size(); ++i)
89 p[i](0)=points2d[start_index2d[k]+i][0];
90 p[i](1)=points2d[start_index2d[k]+i][1];
95 void generate_unit_points (
const unsigned int k,
100 for (
unsigned int i=0; i<p.size(); ++i)
102 p[i](0)=points3d[start_index3d[k]+i][0];
103 p[i](1)=points3d[start_index3d[k]+i][1];
104 p[i](2)=points3d[start_index3d[k]+i][2];
117 std::vector<bool>(
FiniteElementData<dim>(get_dpo_vector(degree), 1, degree).dofs_per_cell,true),
119 get_dpo_vector(degree), 1, degree).dofs_per_cell,
std::vector<bool>(1,true)))
150 std::ostringstream namebuf;
151 namebuf <<
"FE_DGPMonomial<" << dim <<
">(" << this->degree <<
")";
153 return namebuf.str();
177 if (source_dgp_monomial)
182 const unsigned int m=interpolation_matrix.
m();
183 const unsigned int n=interpolation_matrix.
n();
190 const unsigned int min_mn=
191 interpolation_matrix.
m()<interpolation_matrix.
n() ?
192 interpolation_matrix.
m() : interpolation_matrix.
n();
194 for (
unsigned int i=0; i<min_mn; ++i)
195 interpolation_matrix(i,i)=1.;
199 std::vector<Point<dim> > unit_points(this->dofs_per_cell);
200 generate_unit_points(this->degree, unit_points);
204 for (
unsigned int k=0; k<unit_points.size(); ++k)
205 source_fe_matrix(k,j)=source_fe.
shape_value(j, unit_points[k]);
208 for (
unsigned int j=0; j<this->dofs_per_cell; ++j)
209 for (
unsigned int k=0; k<unit_points.size(); ++k)
210 this_matrix(k,j)=this->poly_space.compute_value (j, unit_points[k]);
214 this_matrix.
mmult(interpolation_matrix, source_fe_matrix);
234 std::vector<unsigned int>
237 std::vector<unsigned int> dpo(dim+1, 0U);
239 for (
unsigned int i=1; i<dim; ++i)
260 (void)interpolation_matrix;
265 ExcInterpolationNotImplemented());
267 Assert (interpolation_matrix.
m() == 0,
270 Assert (interpolation_matrix.
n() == 0,
290 (void)interpolation_matrix;
295 ExcInterpolationNotImplemented());
297 Assert (interpolation_matrix.
m() == 0,
300 Assert (interpolation_matrix.
n() == 0,
317 std::vector<std::pair<unsigned int, unsigned int> >
325 std::vector<std::pair<unsigned int, unsigned int> > ();
329 return std::vector<std::pair<unsigned int, unsigned int> > ();
336 std::vector<std::pair<unsigned int, unsigned int> >
344 std::vector<std::pair<unsigned int, unsigned int> > ();
348 return std::vector<std::pair<unsigned int, unsigned int> > ();
355 std::vector<std::pair<unsigned int, unsigned int> >
363 std::vector<std::pair<unsigned int, unsigned int> > ();
367 return std::vector<std::pair<unsigned int, unsigned int> > ();
394 const unsigned int face_index)
const 396 return face_index==1 || (face_index==0 && this->degree==0);
404 const unsigned int face_index)
const 406 bool support_on_face=
false;
407 if (face_index==1 || face_index==2)
408 support_on_face=
true;
411 unsigned int degrees[2];
412 this->poly_space.directional_degrees(shape_index, degrees);
413 if ((face_index==0 && degrees[1]==0) ||
414 (face_index==3 && degrees[0]==0))
415 support_on_face=
true;
417 return support_on_face;
425 const unsigned int face_index)
const 427 bool support_on_face=
false;
428 if (face_index==1 || face_index==3 || face_index==4)
429 support_on_face=
true;
432 unsigned int degrees[3];
433 this->poly_space.directional_degrees(shape_index, degrees);
434 if ((face_index==0 && degrees[1]==0) ||
435 (face_index==2 && degrees[2]==0) ||
436 (face_index==5 && degrees[0]==0))
437 support_on_face=
true;
439 return support_on_face;
455 #include "fe_dgp_monomial.inst" 458 DEAL_II_NAMESPACE_CLOSE
static std::vector< unsigned int > get_dpo_vector(const unsigned int degree)
std::vector< std::vector< FullMatrix< double > > > restriction
virtual void get_subface_interpolation_matrix(const FiniteElement< dim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
FE_DGPMonomial(const unsigned int p)
virtual void get_face_interpolation_matrix(const FiniteElement< dim > &source, FullMatrix< double > &matrix) const
virtual FiniteElement< dim > * clone() const
const unsigned int degree
#define AssertThrow(cond, exc)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim > &fe_other) const
virtual bool hp_constraints_are_implemented() const
void initialize_restriction()
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim > &fe_other) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim > &fe_other) const
std::vector< std::vector< FullMatrix< double > > > prolongation
virtual void get_interpolation_matrix(const FiniteElement< dim > &source, FullMatrix< double > &matrix) const
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
virtual std::string get_name() const =0
const unsigned int dofs_per_cell
void mmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim > &fe_other) const
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
virtual std::size_t memory_consumption() const
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
static ::ExceptionBase & ExcNotImplemented()
virtual std::string get_name() const
PolynomialsP< dim > poly_space
static ::ExceptionBase & ExcInternalError()