17 #include <deal.II/base/quadrature_lib.h> 18 #include <deal.II/base/qprojector.h> 19 #include <deal.II/base/thread_management.h> 20 #include <deal.II/base/utilities.h> 21 #include <deal.II/lac/full_matrix.h> 22 #include <deal.II/lac/householder.h> 23 #include <deal.II/lac/constraint_matrix.h> 24 #include <deal.II/grid/tria.h> 25 #include <deal.II/grid/tria_iterator.h> 26 #include <deal.II/grid/grid_generator.h> 27 #include <deal.II/fe/fe_tools.h> 28 #include <deal.II/fe/fe.h> 29 #include <deal.II/fe/fe_q.h> 30 #include <deal.II/fe/fe_bernstein.h> 31 #include <deal.II/fe/fe_q_hierarchical.h> 32 #include <deal.II/fe/fe_dgq.h> 33 #include <deal.II/fe/fe_dgp.h> 34 #include <deal.II/fe/fe_dgp_monomial.h> 35 #include <deal.II/fe/fe_dgp_nonparametric.h> 36 #include <deal.II/fe/fe_nedelec.h> 37 #include <deal.II/fe/fe_abf.h> 38 #include <deal.II/fe/fe_bdm.h> 39 #include <deal.II/fe/fe_raviart_thomas.h> 40 #include <deal.II/fe/fe_nothing.h> 41 #include <deal.II/fe/fe_system.h> 42 #include <deal.II/fe/fe_values.h> 43 #include <deal.II/fe/mapping_cartesian.h> 44 #include <deal.II/dofs/dof_handler.h> 45 #include <deal.II/dofs/dof_accessor.h> 46 #include <deal.II/dofs/dof_tools.h> 47 #include <deal.II/hp/dof_handler.h> 49 #include <deal.II/base/std_cxx11/shared_ptr.h> 51 #include <deal.II/base/index_set.h> 57 DEAL_II_NAMESPACE_OPEN
66 Assert(
false, ExcNotImplemented());
122 fill_no_codim_fe_names (std::map<std::string,std_cxx11::shared_ptr<const Subscriptor> > &result)
124 typedef std_cxx11::shared_ptr<const Subscriptor> FEFactoryPointer;
126 result[
"FE_Q_Hierarchical"]
132 result[
"FE_RaviartThomas"]
134 result[
"FE_RaviartThomasNodal"]
138 result[
"FE_DGPNonparametric"]
142 result[
"FE_DGPMonomial"]
146 result[
"FE_DGQArbitraryNodes"]
150 result[
"FE_Bernstein"]
159 template <
int dim,
int spacedim>
161 fill_codim_fe_names (std::map<std::string,std_cxx11::shared_ptr<const Subscriptor> > &result)
163 typedef std_cxx11::shared_ptr<const Subscriptor> FEFactoryPointer;
169 result[
"FE_DGQArbitraryNodes"]
173 result[
"FE_Bernstein"]
181 std::vector<std::vector<
182 std::map<std::string,
183 std_cxx11::shared_ptr<const Subscriptor> > > >
186 std::vector<std::vector<
187 std::map<std::string,
188 std_cxx11::shared_ptr<const Subscriptor> > > >
191 for (
unsigned int d=0; d<4; ++d)
194 fill_no_codim_fe_names<1> (result[1][1]);
195 fill_no_codim_fe_names<2> (result[2][2]);
196 fill_no_codim_fe_names<3> (result[3][3]);
198 fill_codim_fe_names<1,2> (result[1][2]);
199 fill_codim_fe_names<1,3> (result[1][3]);
200 fill_codim_fe_names<2,3> (result[2][3]);
238 std::vector<std::vector<
239 std::map<std::string,
240 std_cxx11::shared_ptr<const Subscriptor> > > >
241 fe_name_map = fill_default_map();
264 template <
int dim,
int spacedim>
274 template <
int dim,
typename number,
int spacedim>
281 interpolation_matrix.
n());
283 interpolation_matrix = tmp;
295 template <
int dim,
int spacedim>
297 unsigned int match_dimension (
const std::string &name,
298 const unsigned int position)
300 if (position >= name.size())
303 if ((position+5 < name.size())
305 (name[position] ==
'<')
307 (name[position+1] ==
'd')
309 (name[position+2] ==
'i')
311 (name[position+3] ==
'm')
313 (name[position+4] ==
'>'))
316 Assert (dim<10, ExcNotImplemented());
317 const char dim_char =
'0'+dim;
319 if ((position+3 < name.size())
321 (name[position] ==
'<')
323 (name[position+1] == dim_char)
325 (name[position+2] ==
'>'))
337 template <
int dim,
int spacedim>
342 template<
int dim,
int spacedim>
345 std::vector<unsigned int> &renumbering,
346 std::vector<std::vector<unsigned int> > &comp_start)
349 ExcDimensionMismatch(renumbering.size(),
355 for (
unsigned int i=0; i<comp_start.size(); ++i)
358 const unsigned int increment
361 for (
unsigned int j=0; j<comp_start[i].size(); ++j)
363 comp_start[i][j] = k;
375 std::pair<std::pair<unsigned int, unsigned int>,
unsigned int>
377 renumbering[i] = comp_start[indices.first.first][indices.first.second]
384 template<
int dim,
int spacedim>
387 std::vector<types::global_dof_index> &renumbering,
388 std::vector<types::global_dof_index> &block_data,
389 bool return_start_indices)
392 ExcDimensionMismatch(renumbering.size(),
395 ExcDimensionMismatch(block_data.size(),
399 unsigned int count=0;
403 block_data[count++] = (return_start_indices)
410 std::vector<types::global_dof_index> start_indices(block_data.size());
412 for (
unsigned int i=0; i<block_data.size(); ++i)
413 if (return_start_indices)
414 start_indices[i] = block_data[i];
417 start_indices[i] = k;
423 std::pair<unsigned int, types::global_dof_index>
425 renumbering[i] = start_indices[indices.first]
432 template <
int dim,
typename number,
int spacedim>
441 ExcMatrixDimensionMismatch(interpolation_matrix.
m(),
442 interpolation_matrix.
n(),
449 bool fe_implements_interpolation =
true;
452 gim_forwarder (fe1, fe2, interpolation_matrix);
457 fe_implements_interpolation =
false;
459 if (fe_implements_interpolation ==
true)
473 const std::vector<Point<dim> > &
478 typename FEL::ExcFEHasNoSupportPoints());
487 interpolation_matrix(i,j) = fe1.
shape_value (j,fe2_support_points[i]);
489 interpolation_matrix(i,j)=0.;
496 template <
int dim,
typename number,
int spacedim>
505 ExcMatrixDimensionMismatch(interpolation_matrix.
m(),
506 interpolation_matrix.
n(),
517 second_matrix.
mmult(interpolation_matrix, first_matrix);
522 template <
int dim,
typename number,
int spacedim>
531 ExcMatrixDimensionMismatch(difference_matrix.
m(),
532 difference_matrix.
n(),
540 difference_matrix(i,i) = 1.;
543 difference_matrix.
add (-1, interpolation_matrix);
548 template <
int dim,
typename number,
int spacedim>
557 ExcMatrixDimensionMismatch(matrix.
m(), matrix.
n(),
574 ExcNotImplemented());
588 for (
unsigned int k=0; k<quadrature.
size(); ++k)
590 const double w = val2.
JxW(k);
591 for (
unsigned int i=0; i<n2; ++i)
594 for (
unsigned int j=0; j<n2; ++j)
611 for (
unsigned int j=0; j<n1; ++j)
614 for (
unsigned int i=0; i<n2; ++i)
615 for (
unsigned int k=0; k<quadrature.
size(); ++k)
617 const double w = val2.
JxW(k);
625 for (
unsigned int i=0; i<n2; ++i)
631 template<
int dim,
int spacedim>
639 Assert (N.
n()==n_dofs, ExcDimensionMismatch(N.
n(), n_dofs));
640 Assert (N.
m()==n_dofs, ExcDimensionMismatch(N.
m(), n_dofs));
647 std::vector<std::vector<double> >
648 values (dim, std::vector<double>(points.size()));
652 std::vector<double> local_dofs(n_dofs);
660 for (
unsigned int i=0; i<n_dofs; ++i)
662 for (
unsigned int k=0; k<values[0].size(); ++k)
663 for (
unsigned int d=0; d<dim; ++d)
668 for (
unsigned int j=0; j<n_dofs; ++j)
669 N(j,i) = local_dofs[j];
709 template<
int dim,
typename number,
int spacedim>
711 compute_embedding_for_shape_function (
712 const unsigned int i,
717 const double threshold)
738 for (
unsigned int k = 0; k < nq; ++k)
739 v_coarse (k * nd + d) = phi_i[k];
743 for (
unsigned int d = 0; d < nd; ++d)
744 for (
unsigned int k = 0; k < nq; ++k)
750 Assert (result <= threshold, ExcLeastSquaresError (result));
761 for (
unsigned int j = 0; j < n; ++j)
762 this_matrix(j, i) = v_fine(j);
766 template<
int dim,
typename number,
int spacedim>
768 compute_embedding_matrices_for_refinement_case (
771 const unsigned int ref_case,
772 const double threshold)
776 for (
unsigned int i = 0; i < nc; ++i)
778 Assert(matrices[i].n() == n, ExcDimensionMismatch(matrices[i].n (), n));
779 Assert(matrices[i].m() == n, ExcDimensionMismatch(matrices[i].m (), n));
789 const unsigned int degree = fe.
degree;
791 const unsigned int nq = q_fine.
size();
815 for (
unsigned int j = 0; j < n; ++j)
816 for (
unsigned int d = 0; d < nd; ++d)
817 for (
unsigned int k = 0; k < nq; ++k)
821 unsigned int cell_number = 0;
827 ++fine_cell, ++cell_number)
836 std::vector<Point<dim> > q_points_coarse(q_points_fine.size());
837 for (
unsigned int i=0; i<q_points_fine.size(); ++i)
838 for (
unsigned int j=0; j<dim; ++j)
839 q_points_coarse[i](j) = q_points_fine[i](j);
844 coarse.reinit (tria.
begin (0));
858 for (
unsigned int i = 0; i < n; ++i)
862 i, fe, coarse, H, this_matrix, threshold);
868 for (
unsigned int i = 0; i < n; ++i)
870 compute_embedding_for_shape_function<dim, number, spacedim>
871 (i, fe, coarse, H, this_matrix, threshold);
877 for (
unsigned int i = 0; i < this_matrix.
m (); ++i)
878 for (
unsigned int j = 0; j < this_matrix.
n (); ++j)
879 if (std::fabs (this_matrix (i, j)) < 1e-12)
880 this_matrix (i, j) = 0.;
884 ExcInternalError ());
889 template <
int dim,
typename number,
int spacedim>
893 const bool isotropic_only,
894 const double threshold)
899 unsigned int ref_case = (isotropic_only)
903 for (; ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
904 task_group +=
Threads::new_task (&compute_embedding_matrices_for_refinement_case<dim, number, spacedim>,
905 fe, matrices[ref_case-1], ref_case, threshold);
912 template <
int dim,
typename number,
int spacedim>
916 const unsigned int face_coarse,
917 const unsigned int face_fine,
918 const double threshold)
920 Assert(face_coarse==0, ExcNotImplemented());
921 Assert(face_fine==0, ExcNotImplemented());
923 const unsigned int nc = GeometryInfo<dim>::max_children_per_face;
926 const unsigned int degree = fe.
degree;
931 for (
unsigned int i=0; i<nc; ++i)
933 Assert(matrices[i].n() == n, ExcDimensionMismatch(matrices[i].n(),n));
934 Assert(matrices[i].m() == n, ExcDimensionMismatch(matrices[i].m(),n));
942 std::vector<unsigned int> face_c_dofs(n);
943 std::vector<unsigned int> face_f_dofs(n);
945 unsigned int face_dof=0;
946 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
954 face_c_dofs[face_dof] = offset_c + j;
955 face_f_dofs[face_dof] = offset_f + j;
959 for (
unsigned int i=1; i<=GeometryInfo<dim>::lines_per_face; ++i)
969 face_c_dofs[face_dof] = offset_c + j;
970 face_f_dofs[face_dof] = offset_f + j;
974 for (
unsigned int i=1; i<=GeometryInfo<dim>::quads_per_face; ++i)
984 face_c_dofs[face_dof] = offset_c + j;
985 face_f_dofs[face_dof] = offset_f + j;
1007 QGauss<dim-1> q_gauss(degree+1);
1009 const unsigned int nq = q_fine.
size();
1029 for (
unsigned int j=0; j<n; ++j)
1030 for (
unsigned int k=0; k<nq; ++k)
1032 for (
unsigned int d=0; d<nd; ++d)
1039 for (
unsigned int d=1; d<dim; ++d)
1050 for (
unsigned int cell_number = 0; cell_number < GeometryInfo<dim>::max_children_per_face;
1059 tria.
begin(0)->refinement_case(), face_coarse, cell_number));
1067 for (
unsigned int i=0; i<n; ++i)
1075 for (
unsigned int k=0; k<nq; ++k)
1077 for (
unsigned int d=0; d<nd; ++d)
1084 for (
unsigned int d=1; d<dim; ++d)
1090 Assert (result <= threshold, ExcLeastSquaresError(result));
1101 for (
unsigned int j=0; j<n; ++j)
1102 this_matrix(j,i) = v_fine(j);
1106 for (
unsigned int i=0; i<this_matrix.
m(); ++i)
1107 for (
unsigned int j=0; j<this_matrix.
n(); ++j)
1108 if (std::fabs(this_matrix(i,j)) < 1e-12)
1109 this_matrix(i,j) = 0.;
1115 template <
int dim,
typename number,
int spacedim>
1119 const bool isotropic_only)
1123 const unsigned int degree = fe.
degree;
1128 const unsigned int nq = q_fine.
size();
1142 coarse.
reinit (coarse_cell);
1145 for (
unsigned int i=0; i<n; ++i)
1146 for (
unsigned int j=0; j<n; ++j)
1149 const double *coarse_i = &coarse.
shape_value(i,0);
1150 const double *coarse_j = &coarse.
shape_value(j,0);
1152 for (
unsigned int k=0; k<nq; ++k)
1153 mass_ij += JxW[k] * coarse_i[k] * coarse_j[k];
1154 mass(i,j) = mass_ij;
1159 for (
unsigned int d=0; d<nd; ++d)
1160 for (
unsigned int k=0; k<nq; ++k)
1163 mass(i,j) = mass_ij;
1172 unsigned int ref_case = (isotropic_only)
1175 for (; ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
1180 for (
unsigned int i=0; i<nc; ++i)
1182 Assert(matrices[ref_case-1][i].n() == n,
1183 ExcDimensionMismatch(matrices[ref_case-1][i].n(),n));
1184 Assert(matrices[ref_case-1][i].m() == n,
1185 ExcDimensionMismatch(matrices[ref_case-1][i].m(),n));
1205 for (
unsigned int cell_number=0; cell_number<nc; ++cell_number)
1213 fine.
reinit(coarse_cell->child(cell_number));
1215 std::vector<Point<dim> > q_points_coarse(q_points_fine.size());
1216 for (
unsigned int q=0; q<q_points_fine.size(); ++q)
1217 for (
unsigned int j=0; j<dim; ++j)
1218 q_points_coarse[q](j) = q_points_fine[q](j);
1222 coarse.reinit(coarse_cell);
1236 const double *coarse_i = &coarse.shape_value(i,0);
1240 for (
unsigned int k=0; k<nq; ++k)
1241 update += JxW[k] * coarse_i[k] * fine_j[k];
1247 for (
unsigned int d=0; d<nd; ++d)
1248 for (
unsigned int k=0; k<nq; ++k)
1249 update += JxW[k] * coarse.shape_value_component(i,k,d)
1258 mass.
vmult (v_coarse, v_fine);
1260 this_matrix(i,j) = v_coarse(i);
1265 for (
unsigned int i=0; i<this_matrix.
m(); ++i)
1266 for (
unsigned int j=0; j<this_matrix.
n(); ++j)
1267 if (std::fabs(this_matrix(i,j)) < 1e-12)
1268 this_matrix(i,j) = 0.;
1275 template <
int dim,
int spacedim>
1282 std::string name = parameter_name;
1283 unsigned int name_end =
1284 name.find_first_not_of(std::string(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
1285 if (name_end < name.size())
1286 name.erase(name_end);
1294 Assert(fe_name_map[dim][spacedim].find(name) == fe_name_map[dim][spacedim].end(),
1295 ExcMessage(
"Cannot change existing element in finite element name list"));
1299 fe_name_map[dim][spacedim][name] =
1300 std_cxx11::shared_ptr<const Subscriptor> (factory);
1312 template <
int dim,
int spacedim>
1314 get_fe_from_name_ext (std::string &name,
1315 const std::map<std::string,
1316 std_cxx11::shared_ptr<const Subscriptor> >
1323 unsigned int name_end =
1324 name.find_first_not_of(std::string(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
1325 const std::string name_part(name, 0, name_end);
1326 name.erase(0, name_part.size());
1334 if (name_part ==
"FESystem")
1345 std::vector<const FiniteElement<dim,spacedim>*> base_fes;
1346 std::vector<unsigned int> base_multiplicities;
1351 if (name.size() == 0 || name[0] !=
'[')
1352 throw (std::string(
"Invalid first character in ") + name);
1361 base_fes.push_back (get_fe_from_name_ext<dim,spacedim> (name,
1374 const std::pair<int,unsigned int> tmp
1376 name.erase(0, tmp.second);
1379 base_multiplicities.push_back (tmp.first);
1385 base_multiplicities.push_back (1);
1398 while (name[0] ==
'-');
1405 if (name.size() == 0 || name[0] !=
']')
1406 throw (std::string(
"Invalid first character in ") + name);
1409 Assert ((base_fes.size() == base_multiplicities.size())
1411 (base_fes.size() > 0),
1412 ExcInternalError());
1428 for (
unsigned int i=0; i<base_fes.size(); ++i)
1435 return system_element;
1445 for (
unsigned int i=0; i<base_fes.size(); ++i)
1458 Assert (
false, ExcInternalError());
1460 else if (name_part ==
"FE_Nothing")
1471 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
1480 AssertThrow (fe_name_map.find(name_part) != fe_name_map.end(),
1481 ExcInvalidFEName(name));
1486 if (name.size() == 0 || name[0] !=
'(')
1487 throw (std::string(
"Invalid first character in ") + name);
1491 const std::pair<int,unsigned int> tmp
1493 name.erase(0, tmp.second+1);
1494 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
1496 return fef->
get(tmp.first);
1500 unsigned int position = name.find(
'(');
1501 const std::string quadrature_name(name, 0, position);
1502 name.erase(0,position+1);
1503 if (quadrature_name.compare(
"QGaussLobatto") == 0)
1505 const std::pair<int,unsigned int> tmp
1508 name.erase(0, tmp.second+2);
1509 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
1535 template <
int dim,
int spacedim>
1538 return get_fe_from_name_ext<dim,spacedim> (name, fe_name_map[dim][spacedim]);
1547 template <
int dim,
int spacedim>
1552 std::size_t index = 1;
1555 while (2 < name.size() && index < name.size() - 1)
1557 if (name[index] ==
' ' &&
1558 (!(std::isalnum(name[index - 1]) || name[index - 1] ==
'_') ||
1559 !(std::isalnum(name[index + 1]) || name[index + 1] ==
'_')))
1561 name.erase(index, 1);
1572 for (
unsigned int pos1 = name.find(
'<');
1574 pos1 = name.find(
'<'))
1577 const unsigned int pos2 = name.find(
'>');
1584 const char dimchar =
'0' + dim;
1586 if (name.at(pos1+1) !=
'd')
1587 Assert (name.at(pos1+1) == dimchar,
1588 ExcInvalidFEDimension(name.at(pos1+1), dim));
1591 Assert(pos2-pos1 == 4, ExcInvalidFEName(name));
1597 name.erase(pos1, pos2-pos1+1);
1602 for (
unsigned int pos = name.find(
"^dim");
1604 pos = name.find(
"^dim"))
1605 name.erase(pos+2, 2);
1609 for (
unsigned int pos = name.find(
"^d");
1611 pos = name.find(
"^d"))
1612 name.at(pos+1) =
'0' + dim;
1621 ExcInvalidFEName(parameter_name
1622 + std::string(
" extra characters after " 1626 catch (
const std::string &errline)
1628 AssertThrow(
false, ExcInvalidFEName(parameter_name
1629 + std::string(
" at ")
1640 return get_fe_by_name<dim,dim> (parameter_name);
1644 template <
int dim,
int spacedim>
1661 for (
unsigned int q=0; q<lhs_quadrature.
size(); ++q)
1664 lhs_quadrature.
weight(q);
1667 for (
unsigned int q=0; q<rhs_quadrature.
size(); ++q)
1669 rhs_quadrature.
weight(q);
1677 M_inverse.
mmult (X, Q);
1680 Assert (X.
n() == rhs_quadrature.
size(), ExcInternalError());
1685 template <
int dim,
int spacedim>
1696 for (
unsigned int q=0; q<quadrature.
size(); ++q)
1713 Assert(projection_matrix.n_cols() == vector_of_tensors_at_qp.
size(),
1714 ExcDimensionMismatch(projection_matrix.n_cols(),
1715 vector_of_tensors_at_qp.
size()));
1719 Assert(projection_matrix.n_rows() == vector_of_tensors_at_nodes.
size(),
1720 ExcDimensionMismatch(projection_matrix.n_rows(),
1721 vector_of_tensors_at_nodes.
size()));
1724 const unsigned int n_support_points = projection_matrix.n_rows();
1726 const unsigned int n_quad_points = projection_matrix.n_cols();
1733 for (
unsigned int ii = 0; ii < dim; ++ii)
1736 component_at_qp = 0;
1744 for (
unsigned int q = 0; q < n_quad_points; ++q)
1746 component_at_qp(q) = vector_of_tensors_at_qp[q][ii];
1751 projection_matrix.
vmult(component_at_node, component_at_qp);
1755 for (
unsigned int nn =0; nn <n_support_points; ++nn)
1757 vector_of_tensors_at_nodes[nn][ii] = component_at_node(nn);
1774 Assert(projection_matrix.n_cols() == vector_of_tensors_at_qp.
size(),
1775 ExcDimensionMismatch(projection_matrix.n_cols(),
1776 vector_of_tensors_at_qp.
size()));
1780 Assert(projection_matrix.n_rows() == vector_of_tensors_at_nodes.
size(),
1781 ExcDimensionMismatch(projection_matrix.n_rows(),
1782 vector_of_tensors_at_nodes.
size()));
1785 const unsigned int n_support_points = projection_matrix.n_rows();
1787 const unsigned int n_quad_points = projection_matrix.n_cols();
1790 const unsigned int n_independent_components =
1799 for (
unsigned int ii = 0; ii < n_independent_components; ++ii)
1802 component_at_qp = 0;
1806 const unsigned int row = row_column_index[0];
1807 const unsigned int column = row_column_index[1];
1815 for (
unsigned int q = 0; q < n_quad_points; ++q)
1817 component_at_qp(q) = (vector_of_tensors_at_qp[q])[row][column];
1822 projection_matrix.
vmult(component_at_node, component_at_qp);
1825 for (
unsigned int nn =0; nn <n_support_points; ++nn)
1827 (vector_of_tensors_at_nodes[nn])[row][column] = component_at_node(nn);
1834 template <
int dim,
int spacedim>
1840 const unsigned int face,
1857 fe_face_values.
reinit (cell, face);
1861 for (
unsigned int q=0; q<lhs_quadrature.
size(); ++q)
1864 lhs_quadrature.
weight(q);
1867 M(i,i) = (M(i,i) == 0 ? 1 : M(i,i));
1873 fe_face_values.
reinit (cell, face);
1876 for (
unsigned int q=0; q<rhs_quadrature.
size(); ++q)
1878 rhs_quadrature.
weight(q);
1886 M_inverse.
mmult (X, Q);
1889 Assert (X.
n() == rhs_quadrature.
size(), ExcInternalError());
1900 const unsigned int n = degree+1;
1902 unsigned int dofs_per_cell = n;
1903 for (
unsigned int i=1; i<dim; ++i)
1910 const unsigned int dofs_per_line = degree - 1;
1923 h2l[1] = dofs_per_cell-1;
1924 for (
unsigned int i=2; i<dofs_per_cell; ++i)
1932 unsigned int next_index = 0;
1934 h2l[next_index++] = 0;
1935 h2l[next_index++] = n-1;
1936 h2l[next_index++] = n*(n-1);
1937 h2l[next_index++] = n*n-1;
1940 for (
unsigned int i=0; i<dofs_per_line; ++i)
1941 h2l[next_index++] = (1+i)*n;
1944 for (
unsigned int i=0; i<dofs_per_line; ++i)
1945 h2l[next_index++] = (2+i)*n-1;
1948 for (
unsigned int i=0; i<dofs_per_line; ++i)
1949 h2l[next_index++] = 1+i;
1952 for (
unsigned int i=0; i<dofs_per_line; ++i)
1953 h2l[next_index++] = n*(n-1)+i+1;
1956 for (
unsigned int i=0; i<dofs_per_line; ++i)
1957 for (
unsigned int j=0; j<dofs_per_line; ++j)
1958 h2l[next_index++] = n*(i+1)+j+1;
1960 Assert (next_index == dofs_per_cell, ExcInternalError());
1967 unsigned int next_index = 0;
1969 h2l[next_index++] = 0;
1970 h2l[next_index++] = ( 1)*degree;
1971 h2l[next_index++] = ( n )*degree;
1972 h2l[next_index++] = ( n+1)*degree;
1973 h2l[next_index++] = (n*n )*degree;
1974 h2l[next_index++] = (n*n +1)*degree;
1975 h2l[next_index++] = (n*n+n )*degree;
1976 h2l[next_index++] = (n*n+n+1)*degree;
1979 for (
unsigned int i=0; i<dofs_per_line; ++i)
1980 h2l[next_index++] = (i+1)*n;
1982 for (
unsigned int i=0; i<dofs_per_line; ++i)
1983 h2l[next_index++] = n-1+(i+1)*n;
1985 for (
unsigned int i=0; i<dofs_per_line; ++i)
1986 h2l[next_index++] = 1+i;
1988 for (
unsigned int i=0; i<dofs_per_line; ++i)
1989 h2l[next_index++] = 1+i+n*(n-1);
1992 for (
unsigned int i=0; i<dofs_per_line; ++i)
1993 h2l[next_index++] = (n-1)*n*n+(i+1)*n;
1995 for (
unsigned int i=0; i<dofs_per_line; ++i)
1996 h2l[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
1998 for (
unsigned int i=0; i<dofs_per_line; ++i)
1999 h2l[next_index++] = n*n*(n-1)+i+1;
2001 for (
unsigned int i=0; i<dofs_per_line; ++i)
2002 h2l[next_index++] = n*n*(n-1)+i+1+n*(n-1);
2005 for (
unsigned int i=0; i<dofs_per_line; ++i)
2006 h2l[next_index++] = (i+1)*n*n;
2008 for (
unsigned int i=0; i<dofs_per_line; ++i)
2009 h2l[next_index++] = n-1+(i+1)*n*n;
2011 for (
unsigned int i=0; i<dofs_per_line; ++i)
2012 h2l[next_index++] = (i+1)*n*n+n*(n-1);
2014 for (
unsigned int i=0; i<dofs_per_line; ++i)
2015 h2l[next_index++] = n-1+(i+1)*n*n+n*(n-1);
2020 for (
unsigned int i=0; i<dofs_per_line; ++i)
2021 for (
unsigned int j=0; j<dofs_per_line; ++j)
2022 h2l[next_index++] = (i+1)*n*n+n*(j+1);
2024 for (
unsigned int i=0; i<dofs_per_line; ++i)
2025 for (
unsigned int j=0; j<dofs_per_line; ++j)
2026 h2l[next_index++] = (i+1)*n*n+n-1+n*(j+1);
2028 for (
unsigned int i=0; i<dofs_per_line; ++i)
2029 for (
unsigned int j=0; j<dofs_per_line; ++j)
2030 h2l[next_index++] = (j+1)*n*n+i+1;
2032 for (
unsigned int i=0; i<dofs_per_line; ++i)
2033 for (
unsigned int j=0; j<dofs_per_line; ++j)
2034 h2l[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
2036 for (
unsigned int i=0; i<dofs_per_line; ++i)
2037 for (
unsigned int j=0; j<dofs_per_line; ++j)
2038 h2l[next_index++] = n*(i+1)+j+1;
2040 for (
unsigned int i=0; i<dofs_per_line; ++i)
2041 for (
unsigned int j=0; j<dofs_per_line; ++j)
2042 h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
2045 for (
unsigned int i=0; i<dofs_per_line; ++i)
2046 for (
unsigned int j=0; j<dofs_per_line; ++j)
2047 for (
unsigned int k=0; k<dofs_per_line; ++k)
2048 h2l[next_index++] = n*n*(i+1)+n*(j+1)+k+1;
2050 Assert (next_index == dofs_per_cell, ExcInternalError());
2056 Assert (
false, ExcNotImplemented());
2065 std::vector<unsigned int> &h2l)
2069 hierarchic_to_lexicographic_numbering<dim> (fe.
dofs_per_line+1, h2l);
2075 std::vector<unsigned int>
2080 hierarchic_to_lexicographic_numbering<dim> (fe.
dofs_per_line+1, h2l);
2087 std::vector<unsigned int> &l2h)
2095 std::vector<unsigned int>
2106 #include "fe_tools.inst" 2111 DEAL_II_NAMESPACE_CLOSE
Transformed quadrature weights.
static const unsigned int invalid_unsigned_int
#define AssertDimension(dim1, dim2)
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
const std::vector< Point< dim > > & get_generalized_support_points() const
static unsigned int face_to_cell_vertices(const unsigned int face, const unsigned int vertex, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
virtual void interpolate(std::vector< double > &local_dofs, const std::vector< double > &values) const
::ExceptionBase & ExcMessage(std::string arg1)
std::string trim(const std::string &input)
const unsigned int dofs_per_quad
static TableIndices< rank > unrolled_to_component_indices(const unsigned int i)
std::pair< int, unsigned int > get_integer_at_position(const std::string &name, const unsigned int position)
const unsigned int degree
const Point< dim > & point(const unsigned int i) const
bool has_generalized_support_points() const
void invert(const FullMatrix< number2 > &M)
ActiveSelector::active_cell_iterator active_cell_iterator
active_cell_iterator begin_active(const unsigned int level=0) const
Transformed quadrature points.
#define AssertThrow(cond, exc)
const unsigned int dofs_per_line
cell_iterator begin(const unsigned int level=0) const
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
unsigned int n_blocks() const
void vmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
cell_iterator end() const
const std::vector< Point< spacedim > > & get_quadrature_points() const
virtual void execute_coarsening_and_refinement()
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
const unsigned int first_quad_index
const double & shape_value(const unsigned int function_no, const unsigned int point_no) const
unsigned int global_dof_index
static unsigned int face_to_cell_lines(const unsigned int face, const unsigned int line, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
unsigned int element_multiplicity(const unsigned int index) const
static void project_to_subface(const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, std::vector< Point< dim > > &q_points, const RefinementCase< dim-1 > &ref_case=RefinementCase< dim-1 >::isotropic_refinement)
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no)
bool is_primitive(const unsigned int i) const
void mmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
std::vector< unsigned int > invert_permutation(const std::vector< unsigned int > &permutation)
unsigned int size() const
const unsigned int dofs_per_cell
const unsigned int n_quadrature_points
const std::vector< Point< dim > > & get_unit_support_points() const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
unsigned int n_components() const
std::pair< std::pair< unsigned int, unsigned int >, unsigned int > system_to_base_index(const unsigned int index) const
const std::vector< double > & get_JxW_values() const
std::pair< unsigned int, types::global_dof_index > system_to_block_index(const unsigned int component) const
double JxW(const unsigned int quadrature_point) const
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
bool conforms(const Conformity) const
void add(const number a, const FullMatrix< number2 > &A)
void hyper_cube(Triangulation< dim, spacedim > &tria, const double left=0., const double right=1., const bool colorize=false)
const unsigned int dofs_per_face
const unsigned int first_line_index
double least_squares(Vector< number2 > &dst, const Vector< number2 > &src) const
void refine_global(const unsigned int times=1)
const unsigned int dofs_per_vertex
unsigned int size(const unsigned int i) const
unsigned int n_base_elements() const
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell)
double weight(const unsigned int i) const
Task< RT > new_task(const std_cxx11::function< RT()> &function)
unsigned int tensor_degree() const