From: Ralf Hartmann Date: Thu, 23 Feb 2006 17:14:18 +0000 (+0000) Subject: Update notation. X-Git-Tag: v8.0.0~12204 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=077b6c877cf0840a804e346e68be5c352e1dbb10;p=dealii.git Update notation. git-svn-id: https://svn.dealii.org/trunk@12478 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-12/step-12.cc b/deal.II/examples/step-12/step-12.cc index 8ba4184f18..c577f33f78 100644 --- a/deal.II/examples/step-12/step-12.cc +++ b/deal.II/examples/step-12/step-12.cc @@ -42,20 +42,21 @@ // due to the pre-knowledge of the // actual polynomial degree 1. #include - // Here the discontinuous finite elements are - // defined. They are used in the same way as - // all other finite elements, though -- as - // you have seen in previous tutorial + // Here the discontinuous finite + // elements are defined. They are + // used in the same way as all other + // finite elements, though -- as you + // have seen in previous tutorial // programs -- there isn't much user - // interaction with finite element classes at - // all: the are passed to ``DoFHandler'' and - // ``FEValues'' objects, and that is about - // it. + // interaction with finite element + // classes at all: the are passed to + // ``DoFHandler'' and ``FEValues'' + // objects, and that is about it. #include // We are going to use the simplest // possible solver, called Richardson - // iteration, that represents a simple - // defect correction. This, in + // iteration, that represents a + // simple defect correction. This, in // combination with a block SSOR // preconditioner (defined in // precondition_block.h), that uses @@ -231,24 +232,24 @@ class DGTransportEquation DGTransportEquation(); void assemble_cell_term(const FEValues& fe_v, - FullMatrix &u_v_matrix, + FullMatrix &ui_vi_matrix, Vector &cell_vector) const; void assemble_boundary_term(const FEFaceValues& fe_v, - FullMatrix &u_v_matrix, + FullMatrix &ui_vi_matrix, Vector &cell_vector) const; void assemble_face_term1(const FEFaceValuesBase& fe_v, const FEFaceValuesBase& fe_v_neighbor, - FullMatrix &u_v_matrix, - FullMatrix &un_v_matrix) const; + FullMatrix &ui_vi_matrix, + FullMatrix &ue_vi_matrix) const; void assemble_face_term2(const FEFaceValuesBase& fe_v, const FEFaceValuesBase& fe_v_neighbor, - FullMatrix &u_v_matrix, - FullMatrix &un_v_matrix, - FullMatrix &u_vn_matrix, - FullMatrix &un_vn_matrix) const; + FullMatrix &ui_vi_matrix, + FullMatrix &ue_vi_matrix, + FullMatrix &ui_ve_matrix, + FullMatrix &ue_ve_matrix) const; private: const Beta beta_function; const RHS rhs_function; @@ -270,7 +271,7 @@ DGTransportEquation::DGTransportEquation () // The ``assemble_cell_term'' // function assembles the cell terms // of the discretization. - // ``u_v_matrix'' is a cell matrix, + // ``ui_vi_matrix'' is a cell matrix, // i.e. for a DG method of degree 1, // it is of size 4 times 4, and // ``cell_vector'' is of size 4. @@ -281,7 +282,7 @@ DGTransportEquation::DGTransportEquation () template void DGTransportEquation::assemble_cell_term( const FEValues &fe_v, - FullMatrix &u_v_matrix, + FullMatrix &ui_vi_matrix, Vector &cell_vector) const { // First we ask ``fe_v'' for the @@ -305,7 +306,7 @@ void DGTransportEquation::assemble_cell_term( for (unsigned int i=0; i::assemble_cell_term( template void DGTransportEquation::assemble_boundary_term( const FEFaceValues& fe_v, - FullMatrix &u_v_matrix, + FullMatrix &ui_vi_matrix, Vector &cell_vector) const { // Again, as in the previous @@ -356,18 +357,18 @@ void DGTransportEquation::assemble_boundary_term( const double beta_n=beta[point] * normals[point]; // We assemble the term // $(\beta\cdot n - // u,v)_{\partial K_+}$, + // u,v)_{\partial\kappa_+}$, if (beta_n>0) for (unsigned int i=0; i::assemble_boundary_term( // on the face. // // In addition to the cell matrix - // ``u_v_matrix'' this function gets - // a new argument ``un_v_matrix'', + // ``ui_vi_matrix'' this function gets + // a new argument ``ue_vi_matrix'', // that stores contributions to the // system matrix that are based on // outer values of u, see $\hat u_h$ @@ -411,8 +412,8 @@ template void DGTransportEquation::assemble_face_term1( const FEFaceValuesBase& fe_v, const FEFaceValuesBase& fe_v_neighbor, - FullMatrix &u_v_matrix, - FullMatrix &un_v_matrix) const + FullMatrix &ui_vi_matrix, + FullMatrix &ue_vi_matrix) const { // Again, as in the previous // function, we ask the FEValues @@ -435,11 +436,11 @@ void DGTransportEquation::assemble_face_term1( const double beta_n=beta[point] * normals[point]; // We assemble the term // $(\beta\cdot n - // u,v)_{\partial K_+}$, + // u,v)_{\partial\kappa_+}$, if (beta_n>0) for (unsigned int i=0; i::assemble_face_term1( // and the // term $(\beta\cdot n // \hat u,v)_{\partial - // K_-}$. + // \kappa_-}$. for (unsigned int i=0; i::assemble_face_term1( // terms are given as a sum of // integrals over all faces. Here we // need two additional cell matrices - // ``u_vn_matrix'' and - // ``un_vn_matrix'' that will store + // ``ui_ve_matrix'' and + // ``ue_ve_matrix'' that will store // contributions due to terms // involving u and vn as well as un // and vn. @@ -478,10 +479,10 @@ template void DGTransportEquation::assemble_face_term2( const FEFaceValuesBase& fe_v, const FEFaceValuesBase& fe_v_neighbor, - FullMatrix &u_v_matrix, - FullMatrix &un_v_matrix, - FullMatrix &u_vn_matrix, - FullMatrix &un_vn_matrix) const + FullMatrix &ui_vi_matrix, + FullMatrix &ue_vi_matrix, + FullMatrix &ui_ve_matrix, + FullMatrix &ue_ve_matrix) const { // the first few lines are the same const std::vector &JxW = fe_v.get_JxW_values (); @@ -496,10 +497,11 @@ void DGTransportEquation::assemble_face_term2( const double beta_n=beta[point] * normals[point]; if (beta_n>0) { - // This terms we've already seen. + // This term we've already + // seen. for (unsigned int i=0; i::assemble_face_term2( // We additionally assemble // the term $(\beta\cdot n // u,\hat v)_{\partial - // K_+}, + // \kappa_+}, for (unsigned int k=0; k::assemble_face_term2( // seen, too. for (unsigned int i=0; i::assemble_face_term2( // And this is another new // one: $(\beta\cdot n \hat // u,\hat v)_{\partial - // K_-}$. + // \kappa_-}$. for (unsigned int k=0; k::assemble_system1 () // and vectors. Here we need two // cell matrices, both for face // terms that include test - // functions ``v'' (shape functions + // functions ``vi'' (internal shape + // functions, i.e. shape functions // of the current cell). To be more // precise, the first matrix will - // include the `u and v terms' and - // the second that will include the - // `un and v terms'. Here we recall - // the convention that `un' is - // the shortcut for `u_neighbor' - // and represents the $u_hat$, see + // include the `ui and vi terms' + // and the second will include the + // `ue and vi terms'. Here we + // recall the convention that `ui' + // is the shortcut for $u_h^+$ and + // `ue' represents $u_h_-$, see the // introduction. - FullMatrix u_v_matrix (dofs_per_cell, dofs_per_cell); - FullMatrix un_v_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix ui_vi_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix ue_vi_matrix (dofs_per_cell, dofs_per_cell); Vector cell_vector (dofs_per_cell); @@ -835,10 +838,10 @@ void DGMethod::assemble_system1 () // cell vector are only // ADDED. Therefore on each // cell we need to reset the - // ``u_v_matrix'' and + // ``ui_vi_matrix'' and // ``cell_vector'' to zero, // before assembling the cell terms. - u_v_matrix = 0; + ui_vi_matrix = 0; cell_vector = 0; // Now we reinit the ``FEValues'' @@ -852,7 +855,7 @@ void DGMethod::assemble_system1 () // previously reinit'ed on the // current cell. dg.assemble_cell_term(fe_v, - u_v_matrix, + ui_vi_matrix, cell_vector); // As in previous examples the @@ -869,9 +872,9 @@ void DGMethod::assemble_system1 () typename DoFHandler::face_iterator face=cell->face(face_no); // and clear the - // ``un_v_matrix'' on each + // ``ue_vi_matrix'' on each // face. - un_v_matrix = 0; + ue_vi_matrix = 0; // Now we distinguish the // four different cases in @@ -891,7 +894,7 @@ void DGMethod::assemble_system1 () // corresponding face // terms. dg.assemble_boundary_term(fe_v_face, - u_v_matrix, + ui_vi_matrix, cell_vector); } else @@ -984,7 +987,7 @@ void DGMethod::assemble_system1 () // We need to // reset the - // ``un_v_matrix'' + // ``ue_vi_matrix'' // on each // subface // because on @@ -994,7 +997,7 @@ void DGMethod::assemble_system1 () // different // neighboring // cells. - un_v_matrix = 0; + ue_vi_matrix = 0; // As already // mentioned @@ -1022,8 +1025,8 @@ void DGMethod::assemble_system1 () dg.assemble_face_term1(fe_v_subface, fe_v_face_neighbor, - u_v_matrix, - un_v_matrix); + ui_vi_matrix, + ue_vi_matrix); // Then we get // the dof @@ -1035,13 +1038,13 @@ void DGMethod::assemble_system1 () // and // distribute - // ``un_v_matrix'' + // ``ue_vi_matrix'' // to the // system_matrix for (unsigned int i=0; ihas_children())'' @@ -1086,8 +1089,8 @@ void DGMethod::assemble_system1 () dg.assemble_face_term1(fe_v_face, fe_v_face_neighbor, - u_v_matrix, - un_v_matrix); + ui_vi_matrix, + ue_vi_matrix); // End of ``if // (neighbor->level() // == @@ -1142,8 +1145,8 @@ void DGMethod::assemble_system1 () dg.assemble_face_term1(fe_v_face, fe_v_subface_neighbor, - u_v_matrix, - un_v_matrix); + ui_vi_matrix, + ue_vi_matrix); } // Now we get the @@ -1154,11 +1157,11 @@ void DGMethod::assemble_system1 () neighbor->get_dof_indices (dofs_neighbor); // and distribute the - // ``un_v_matrix''. + // ``ue_vi_matrix''. for (unsigned int i=0; i::assemble_system1 () } // Finally we distribute the - // ``u_v_matrix'' + // ``ui_vi_matrix'' for (unsigned int i=0; i::assemble_system2 () mapping, fe, face_quadrature, neighbor_face_update_flags); - FullMatrix u_v_matrix (dofs_per_cell, dofs_per_cell); - FullMatrix un_v_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix ui_vi_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix ue_vi_matrix (dofs_per_cell, dofs_per_cell); // Additionally we need the // following two cell matrices, // both for face term that include - // test function ``vn'' (shape + // test function ``ve'' (external + // shape functions, i.e. shape // functions of the neighboring // cell). To be more precise, the // first matrix will include the `u // and vn terms' and the second // that will include the `un and vn // terms'. - FullMatrix u_vn_matrix (dofs_per_cell, dofs_per_cell); - FullMatrix un_vn_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix ui_ve_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix ue_ve_matrix (dofs_per_cell, dofs_per_cell); Vector cell_vector (dofs_per_cell); @@ -1272,13 +1276,13 @@ void DGMethod::assemble_system2 () endc = dof_handler.end(); for (;cell!=endc; ++cell) { - u_v_matrix = 0; + ui_vi_matrix = 0; cell_vector = 0; fe_v.reinit (cell); dg.assemble_cell_term(fe_v, - u_v_matrix, + ui_vi_matrix, cell_vector); cell->get_dof_indices (dofs); @@ -1294,7 +1298,7 @@ void DGMethod::assemble_system2 () fe_v_face.reinit (cell, face_no); dg.assemble_boundary_term(fe_v_face, - u_v_matrix, + ui_vi_matrix, cell_vector); } else @@ -1319,19 +1323,19 @@ void DGMethod::assemble_system2 () ExcInternalError()); Assert (!neighbor_child->has_children(), ExcInternalError()); - un_v_matrix = 0; - u_vn_matrix = 0; - un_vn_matrix = 0; + ue_vi_matrix = 0; + ui_ve_matrix = 0; + ue_ve_matrix = 0; fe_v_subface.reinit (cell, face_no, subface_no); fe_v_face_neighbor.reinit (neighbor_child, neighbor2); dg.assemble_face_term2(fe_v_subface, fe_v_face_neighbor, - u_v_matrix, - un_v_matrix, - u_vn_matrix, - un_vn_matrix); + ui_vi_matrix, + ue_vi_matrix, + ui_ve_matrix, + ue_ve_matrix); neighbor_child->get_dof_indices (dofs_neighbor); @@ -1339,11 +1343,11 @@ void DGMethod::assemble_system2 () for (unsigned int j=0; j::assemble_system2 () { const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no); - un_v_matrix = 0; - u_vn_matrix = 0; - un_vn_matrix = 0; + ue_vi_matrix = 0; + ui_ve_matrix = 0; + ue_ve_matrix = 0; fe_v_face.reinit (cell, face_no); fe_v_face_neighbor.reinit (neighbor, neighbor2); dg.assemble_face_term2(fe_v_face, fe_v_face_neighbor, - u_v_matrix, - un_v_matrix, - u_vn_matrix, - un_vn_matrix); + ui_vi_matrix, + ue_vi_matrix, + ui_ve_matrix, + ue_ve_matrix); neighbor->get_dof_indices (dofs_neighbor); @@ -1377,11 +1381,11 @@ void DGMethod::assemble_system2 () for (unsigned int j=0; j::assemble_system2 () for (unsigned int i=0; i