From: Wolfgang Bangerth Date: Wed, 20 May 1998 08:40:03 +0000 (+0000) Subject: Doc update and slight clarification of structures. X-Git-Tag: v8.0.0~22935 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d64d3340e6c5bc49145bd82d5fdfe70b07fe997;p=dealii.git Doc update and slight clarification of structures. git-svn-id: https://svn.dealii.org/trunk@319 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index baf6930aba..7b153329a3 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -134,9 +134,22 @@ template class Quadrature; * passed through the constructor. In debug mode, the accessor functions, which * return values from the different fields, check whether the required field * was initialized, thus avoiding use of unitialized data. - * - @author Wolfgang Bangerth, 1998 -*/ + * + * Functions should not assume that one flag is needed for another object as + * well. For example, the computation of the Jacobi determinant usually + * requires the computation of the Jacobi matrix. However, functions shall + * not assume that someone who wants to get the #JxW_values# must set the + * #update_jacobians# flag besides the #update_JxW_values# flag. + * + * + * It is also forbidden that the constructor of a class set the + * #update_jacobians# flag if the user specifies #update_JxW_values#. This is + * since derived classes may be able to compute the #JxW_values# field without + * the Jacobian matrices, but need to do the latter since they can't know who + * set the #update_jacobians# flag. + * + * @author Wolfgang Bangerth, 1998 + */ template class FEValuesBase { public: diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index cfa04dc64f..f4a145301a 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -188,12 +188,16 @@ void FEValues::reinit (const typename DoFHandler::cell_iterator &cell, // fill jacobi matrices and real // quadrature points if ((update_flags & update_jacobians) || + (update_flags & update_JxW_values)|| (update_flags & update_q_points) || + (update_flags & update_gradients) || (update_flags & update_ansatz_points)) fe.fill_fe_values (cell, unit_quadrature_points, jacobi_matrices, - update_flags & update_jacobians, + update_flags & (update_jacobians | + update_JxW_values | + update_gradients), ansatz_points, update_flags & update_ansatz_points, quadrature_points, @@ -203,24 +207,20 @@ void FEValues::reinit (const typename DoFHandler::cell_iterator &cell, // compute gradients on real element if // requested if (update_flags & update_gradients) - { - Assert (update_flags & update_jacobians, ExcCannotInitializeField()); - - for (unsigned int i=0; i::reinit (const typename DoFHandler::cell_iterator &cell, // why we take the inverse of the // determinant if (update_flags & update_JxW_values) - { - Assert (update_flags & update_jacobians, ExcCannotInitializeField()); - for (unsigned int i=0; i::reinit (const typename DoFHandler::cell_iterator &c // fill jacobi matrices and real // quadrature points if ((update_flags & update_jacobians) || + (update_flags & update_JxW_values)|| (update_flags & update_q_points) || + (update_flags & update_gradients) || (update_flags & update_ansatz_points) || (update_flags & update_JxW_values)) fe.fill_fe_face_values (cell, @@ -335,7 +334,9 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c unit_face_quadrature_points, unit_quadrature_points[face_no], jacobi_matrices, - update_flags & update_jacobians, + update_flags & (update_jacobians | + update_gradients | + update_JxW_values), ansatz_points, update_flags & update_ansatz_points, quadrature_points, @@ -349,25 +350,21 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c // compute gradients on real element if // requested if (update_flags & update_gradients) - { - Assert (update_flags & update_jacobians, ExcCannotInitializeField()); - - for (unsigned int i=0; i()); - for (unsigned int j=0; j()); + for (unsigned int j=0; j::reinit (const typename DoFHandler::cell_iterator &c // why we take the inverse of the // determinant if (update_flags & update_JxW_values) - { - Assert (update_flags & update_jacobians, - ExcCannotInitializeField()); - for (unsigned int i=0; i::reinit (const typename DoFHandler::cell_iterator // fill jacobi matrices and real // quadrature points if ((update_flags & update_jacobians) || + (update_flags & update_JxW_values)|| (update_flags & update_q_points) || + (update_flags & update_gradients) || (update_flags & update_JxW_values)) fe.fill_fe_subface_values (cell, face_no, @@ -455,7 +450,9 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator unit_face_quadrature_points, unit_quadrature_points[selected_dataset], jacobi_matrices, - update_flags & update_jacobians, + update_flags & (update_jacobians | + update_gradients | + update_JxW_values), quadrature_points, update_flags & update_q_points, face_jacobi_determinants, @@ -467,25 +464,21 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator // compute gradients on real element if // requested if (update_flags & update_gradients) - { - Assert (update_flags & update_jacobians, ExcCannotInitializeField()); - - for (unsigned int i=0; i()); - for (unsigned int j=0; j()); + for (unsigned int j=0; j::reinit (const typename DoFHandler::cell_iterator // why we take the inverse of the // determinant if (update_flags & update_JxW_values) - { - Assert (update_flags & update_jacobians, - ExcCannotInitializeField()); - for (unsigned int i=0; i