From: bangerth Date: Tue, 20 May 2008 21:22:05 +0000 (+0000) Subject: Finish documenting the face assembly function. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b6a7677e03d7a18653714758ebfbd92c07d596a;p=dealii-svn.git Finish documenting the face assembly function. git-svn-id: https://svn.dealii.org/trunk@16147 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-33/step-33.cc b/deal.II/examples/step-33/step-33.cc index 3257bb4ed3..1a42218e05 100644 --- a/deal.II/examples/step-33/step-33.cc +++ b/deal.II/examples/step-33/step-33.cc @@ -2578,9 +2578,16 @@ ConservationLaw::assemble_face_term(const unsigned int face_no, boundary_values[q], Wminus[q]); } + - // Determine the Lax-Friedrich's stability parameter, - // and evaluate the numerical flux function at the quadrature points + // Now that we have $\mathbf w^+$ and + // $\mathbf w^-$, we can go about computing + // the numerical flux function $\mathbf + // H(\mathbf w^+,\mathbf w^-, \mathbf n)$ + // for each quadrature point. Before + // calling the function that does so, we + // also need to determine the + // Lax-Friedrich's stability parameter: typedef Sacado::Fad::DFad NormalFlux[EulerEquations::n_components]; NormalFlux *normal_fluxes = new NormalFlux[n_q_points]; @@ -2604,45 +2611,54 @@ ConservationLaw::assemble_face_term(const unsigned int face_no, Wplus[q], Wminus[q], alpha, normal_fluxes[q]); - // Now assemble the face term + // Now assemble the face term in exactly + // the same way as for the cell + // contributions in the previous + // function. The only difference is that if + // this is an internal face, we also have + // to take into account the sensitivies of + // the residual contributions to the + // degrees of freedom on the neighboring + // cell + std::vector residual_derivatives (dofs_per_cell); for (unsigned int i=0; i F_i = 0; - Sacado::Fad::DFad F_i = 0; - for (unsigned int point=0; pointSumIntoGlobalValues(dof_indices[i], - dofs_per_cell, - &values[0], - reinterpret_cast(const_cast(&dof_indices[0]))); - - if (external_face == false) + for (unsigned int k=0; kSumIntoGlobalValues(dof_indices[i], dofs_per_cell, - &values[dofs_per_cell], - reinterpret_cast(const_cast(&dof_indices_neighbor[0]))); + &residual_derivatives[0], + reinterpret_cast( + const_cast( + &dof_indices[0]))); - - // And add into the residual - right_hand_side(dof_indices[i]) -= F_i.val(); - } + if (external_face == false) + { + for (unsigned int k=0; kSumIntoGlobalValues(dof_indices[i], + dofs_per_cell, + &residual_derivatives[0], + reinterpret_cast( + const_cast( + &dof_indices_neighbor[0]))); + } + + right_hand_side(dof_indices[i]) -= F_i.val(); + } delete[] normal_fluxes; }