526 *
double return_value = 0.0;
532 * 2.0 * (2.0 - 12.0 * p[0] + 12.0 * p[0] * p[0]) *
533 * (2.0 - 12.0 * p[1] + 12.0 * p[1] * p[1]);
538 * p[2] * (1.0 - p[2])) +
540 * p[2] * (1.0 - p[2])) +
542 * p[1] * (1.0 - p[1])) +
543 * 2.0 * (2.0 - 12.0 * p[0] + 12.0 * p[0] * p[0]) *
544 * (2.0 - 12.0 * p[1] + 12.0 * p[1] * p[1]) *
546 * 2.0 * (2.0 - 12.0 * p[0] + 12.0 * p[0] * p[0]) *
547 * (2.0 - 12.0 * p[2] + 12.0 * p[2] * p[2]) *
549 * 2.0 * (2.0 - 12.0 * p[1] + 12.0 * p[1] * p[1]) *
550 * (2.0 - 12.0 * p[2] + 12.0 * p[2] * p[2]) *
556 *
return return_value;
563 * This
class implement the manufactured (exact) solution @f$u@f$. To compute the
564 * errors, we need the
value of @f$u@f$ as well as its
gradient and its Hessian.
568 *
class ExactSolution :
public Function<dim>
576 *
const unsigned int component = 0)
const override;
580 *
const unsigned int component = 0)
const override;
584 *
const unsigned int component = 0)
const override;
590 *
double ExactSolution<dim>::value(
const Point<dim> &p,
591 *
const unsigned int )
const
593 *
double return_value = 0.0;
603 * p[0] * (1.0 - p[0]) * p[1] * (1.0 - p[1]) * p[2] * (1.0 - p[2]));
608 *
return return_value;
615 * ExactSolution<dim>::gradient(
const Point<dim> &p,
616 *
const unsigned int )
const
622 * return_gradient[0] =
626 * return_gradient[1] =
633 * return_gradient[0] =
637 * return_gradient[1] =
641 * return_gradient[2] =
649 *
return return_gradient;
656 * ExactSolution<dim>::hessian(
const Point<dim> &p,
657 *
const unsigned int )
const
663 * return_hessian[0][0] = (2.0 - 12.0 * p[0] + 12.0 * p[0] * p[0]) *
665 * return_hessian[0][1] =
670 * return_hessian[1][1] = (2.0 - 12.0 * p[1] + 12.0 * p[1] * p[1]) *
675 * return_hessian[0][0] =
676 * (2.0 - 12.0 * p[0] + 12.0 * p[0] * p[0]) *
678 * return_hessian[0][1] =
684 * return_hessian[0][2] =
690 * return_hessian[1][1] =
691 * (2.0 - 12.0 * p[1] + 12.0 * p[1] * p[1]) *
693 * return_hessian[1][2] =
699 * return_hessian[2][2] =
700 * (2.0 - 12.0 * p[2] + 12.0 * p[2] * p[2]) *
706 *
return return_hessian;
714 * <a name=
"step_82-ImplementationofthecodeBiLaplacianLDGLiftcodeclass"></a>
715 * <h3>Implementation of the <code>BiLaplacianLDGLift</code>
class</h3>
720 * <a name=
"step_82-BiLaplacianLDGLiftBiLaplacianLDGLift"></a>
721 * <h4>BiLaplacianLDGLift::BiLaplacianLDGLift</h4>
725 * In the constructor, we
set the polynomial degree of the two finite element
726 * spaces, we associate the corresponding DoF handlers to the
triangulation,
727 * and we
set the two penalty coefficients.
731 * BiLaplacianLDGLift<dim>::BiLaplacianLDGLift(
const unsigned int n_refinements,
732 *
const unsigned int fe_degree,
733 *
const double penalty_jump_grad,
734 *
const double penalty_jump_val)
735 * : n_refinements(n_refinements)
739 * , penalty_jump_grad(penalty_jump_grad)
740 * , penalty_jump_val(penalty_jump_val)
748 * <a name=
"step_82-BiLaplacianLDGLiftmake_grid"></a>
749 * <h4>BiLaplacianLDGLift::make_grid</h4>
753 * To build a mesh
for @f$\Omega=(0,1)^d@f$, we simply call the function
755 * <code>refine_global</code>. The number of refinements is hard-coded
760 *
void BiLaplacianLDGLift<dim>::make_grid()
762 * std::cout <<
"Building the mesh............." << std::endl;
777 * <a name=
"step_82-BiLaplacianLDGLiftsetup_system"></a>
778 * <h4>BiLaplacianLDGLift::setup_system</h4>
782 * In the following function, we
set up the degrees of freedom, the sparsity
783 * pattern, the size of the
matrix @f$A@f$, and the size of the solution and
784 * right-hand side vectors
785 * @f$\boldsymbol{U}@f$ and @f$\boldsymbol{
F}@f$. For the sparsity pattern, we cannot
787 * (as we would
do for instance
for the SIPG method) because we need to take
788 * into account the interactions of a neighboring cell with another
789 * neighboring cell as described in the introduction. The extended sparsity
790 * pattern is built by iterating over all the active cells. For the current
791 * cell, we collect all its degrees of freedom as well as the degrees of
792 * freedom of all its neighboring cells, and then couple everything with
797 *
void BiLaplacianLDGLift<dim>::setup_system()
799 * dof_handler.distribute_dofs(fe);
801 * std::cout <<
"Number of degrees of freedom: " << dof_handler.n_dofs()
806 *
const auto dofs_per_cell = fe.dofs_per_cell;
808 *
for (
const auto &cell : dof_handler.active_cell_iterators())
810 *
std::vector<
types::global_dof_index> dofs(dofs_per_cell);
811 * cell->get_dof_indices(dofs);
813 *
for (
unsigned int f = 0; f < cell->n_faces(); ++f)
814 *
if (!cell->face(f)->at_boundary())
816 *
const auto neighbor_cell = cell->neighbor(f);
818 * std::vector<types::global_dof_index> tmp(dofs_per_cell);
819 * neighbor_cell->get_dof_indices(tmp);
821 * dofs.insert(std::end(dofs), std::begin(tmp), std::end(tmp));
824 *
for (
const auto i : dofs)
825 * for (const auto j : dofs)
832 * sparsity_pattern.copy_from(dsp);
835 *
matrix.reinit(sparsity_pattern);
836 * rhs.reinit(dof_handler.n_dofs());
838 * solution.reinit(dof_handler.n_dofs());
842 * At the
end of the function, we output
this sparsity pattern as
843 * a scalable vector graphic. You can visualize it by loading
this
844 * file in most web browsers:
847 * std::ofstream out(
"sparsity-pattern.svg");
848 * sparsity_pattern.print_svg(out);
856 * <a name=
"step_82-BiLaplacianLDGLiftassemble_system"></a>
857 * <h4>BiLaplacianLDGLift::assemble_system</h4>
861 * This function simply calls the two
functions responsible
862 *
for the assembly of the
matrix and the right-hand side.
866 *
void BiLaplacianLDGLift<dim>::assemble_system()
868 * std::cout <<
"Assembling the system............." << std::endl;
873 * std::cout <<
"Done. " << std::endl;
881 * <a name=
"step_82-BiLaplacianLDGLiftassemble_matrix"></a>
882 * <h4>BiLaplacianLDGLift::assemble_matrix</h4>
886 * This function assembles the
matrix @f$A@f$ whose entries are defined
887 * by @f$A_{ij}=A_h(\varphi_j,\varphi_i)@f$ which involves the product of
888 * discrete Hessians and the penalty terms.
892 *
void BiLaplacianLDGLift<dim>::assemble_matrix()
897 *
const QGauss<dim - 1> quad_face(fe.degree + 1);
899 *
const unsigned int n_q_points = quad.size();
900 *
const unsigned int n_q_points_face = quad_face.size();
910 *
const unsigned int n_dofs = fe_values.dofs_per_cell;
912 * std::vector<types::global_dof_index> local_dof_indices(n_dofs);
913 * std::vector<types::global_dof_index> local_dof_indices_neighbor(n_dofs);
914 * std::vector<types::global_dof_index> local_dof_indices_neighbor_2(n_dofs);
918 * As indicated in the introduction, the following matrices are used
for
919 * the contributions of the products of the discrete Hessians.
937 * The following matrices are used
for the contributions of the two
949 * std::vector<std::vector<Tensor<2, dim>>> discrete_hessians(
951 * std::vector<std::vector<std::vector<Tensor<2, dim>>>>
953 * discrete_hessians);
955 *
for (
const auto &cell : dof_handler.active_cell_iterators())
958 * cell->get_dof_indices(local_dof_indices);
962 * We now compute all the discrete Hessians that are not vanishing
963 * on the current cell, i.e., the discrete Hessian of all the basis
964 *
functions with support on the current cell or on one of its
968 * compute_discrete_hessians(cell,
970 * discrete_hessians_neigh);
974 * First, we compute and add the interactions of the degrees of freedom
975 * of the current cell.
978 * stiffness_matrix_cc = 0;
979 *
for (
unsigned int q = 0; q < n_q_points; ++q)
981 *
const double dx = fe_values.JxW(q);
983 *
for (
unsigned int i = 0; i < n_dofs; ++i)
984 *
for (
unsigned int j = 0; j < n_dofs; ++j)
989 * stiffness_matrix_cc(i, j) += scalar_product(H_j, H_i) *
dx;
993 *
for (
unsigned int i = 0; i < n_dofs; ++i)
994 *
for (
unsigned int j = 0; j < n_dofs; ++j)
996 *
matrix(local_dof_indices[i], local_dof_indices[j]) +=
997 * stiffness_matrix_cc(i, j);
1002 * Next, we compute and add the interactions of the degrees of freedom
1003 * of the current cell with those of its neighbors. Note that the
1004 * interactions of the degrees of freedom of a neighbor with those of
1005 * the same neighbor are included here.
1008 *
for (
unsigned int face_no = 0; face_no < cell->n_faces(); ++face_no)
1011 * cell->face(face_no);
1013 *
const bool at_boundary = face->at_boundary();
1018 * There is
nothing to be done
if boundary face (the liftings of
1019 * the Dirichlet BCs are accounted
for in the assembly of the
1020 * RHS; in fact,
nothing to be done in
this program since we
1021 * prescribe homogeneous BCs).
1028 * neighbor_cell = cell->neighbor(face_no);
1029 * neighbor_cell->get_dof_indices(local_dof_indices_neighbor);
1031 * stiffness_matrix_cn = 0;
1032 * stiffness_matrix_nc = 0;
1033 * stiffness_matrix_nn = 0;
1034 *
for (
unsigned int q = 0; q < n_q_points; ++q)
1036 *
const double dx = fe_values.JxW(q);
1038 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1040 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1046 * discrete_hessians_neigh[face_no][i][q];
1048 * discrete_hessians_neigh[face_no][j][q];
1050 * stiffness_matrix_cn(i, j) +=
1051 * scalar_product(H_j_neigh, H_i) *
dx;
1052 * stiffness_matrix_nc(i, j) +=
1053 * scalar_product(H_j, H_i_neigh) *
dx;
1054 * stiffness_matrix_nn(i, j) +=
1055 * scalar_product(H_j_neigh, H_i_neigh) *
dx;
1060 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1062 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1064 *
matrix(local_dof_indices[i],
1065 * local_dof_indices_neighbor[j]) +=
1066 * stiffness_matrix_cn(i, j);
1067 *
matrix(local_dof_indices_neighbor[i],
1068 * local_dof_indices[j]) +=
1069 * stiffness_matrix_nc(i, j);
1070 *
matrix(local_dof_indices_neighbor[i],
1071 * local_dof_indices_neighbor[j]) +=
1072 * stiffness_matrix_nn(i, j);
1081 * We now compute and add the interactions of the degrees of freedom of
1082 * a neighboring cells with those of another neighboring cell (
this is
1083 * where we need the extended sparsity pattern).
1086 *
for (
unsigned int face_no = 0; face_no < cell->n_faces() - 1; ++face_no)
1089 * cell->face(face_no);
1091 *
const bool at_boundary = face->at_boundary();
1096 * Dirichlet BCs are accounted
for in the assembly of the RHS;
1097 * in fact,
nothing to be done in
this program since we
1098 * prescribe homogeneous BCs)
1107 *
for (
unsigned int face_no_2 = face_no + 1;
1108 * face_no_2 < cell->n_faces();
1112 * cell->face(face_no_2);
1114 *
const bool at_boundary_2 = face_2->at_boundary();
1115 *
if (!at_boundary_2)
1118 * neighbor_cell = cell->neighbor(face_no);
1119 * neighbor_cell->get_dof_indices(
1120 * local_dof_indices_neighbor);
1122 * neighbor_cell_2 = cell->neighbor(face_no_2);
1123 * neighbor_cell_2->get_dof_indices(
1124 * local_dof_indices_neighbor_2);
1126 * stiffness_matrix_n1n2 = 0;
1127 * stiffness_matrix_n2n1 = 0;
1129 *
for (
unsigned int q = 0; q < n_q_points; ++q)
1131 *
const double dx = fe_values.JxW(q);
1133 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1134 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1137 * discrete_hessians_neigh[face_no][i][q];
1139 * discrete_hessians_neigh[face_no][j][q];
1142 * discrete_hessians_neigh[face_no_2][i][q];
1144 * discrete_hessians_neigh[face_no_2][j][q];
1146 * stiffness_matrix_n1n2(i, j) +=
1147 * scalar_product(H_j_neigh2, H_i_neigh) *
dx;
1148 * stiffness_matrix_n2n1(i, j) +=
1149 * scalar_product(H_j_neigh, H_i_neigh2) *
dx;
1153 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1154 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1156 *
matrix(local_dof_indices_neighbor[i],
1157 * local_dof_indices_neighbor_2[j]) +=
1158 * stiffness_matrix_n1n2(i, j);
1159 *
matrix(local_dof_indices_neighbor_2[i],
1160 * local_dof_indices_neighbor[j]) +=
1161 * stiffness_matrix_n2n1(i, j);
1171 * Finally, we compute and add the two penalty terms.
1174 *
for (
unsigned int face_no = 0; face_no < cell->n_faces(); ++face_no)
1177 * cell->face(face_no);
1179 *
const double mesh_inv = 1.0 / face->diameter();
1180 *
const double mesh3_inv =
1183 * fe_face.reinit(cell, face_no);
1187 *
const bool at_boundary = face->at_boundary();
1190 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1192 *
const double dx = fe_face.JxW(q);
1194 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1195 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1197 * ip_matrix_cc(i, j) += penalty_jump_grad * mesh_inv *
1198 * fe_face.shape_grad(j, q) *
1199 * fe_face.shape_grad(i, q) *
dx;
1200 * ip_matrix_cc(i, j) += penalty_jump_val * mesh3_inv *
1201 * fe_face.shape_value(j, q) *
1202 * fe_face.shape_value(i, q) *
dx;
1210 * neighbor_cell = cell->neighbor(face_no);
1211 *
const unsigned int face_no_neighbor =
1212 * cell->neighbor_of_neighbor(face_no);
1216 * In the next step, we need to have a global way to compare the
1217 * cells in order to not calculate the same jump term twice:
1220 *
if (neighbor_cell->id() < cell->id())
1224 * fe_face_neighbor.reinit(neighbor_cell, face_no_neighbor);
1225 * neighbor_cell->get_dof_indices(local_dof_indices_neighbor);
1231 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1233 *
const double dx = fe_face.JxW(q);
1235 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1237 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1239 * ip_matrix_cc(i, j) +=
1240 * penalty_jump_grad * mesh_inv *
1241 * fe_face.shape_grad(j, q) *
1242 * fe_face.shape_grad(i, q) *
dx;
1243 * ip_matrix_cc(i, j) +=
1244 * penalty_jump_val * mesh3_inv *
1245 * fe_face.shape_value(j, q) *
1246 * fe_face.shape_value(i, q) *
dx;
1248 * ip_matrix_cn(i, j) -=
1249 * penalty_jump_grad * mesh_inv *
1250 * fe_face_neighbor.shape_grad(j, q) *
1251 * fe_face.shape_grad(i, q) *
dx;
1252 * ip_matrix_cn(i, j) -=
1253 * penalty_jump_val * mesh3_inv *
1254 * fe_face_neighbor.shape_value(j, q) *
1255 * fe_face.shape_value(i, q) *
dx;
1257 * ip_matrix_nc(i, j) -=
1258 * penalty_jump_grad * mesh_inv *
1259 * fe_face.shape_grad(j, q) *
1260 * fe_face_neighbor.shape_grad(i, q) *
dx;
1261 * ip_matrix_nc(i, j) -=
1262 * penalty_jump_val * mesh3_inv *
1263 * fe_face.shape_value(j, q) *
1264 * fe_face_neighbor.shape_value(i, q) *
dx;
1266 * ip_matrix_nn(i, j) +=
1267 * penalty_jump_grad * mesh_inv *
1268 * fe_face_neighbor.shape_grad(j, q) *
1269 * fe_face_neighbor.shape_grad(i, q) *
dx;
1270 * ip_matrix_nn(i, j) +=
1271 * penalty_jump_val * mesh3_inv *
1272 * fe_face_neighbor.shape_value(j, q) *
1273 * fe_face_neighbor.shape_value(i, q) *
dx;
1281 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1283 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1285 *
matrix(local_dof_indices[i], local_dof_indices[j]) +=
1286 * ip_matrix_cc(i, j);
1292 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1294 *
for (
unsigned int j = 0; j < n_dofs; ++j)
1296 *
matrix(local_dof_indices[i],
1297 * local_dof_indices_neighbor[j]) +=
1298 * ip_matrix_cn(i, j);
1299 *
matrix(local_dof_indices_neighbor[i],
1300 * local_dof_indices[j]) += ip_matrix_nc(i, j);
1301 *
matrix(local_dof_indices_neighbor[i],
1302 * local_dof_indices_neighbor[j]) +=
1303 * ip_matrix_nn(i, j);
1317 * <a name=
"step_82-BiLaplacianLDGLiftassemble_rhs"></a>
1318 * <h4>BiLaplacianLDGLift::assemble_rhs</h4>
1322 * This function
assemble the right-hand side of the system. Since we consider
1323 * homogeneous Dirichlet boundary conditions, imposed weakly in the bilinear
1324 * form
using the Nitsche approach, it only involves the contribution of the
1325 * forcing term @f$\int_{\Omega}fv_h@f$.
1328 *
template <
int dim>
1329 *
void BiLaplacianLDGLift<dim>::assemble_rhs()
1337 *
const unsigned int n_dofs = fe_values.dofs_per_cell;
1338 *
const unsigned int n_quad_pts = quad.size();
1340 *
const RightHandSide<dim> right_hand_side;
1343 * std::vector<types::global_dof_index> local_dof_indices(n_dofs);
1345 *
for (
const auto &cell : dof_handler.active_cell_iterators())
1347 * fe_values.
reinit(cell);
1348 * cell->get_dof_indices(local_dof_indices);
1351 *
for (
unsigned int q = 0; q < n_quad_pts; ++q)
1353 *
const double dx = fe_values.JxW(q);
1355 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1358 * right_hand_side.value(fe_values.quadrature_point(q)) *
1359 * fe_values.shape_value(i, q) *
dx;
1363 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1364 * rhs(local_dof_indices[i]) += local_rhs(i);
1373 * <a name=
"step_82-BiLaplacianLDGLiftsolve"></a>
1374 * <h4>BiLaplacianLDGLift::solve</h4>
1378 * To solve the linear system @f$A\boldsymbol{U}=\boldsymbol{
F}@f$,
1379 * we proceed as in @ref step_74
"step-74" and use a direct method. We could
1380 * as well use an iterative method,
for instance the conjugate
1381 *
gradient method as in @ref step_3
"step-3".
1384 *
template <
int dim>
1385 *
void BiLaplacianLDGLift<dim>::solve()
1389 * A_direct.vmult(solution, rhs);
1397 * <a name=
"step_82-BiLaplacianLDGLiftcompute_errors"></a>
1398 * <h4>BiLaplacianLDGLift::compute_errors</h4>
1402 * This function computes the discrete @f$H^2@f$, @f$H^1@f$ and @f$L^2@f$ norms of
1403 * the error @f$u-u_h@f$, where @f$u@f$ is the exact solution and @f$u_h@f$ is
1404 * the
approximate solution. See the introduction
for the definition
1408 *
template <
int dim>
1409 *
void BiLaplacianLDGLift<dim>::compute_errors()
1411 *
double error_H2 = 0;
1412 *
double error_H1 = 0;
1413 *
double error_L2 = 0;
1416 *
const QGauss<dim - 1> quad_face(fe.degree + 1);
1432 *
const unsigned int n_q_points = quad.size();
1433 *
const unsigned int n_q_points_face = quad_face.size();
1437 * We introduce some variables
for the exact solution...
1440 *
const ExactSolution<dim> u_exact;
1447 * std::vector<double> solution_values_cell(n_q_points);
1448 * std::vector<Tensor<1, dim>> solution_gradients_cell(n_q_points);
1449 * std::vector<Tensor<2, dim>> solution_hessians_cell(n_q_points);
1451 * std::vector<double> solution_values(n_q_points_face);
1452 * std::vector<double> solution_values_neigh(n_q_points_face);
1453 * std::vector<Tensor<1, dim>> solution_gradients(n_q_points_face);
1454 * std::vector<Tensor<1, dim>> solution_gradients_neigh(n_q_points_face);
1456 *
for (
const auto &cell : dof_handler.active_cell_iterators())
1458 * fe_values.
reinit(cell);
1460 * fe_values.get_function_values(solution, solution_values_cell);
1461 * fe_values.get_function_gradients(solution, solution_gradients_cell);
1462 * fe_values.get_function_hessians(solution, solution_hessians_cell);
1466 * We
first add the <i>bulk</i> terms.
1469 *
for (
unsigned int q = 0; q < n_q_points; ++q)
1471 *
const double dx = fe_values.JxW(q);
1473 * error_H2 += (u_exact.hessian(fe_values.quadrature_point(q)) -
1474 * solution_hessians_cell[q])
1477 * error_H1 += (u_exact.gradient(fe_values.quadrature_point(q)) -
1478 * solution_gradients_cell[q])
1482 * u_exact.value(fe_values.quadrature_point(q)) -
1483 * solution_values_cell[q]) *
1489 * We then add the face contributions.
1492 *
for (
unsigned int face_no = 0; face_no < cell->n_faces(); ++face_no)
1495 * cell->face(face_no);
1497 *
const double mesh_inv = 1.0 / face->diameter();
1498 *
const double mesh3_inv =
1501 * fe_face.reinit(cell, face_no);
1503 * fe_face.get_function_values(solution, solution_values);
1504 * fe_face.get_function_gradients(solution, solution_gradients);
1506 *
const bool at_boundary = face->at_boundary();
1509 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1511 *
const double dx = fe_face.JxW(q);
1512 *
const double u_exact_q =
1513 * u_exact.value(fe_face.quadrature_point(q));
1515 * u_exact.gradient(fe_face.quadrature_point(q));
1519 * (u_exact_grad_q - solution_gradients[q]).
norm_square() *
1521 * error_H2 += mesh3_inv *
1523 * solution_values[q]) *
1525 * error_H1 += mesh_inv *
1527 * solution_values[q]) *
1535 * neighbor_cell = cell->neighbor(face_no);
1536 *
const unsigned int face_no_neighbor =
1537 * cell->neighbor_of_neighbor(face_no);
1541 * In the next step, we need to have a global way to compare the
1542 * cells in order to not calculate the same jump term twice:
1545 *
if (neighbor_cell->id() < cell->id())
1549 * fe_face_neighbor.reinit(neighbor_cell, face_no_neighbor);
1551 * fe_face.get_function_values(solution, solution_values);
1552 * fe_face_neighbor.get_function_values(solution,
1553 * solution_values_neigh);
1554 * fe_face.get_function_gradients(solution,
1555 * solution_gradients);
1556 * fe_face_neighbor.get_function_gradients(
1557 * solution, solution_gradients_neigh);
1559 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1561 *
const double dx = fe_face.JxW(q);
1565 * To compute the jump term, we use the fact that
1566 * @f$\jump{u}=0@f$ and
1567 * @f$\jump{\nabla u}=\mathbf{0}@f$ since @f$u\in
1573 * (solution_gradients_neigh[q] - solution_gradients[q])
1579 * solution_values[q]) *
1584 * solution_values[q]) *
1599 * std::cout <<
"DG H2 norm of the error: " << error_H2 << std::endl;
1600 * std::cout <<
"DG H1 norm of the error: " << error_H1 << std::endl;
1601 * std::cout <<
" L2 norm of the error: " << error_L2 << std::endl;
1609 * <a name=
"step_82-BiLaplacianLDGLiftoutput_results"></a>
1610 * <h4>BiLaplacianLDGLift::output_results</h4>
1614 * This function, which writes the solution to a
vtk file,
1615 * is copied from @ref step_3
"step-3".
1618 *
template <
int dim>
1619 *
void BiLaplacianLDGLift<dim>::output_results() const
1623 * data_out.add_data_vector(solution,
"solution");
1624 * data_out.build_patches();
1626 * std::ofstream output(
"solution.vtk");
1627 * data_out.write_vtk(output);
1635 * <a name=
"step_82-BiLaplacianLDGLiftassemble_local_matrix"></a>
1636 * <h4>BiLaplacianLDGLift::assemble_local_matrix</h4>
1640 * As already mentioned above,
this function is used to
assemble
1641 * the (local) mass matrices needed
for the computations of the
1642 * lifting terms. We reiterate that only the basis
functions with
1643 * support on the current cell are considered.
1646 *
template <
int dim>
1647 *
void BiLaplacianLDGLift<dim>::assemble_local_matrix(
1649 *
const unsigned int n_q_points,
1654 *
const unsigned int n_dofs = fe_values_lift.dofs_per_cell;
1657 *
for (
unsigned int q = 0; q < n_q_points; ++q)
1659 *
const double dx = fe_values_lift.JxW(q);
1661 *
for (
unsigned int m = 0; m < n_dofs; ++m)
1662 *
for (
unsigned int n = 0; n < n_dofs; ++n)
1664 * local_matrix(m, n) +=
1665 * scalar_product(fe_values_lift[tau_ext].
value(n, q),
1666 * fe_values_lift[tau_ext].
value(m, q)) *
1677 * <a name=
"step_82-BiLaplacianLDGLiftcompute_discrete_hessians"></a>
1678 * <h4>BiLaplacianLDGLift::compute_discrete_hessians</h4>
1682 * This function is the main novelty of
this program. It computes
1683 * the discrete Hessian @f$H_h(\varphi)@f$
for all the basis
functions
1684 * @f$\varphi@f$ of @f$\mathbb{V}_h@f$ supported on the current cell and
1685 * those supported on a neighboring cell. The
first argument
1686 * indicates the current cell (referring to the global
DoFHandler
1687 *
object),
while the other two arguments are output variables that
1688 * are filled by
this function.
1692 * In the following, we need to evaluate finite element shape
1693 *
functions for the `fe_lift` finite element on the current
1694 * cell. Like
for example in @ref step_61
"step-61",
this "lift" space is defined
1695 * on every cell individually; as a consequence, there is no global
1696 *
DoFHandler associated with
this because we simply have no need
1697 *
for such a
DoFHandler. That leaves the question of what we should
1699 * them to evaluate shape
functions of `fe_lift` on a concrete
1700 * cell. If we simply provide the
first argument to
this function,
1702 * that the given `cell` belongs to a
DoFHandler that has a
1703 * different finite element associated with it than the `fe_lift`
1704 *
object we want to evaluate. Fortunately, there is a relatively
1706 * points into a
triangulation -- the same cell, but not associated
1707 * with a
DoFHandler, and consequently no finite element space. In
1708 * that case,
FEValues::reinit() will skip the check that would
1709 * otherwise lead to an error message. All we have to do is to convert
1711 * see the
first couple of lines of the function below to see how
1715 * template <
int dim>
1716 *
void BiLaplacianLDGLift<dim>::compute_discrete_hessians(
1717 * const typename
DoFHandler<dim>::active_cell_iterator &cell,
1718 *
std::vector<
std::vector<
Tensor<2, dim>>> &discrete_hessians,
1720 * &discrete_hessians_neigh)
1726 *
const QGauss<dim - 1> quad_face(
fe.degree + 1);
1728 *
const unsigned int n_q_points = quad.size();
1729 *
const unsigned int n_q_points_face = quad_face.size();
1733 * The information we need from the basis
functions of
1734 * @f$\mathbb{V}_h@f$: <code>fe_values</code> is needed to add
1735 * the broken Hessian part of the discrete Hessian,
while
1736 * <code>fe_face</code> and <code>fe_face_neighbor</code>
1737 * are used to compute the right-hand sides
for the local
1749 *
const unsigned int n_dofs = fe_values.dofs_per_cell;
1753 * The information needed from the basis
functions
1754 * of the finite element space
for the lifting terms:
1755 * <code>fe_values_lift</code> is used
for the (local)
1756 * mass
matrix (see @f$\boldsymbol{M}_c@f$ in the introduction),
1757 * while <code>fe_face_lift</code> is used to compute the
1758 * right-hand sides (see @f$\boldsymbol{G}_c@f$
for @f$b_e@f$).
1770 *
const unsigned int n_dofs_lift = fe_values_lift.dofs_per_cell;
1773 *
Vector<double> local_rhs_re(n_dofs_lift), local_rhs_be(n_dofs_lift),
1774 * coeffs_re(n_dofs_lift), coeffs_be(n_dofs_lift), coeffs_tmp(n_dofs_lift);
1779 *
double factor_avg;
1781 * fe_values.reinit(cell);
1782 * fe_values_lift.reinit(cell_lift);
1786 * We start by assembling the (local) mass
matrix used
for the computation
1787 * of the lifting terms @f$r_e@f$ and @f$b_e@f$.
1790 * assemble_local_matrix(fe_values_lift, n_q_points, local_matrix_lift);
1792 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1793 *
for (
unsigned int q = 0; q < n_q_points; ++q)
1795 * discrete_hessians[i][q] = 0;
1797 *
for (
unsigned int face_no = 0;
1798 * face_no < discrete_hessians_neigh.size();
1801 * discrete_hessians_neigh[face_no][i][q] = 0;
1808 * @f$x_q@f$ of <code>cell</code>
for each basis function supported on
1809 * <code>cell</code>, namely we fill-in the variable
1810 * <code>discrete_hessians[i][q]</code>. For the lifting terms, we need to
1811 * add the contribution of all the faces of <code>cell</code>.
1814 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1819 *
for (
unsigned int face_no = 0; face_no < cell->n_faces(); ++face_no)
1822 * cell->face(face_no);
1824 *
const bool at_boundary = face->at_boundary();
1828 * Recall that by convention, the average of a function across a
1829 * boundary face @f$e@f$ reduces to the
trace of the function on the
1830 * only element adjacent to @f$e@f$, namely there is no factor
1831 * @f$\frac{1}{2}@f$. We distinguish between the two cases (the current
1832 * face lies in the interior or on the boundary of the domain)
using
1833 * the variable <code>factor_avg</code>.
1842 * fe_face.reinit(cell, face_no);
1843 * fe_face_lift.reinit(cell_lift, face_no);
1846 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1848 *
const double dx = fe_face_lift.JxW(q);
1852 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
1854 * local_rhs_re(m) +=
1856 * (fe_face_lift[tau_ext].
value(m, q) * normal) *
1857 * fe_face.shape_grad(i, q) *
dx;
1863 * Here, <code>local_rhs_be(m)</code> corresponds to @f$G_m@f$
1864 * introduced in the comments about the implementation of the
1865 * lifting @f$b_e@f$ in the
case
1866 * @f$\varphi=\varphi^c@f$.
1870 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1872 *
const double dx = fe_face_lift.JxW(q);
1876 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
1878 * local_rhs_be(m) += factor_avg *
1879 * fe_face_lift[tau_ext].divergence(m, q) *
1880 * normal * fe_face.shape_value(i, q) *
dx;
1885 * solver.solve(local_matrix_lift,
1889 * coeffs_re += coeffs_tmp;
1892 * solver.solve(local_matrix_lift,
1896 * coeffs_be += coeffs_tmp;
1900 *
for (
unsigned int q = 0; q < n_q_points; ++q)
1902 * discrete_hessians[i][q] += fe_values.shape_hessian(i, q);
1904 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
1906 * discrete_hessians[i][q] -=
1907 * coeffs_re[m] * fe_values_lift[tau_ext].value(m, q);
1910 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
1912 * discrete_hessians[i][q] +=
1913 * coeffs_be[m] * fe_values_lift[tau_ext].value(m, q);
1923 * @f$x_q@f$ of <code>cell</code>
for each basis function supported on a
1924 * neighboring <code>neighbor_cell</code> of <code>cell</code>, namely we
1925 * fill-in the variable <code>discrete_hessians_neigh[face_no][i][q]</code>.
1926 * For the lifting terms, we only need to add the contribution of the
1927 * face adjacent to <code>cell</code> and <code>neighbor_cell</code>.
1930 *
for (
unsigned int face_no = 0; face_no < cell->n_faces(); ++face_no)
1933 * cell->face(face_no);
1935 *
const bool at_boundary = face->at_boundary();
1941 * For non-homogeneous Dirichlet BCs, we would need to
1942 * compute the lifting of the prescribed BC (see the
1943 *
"Possible Extensions" section
for more details).
1950 * neighbor_cell = cell->neighbor(face_no);
1951 *
const unsigned int face_no_neighbor =
1952 * cell->neighbor_of_neighbor(face_no);
1953 * fe_face_neighbor.reinit(neighbor_cell, face_no_neighbor);
1955 *
for (
unsigned int i = 0; i < n_dofs; ++i)
1960 * fe_face_lift.reinit(cell_lift, face_no);
1963 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1965 *
const double dx = fe_face_lift.JxW(q);
1967 * fe_face_neighbor.normal_vector(q);
1969 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
1971 * local_rhs_re(m) +=
1972 * 0.5 * (fe_face_lift[tau_ext].value(m, q) * normal) *
1973 * fe_face_neighbor.shape_grad(i, q) *
dx;
1979 * Here, <code>local_rhs_be(m)</code> corresponds to @f$G_m@f$
1980 * introduced in the comments about the implementation of the
1981 * lifting @f$b_e@f$ in the
case
1982 * @f$\varphi=\varphi^n@f$.
1986 *
for (
unsigned int q = 0; q < n_q_points_face; ++q)
1988 *
const double dx = fe_face_lift.JxW(q);
1990 * fe_face_neighbor.normal_vector(q);
1992 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
1994 * local_rhs_be(m) +=
1995 * 0.5 * fe_face_lift[tau_ext].divergence(m, q) *
1996 * normal * fe_face_neighbor.shape_value(i, q) *
dx;
2000 * solver.solve(local_matrix_lift,
2004 * solver.solve(local_matrix_lift,
2009 *
for (
unsigned int q = 0; q < n_q_points; ++q)
2011 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
2013 * discrete_hessians_neigh[face_no][i][q] -=
2014 * coeffs_re[m] * fe_values_lift[tau_ext].value(m, q);
2017 *
for (
unsigned int m = 0; m < n_dofs_lift; ++m)
2019 * discrete_hessians_neigh[face_no][i][q] +=
2020 * coeffs_be[m] * fe_values_lift[tau_ext].value(m, q);
2034 * <a name=
"step_82-BiLaplacianLDGLiftrun"></a>
2035 * <h4>BiLaplacianLDGLift::run</h4>
2038 *
template <
int dim>
2039 *
void BiLaplacianLDGLift<dim>::run()
2044 * assemble_system();
2059 * <a name=
"step_82-Thecodemaincodefunction"></a>
2060 * <h3>The <code>main</code> function</h3>
2064 * This is the <code>main</code> function. We define here the number of mesh
2065 * refinements, the polynomial degree
for the two finite element spaces
2066 * (
for the solution and the two liftings) and the two penalty coefficients.
2067 * We can also change the dimension to run the code in 3
d.
2074 *
const unsigned int n_ref = 3;
2076 *
const unsigned int degree =
2079 *
const double penalty_grad =
2081 *
const double penalty_val =
2084 * Step82::BiLaplacianLDGLift<2> problem(n_ref,
2091 *
catch (std::exception &exc)
2093 * std::cerr << std::endl
2095 * <<
"----------------------------------------------------"
2097 * std::cerr <<
"Exception on processing: " << std::endl
2098 * << exc.what() << std::endl
2099 * <<
"Aborting!" << std::endl
2100 * <<
"----------------------------------------------------"
2106 * std::cerr << std::endl
2108 * <<
"----------------------------------------------------"
2110 * std::cerr <<
"Unknown exception!" << std::endl
2111 * <<
"Aborting!" << std::endl
2112 * <<
"----------------------------------------------------"
2120<a name=
"step_82-Results"></a><h1>Results</h1>
2124When running the program, the sparsity pattern is written to an
svg file, the solution is written to a
vtk file, and some results are printed to the console. With the current setup, the output should read
2128Number of active cells: 64
2129Number of degrees of freedom: 576
2130Assembling the system.............
2132DG H2
norm of the error: 0.0151063
2133DG H1
norm of the error: 0.000399747
2134 L2 norm of the error: 5.33856e-05
2138This corresponds to the bi-Laplacian problem with the manufactured solution mentioned above
for @f$d=2@f$, 3 refinements of the mesh, degree @f$k=2@f$, and @f$\gamma_0=\gamma_1=1@f$
for the penalty coefficients. By changing the number of refinements, we get the following results:
2140<table align=
"center" class=
"doxtable">
2153 <td align=
"center">1</td>
2154 <td align=
"right">4</td>
2155 <td align=
"right">36</td>
2156 <td align=
"center">5.651e-02</td>
2157 <td align=
"center">--</td>
2158 <td align=
"center">3.366e-03</td>
2159 <td align=
"center">--</td>
2160 <td align=
"center">3.473e-04</td>
2161 <td align=
"center">--</td>
2164 <td align=
"center">2</td>
2165 <td align=
"right">16</td>
2166 <td align=
"right">144</td>
2167 <td align=
"center">3.095e-02</td>
2168 <td align=
"center">0.87</td>
2169 <td align=
"center">1.284e-03</td>
2170 <td align=
"center">1.39</td>
2171 <td align=
"center">1.369e-04</td>
2172 <td align=
"center">1.34</td>
2175 <td align=
"center">3</td>
2176 <td align=
"right">64</td>
2177 <td align=
"right">576</td>
2178 <td align=
"center">1.511e-02</td>
2179 <td align=
"center">1.03</td>
2180 <td align=
"center">3.997e-04</td>
2181 <td align=
"center">1.68</td>
2182 <td align=
"center">5.339e-05</td>
2183 <td align=
"center">1.36</td>
2186 <td align=
"center">4</td>
2187 <td align=
"right">256</td>
2188 <td align=
"right">2304</td>
2189 <td align=
"center">7.353e-03</td>
2190 <td align=
"center">1.04</td>
2191 <td align=
"center">1.129e-04</td>
2192 <td align=
"center">1.82</td>
2193 <td align=
"center">1.691e-05</td>
2194 <td align=
"center">1.66</td>
2197 <td align=
"center">5</td>
2198 <td align=
"right">1024</td>
2199 <td align=
"right">9216</td>
2200 <td align=
"center">3.609e-03</td>
2201 <td align=
"center">1.03</td>
2202 <td align=
"center">3.024e-05</td>
2203 <td align=
"center">1.90</td>
2204 <td align=
"center">4.789e-06</td>
2205 <td align=
"center">1.82</td>
2208 <td align=
"center">6</td>
2209 <td align=
"right">4096</td>
2210 <td align=
"right">36864</td>
2211 <td align=
"center">1.785e-03</td>
2212 <td align=
"center">1.02</td>
2213 <td align=
"center">7.850e-06</td>
2214 <td align=
"center">1.95</td>
2215 <td align=
"center">1.277e-06</td>
2216 <td align=
"center">1.91</td>
2220This matches the expected optimal convergence rates
for the @f$H^2@f$ and
2221@f$H^1@f$ norms, but is sub-optimal
for the @f$L_2@f$
norm. Incidentally,
this
2222also matches the results seen in @ref step_47
"step-47" when
using polynomial degree
2225Indeed, just like in @ref step_47
"step-47", we can regain the optimal convergence
2226order
if we
set the polynomial degree of the finite elements to @f$k=3@f$
2227or higher. Here are the
numbers for @f$k=3@f$:
2229<table align=
"center" class=
"doxtable">
2230 <tr> <th> n_ref </th> <th>
n_cells </th> <th> n_dofs </th> <th> error H2 </th> <th> rate </th> <th> error H1 </th> <th> rate </th> <th> error
L2 </th> <th> rate</th> </tr>
2231 <tr> <td> 1 </td> <td> 4 </td> <td> 36 </td> <td> 1.451e-02 </td> <td> -- </td> <td> 5.494e-04 </td> <td> -- </td> <td> 3.035e-05 </td> <td> --</td> </tr>
2232 <tr> <td> 2 </td> <td> 16 </td> <td> 144 </td> <td> 3.565e-03 </td> <td> 2.02 </td> <td> 6.870e-05 </td> <td> 3.00 </td> <td> 2.091e-06 </td> <td> 3.86</td> </tr>
2233 <tr> <td> 3 </td> <td> 64 </td> <td> 576 </td> <td> 8.891e-04 </td> <td> 2.00 </td> <td> 8.584e-06 </td> <td> 3.00 </td> <td> 1.352e-07 </td> <td> 3.95</td> </tr>
2234 <tr> <td> 4 </td> <td> 256 </td> <td> 2304 </td> <td> 2.223e-04 </td> <td> 2.00 </td> <td> 1.073e-06 </td> <td> 3.00 </td> <td> 8.594e-09 </td> <td> 3.98</td> </tr>
2235 <tr> <td> 5 </td> <td> 1024 </td> <td> 9216 </td> <td> 5.560e-05 </td> <td> 2.00 </td> <td> 1.341e-07 </td> <td> 3.00 </td> <td> 5.418e-10 </td> <td> 3.99</td> </tr>
2236 <tr> <td> 6 </td> <td> 4096 </td> <td> 36864 </td> <td> 1.390e-05 </td> <td> 2.00 </td> <td> 1.676e-08 </td> <td> 3.00 </td> <td> 3.245e-11 </td> <td> 4.06</td> </tr>
2240<a name=
"step_82-Possibleextensions"></a><h3>Possible extensions</h3>
2243The code can be easily adapted to deal with the following cases:
2246 <li>Non-homogeneous Dirichlet boundary conditions on (part of) the boundary @f$\partial \Omega@f$ of @f$\Omega@f$.</li>
2247 <li>Hanging-nodes (proceed as in @ref step_14
"step-14" to not visit a sub-face twice when computing the lifting terms in <code>compute_discrete_hessians</code> and the penalty terms in <code>assemble_matrix</code>).</li>
2248 <li>LDG method
for the Poisson problem (use the discrete gradient consisting of the broken gradient and the lifting of the jump of @f$u_h@f$).</li>
2251We give below additional details
for the
first of these points.
2254<a name=
"step_82-NonhomogeneousDirichletboundaryconditions"></a><h4>Non-homogeneous Dirichlet boundary conditions</h4>
2256If we prescribe non-homogeneous Dirichlet conditions, say
2258\nabla u=\mathbf{g} \quad \mbox{and} \quad u=g \qquad \mbox{on } \partial \Omega,
2260then the right-hand side @f$\boldsymbol{
F}@f$ of the linear system needs to be modified as follows
2262F_i:=\int_{\Omega}f\varphi_i-\sum_{e\in\mathcal{
E}_h^
b}\int_{\Omega}r_e(\mathbf{g}):H_h(\varphi_i)+\sum_{
e\in\mathcal{
E}_h^
b}\int_{\Omega}b_e(g):H_h(\varphi_i)+\gamma_1\sum_{
e\in\mathcal{
E}_h^
b}h_e^{-1}\int_e\mathbf{g}\cdot\nabla\varphi_i+\gamma_0\sum_{e\in\mathcal{
E}_h^
b}h_e^{-3}\int_e g\varphi_i, \qquad 1\leq i \leq N_h.
2264Note that
for any given
index @f$i@f$, many of the terms are zero. Indeed,
for @f$e\in \mathcal{
E}_h^
b@f$ we have @f${\rm supp}\,(r_e(\mathbf{g}))={\rm supp}\,(b_e(g))=K@f$, where @f$K@f$ is the element
for which @f$e\subset\partial K@f$. Therefore, the liftings @f$r_e(\mathbf{g})@f$ and @f$b_e(g)@f$ contribute to @f$F_i@f$ only
if @f$\varphi_i@f$ has support on @f$K@f$ or a neighbor of @f$K@f$. In other words, when integrating on a cell @f$K@f$, we need to add
2266\int_{
K}f\varphi_i+\sum_{e\in\mathcal{
E}_h^
b, e\subset\partial
K}\left[-\int_{
K}r_e(\mathbf{g}):H_h(\varphi_i)+\int_{
K}b_e(g):H_h(\varphi_i)+\gamma_1h_e^{-1}\int_e\mathbf{g}\cdot\nabla\varphi_i+\gamma_0h_e^{-3}\int_e g\varphi_i\right]
2268to @f$F_i@f$
for the indices @f$i@f$ such that @f$\varphi_i@f$ has support on @f$K@f$ and
2270\sum_{e\in\mathcal{
E}_h^
b, e\subset\partial
K}\left[-\int_{
K}r_e(\mathbf{g}):H_h(\varphi_i)+\int_{
K}b_e(g):H_h(\varphi_i)\right]
2272to @f$F_i@f$ for the indices @f$i@f$ such that @f$\varphi_i@f$ has support on a neighbor of @f$K@f$.
2275Note that we can easily consider the case where Dirichlet boundary conditions are imposed only on a subset @f$\emptyset\neq\Gamma_D\subset\partial \Omega@f$. In this case, we simply need to replace @f$\mathcal{
E}_h^
b@f$ by @f$\mathcal{
E}_h^D\subset\mathcal{
E}_h^
b@f$ consisting of the faces belonging to @f$\Gamma_D@f$. This also affects the
matrix @f$A@f$ (simply replace @f$\mathcal{
E}_h=\mathcal{
E}_h^0\cup\mathcal{
E}_h^
b@f$ by @f$\mathcal{
E}_h=\mathcal{
E}_h^0\cup\mathcal{
E}_h^D@f$).
2278<a name=
"step_82-PlainProg"></a>
2279<h1> The plain program</h1>
2280@include
"step-82.cc"
void attach_dof_handler(const DoFHandler< dim, spacedim > &)
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
const Quadrature< dim > quadrature
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
virtual SymmetricTensor< 2, dim, RangeNumberType > hessian(const Point< dim > &p, const unsigned int component=0) const
virtual Tensor< 1, dim, RangeNumberType > gradient(const Point< dim > &p, const unsigned int component=0) const
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const
void initialize(const SparsityPattern &sparsity_pattern)
constexpr numbers::NumberTraits< Number >::real_type norm_square() const
unsigned int n_active_cells() const
void refine_global(const unsigned int times=1)
__global__ void set(Number *val, const Number s, const size_type N)
typename ActiveSelector::face_iterator face_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
void loop(IteratorType begin, std_cxx20::type_identity_t< IteratorType > end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, AssemblerType &assembler, const LoopControl &lctrl=LoopControl())
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern)
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_JxW_values
Transformed quadrature weights.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
#define DEAL_II_NOT_IMPLEMENTED()
CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt K
void approximate(const SynchronousIterators< std::tuple< typename DoFHandler< dim, spacedim >::active_cell_iterator, Vector< float >::iterator > > &cell, const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const InputVector &solution, const unsigned int component)
void hyper_cube(Triangulation< dim, spacedim > &tria, const double left=0., const double right=1., const bool colorize=false)
@ matrix
Contents is actually a matrix.
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim > > > &Du)
void L2(Vector< number > &result, const FEValuesBase< dim > &fe, const std::vector< double > &input, const double factor=1.)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > E(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Tensor< 2, dim, Number > F(const Tensor< 2, dim, Number > &Grad_u)
VectorType::value_type * end(VectorType &V)
constexpr T fixed_power(const T t)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
int(& functions)(const void *v1, const void *v2)
void assemble(const MeshWorker::DoFInfoBox< dim, DOFINFO > &dinfo, A *assembler)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
DEAL_II_HOST constexpr Number trace(const SymmetricTensor< 2, dim2, Number > &)