17 #include <deal.II/fe/fe_dgp_monomial.h> 18 #include <deal.II/fe/fe_tools.h> 21 #include <deal.II/base/std_cxx14/memory.h> 24 DEAL_II_NAMESPACE_OPEN
47 const unsigned int start_index2d[6]= {0,1,4,10,20,35};
48 const double points2d[35][2]=
52 {0,0},{1,0},{0,1},{1,1},{0.5,0},{0,0.5},
53 {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},
54 {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}
63 const unsigned int start_index3d[6]= {0,1,5,15};
64 const double points3d[35][3]=
67 {0,0,0},{1,0,0},{0,1,0},{0,0,1},
68 {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}
73 void generate_unit_points (
const unsigned int,
77 void generate_unit_points (
const unsigned int k,
81 const double h = 1./k;
82 for (
unsigned int i=0; i<p.size(); ++i)
87 void generate_unit_points (
const unsigned int k,
92 for (
unsigned int i=0; i<p.size(); ++i)
94 p[i](0)=points2d[start_index2d[k]+i][0];
95 p[i](1)=points2d[start_index2d[k]+i][1];
100 void generate_unit_points (
const unsigned int k,
105 for (
unsigned int i=0; i<p.size(); ++i)
107 p[i](0)=points3d[start_index3d[k]+i][0];
108 p[i](1)=points3d[start_index3d[k]+i][1];
109 p[i](2)=points3d[start_index3d[k]+i][2];
124 std::vector<bool>(
FiniteElementData<dim>(get_dpo_vector(degree), 1, degree).dofs_per_cell,true),
126 get_dpo_vector(degree), 1, degree).dofs_per_cell,
std::vector<bool>(1,true)))
157 std::ostringstream namebuf;
158 namebuf <<
"FE_DGPMonomial<" << dim <<
">(" << this->degree <<
")";
160 return namebuf.str();
166 std::unique_ptr<FiniteElement<dim,dim> >
169 return std_cxx14::make_unique<FE_DGPMonomial<dim>>(*this);
184 if (source_dgp_monomial)
189 const unsigned int m=interpolation_matrix.
m();
190 const unsigned int n=interpolation_matrix.
n();
197 const unsigned int min_mn=
198 interpolation_matrix.
m()<interpolation_matrix.
n() ?
199 interpolation_matrix.
m() : interpolation_matrix.
n();
201 for (
unsigned int i=0; i<min_mn; ++i)
202 interpolation_matrix(i,i)=1.;
206 std::vector<Point<dim> > unit_points(this->dofs_per_cell);
207 internal::FE_DGPMonomial::generate_unit_points(this->degree, unit_points);
211 for (
unsigned int k=0; k<unit_points.size(); ++k)
212 source_fe_matrix(k,j)=source_fe.
shape_value(j, unit_points[k]);
215 for (
unsigned int j=0; j<this->dofs_per_cell; ++j)
216 for (
unsigned int k=0; k<unit_points.size(); ++k)
217 this_matrix(k,j)=this->poly_space.compute_value (j, unit_points[k]);
221 this_matrix.
mmult(interpolation_matrix, source_fe_matrix);
241 std::vector<unsigned int>
244 std::vector<unsigned int> dpo(dim+1, 0U);
246 for (
unsigned int i=1; i<dim; ++i)
267 (void)interpolation_matrix;
272 ExcInterpolationNotImplemented());
274 Assert (interpolation_matrix.
m() == 0,
277 Assert (interpolation_matrix.
n() == 0,
297 (void)interpolation_matrix;
302 ExcInterpolationNotImplemented());
304 Assert (interpolation_matrix.
m() == 0,
307 Assert (interpolation_matrix.
n() == 0,
324 std::vector<std::pair<unsigned int, unsigned int> >
332 std::vector<std::pair<unsigned int, unsigned int> > ();
336 return std::vector<std::pair<unsigned int, unsigned int> > ();
343 std::vector<std::pair<unsigned int, unsigned int> >
351 std::vector<std::pair<unsigned int, unsigned int> > ();
355 return std::vector<std::pair<unsigned int, unsigned int> > ();
362 std::vector<std::pair<unsigned int, unsigned int> >
370 std::vector<std::pair<unsigned int, unsigned int> > ();
374 return std::vector<std::pair<unsigned int, unsigned int> > ();
401 const unsigned int face_index)
const 403 return face_index==1 || (face_index==0 && this->degree==0);
411 const unsigned int face_index)
const 413 bool support_on_face=
false;
414 if (face_index==1 || face_index==2)
415 support_on_face=
true;
418 unsigned int degrees[2];
419 this->poly_space.directional_degrees(shape_index, degrees);
420 if ((face_index==0 && degrees[1]==0) ||
421 (face_index==3 && degrees[0]==0))
422 support_on_face=
true;
424 return support_on_face;
432 const unsigned int face_index)
const 434 bool support_on_face=
false;
435 if (face_index==1 || face_index==3 || face_index==4)
436 support_on_face=
true;
439 unsigned int degrees[3];
440 this->poly_space.directional_degrees(shape_index, degrees);
441 if ((face_index==0 && degrees[1]==0) ||
442 (face_index==2 && degrees[2]==0) ||
443 (face_index==5 && degrees[0]==0))
444 support_on_face=
true;
446 return support_on_face;
462 #include "fe_dgp_monomial.inst" 465 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
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::unique_ptr< FiniteElement< dim, dim > > clone() const
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()