From: Wolfgang Bangerth Date: Mon, 5 Jun 2023 23:08:17 +0000 (-0600) Subject: Be systematic in how we name arguments of FEValues member functions. X-Git-Tag: v9.5.0-rc1~154^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=805058cebd6abbadb634744bdcd4ef9dc3851e0e;p=dealii.git Be systematic in how we name arguments of FEValues member functions. --- diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index b3d385f635..bd7a7318df 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -2499,18 +2499,17 @@ public: * ExcShapeFunctionNotPrimitive. In that case, use the * shape_value_component() function. * - * @param function_no Number of the shape function to be evaluated. Note + * @param i Number of the shape function $\varphi_i$ to be evaluated. Note * that this number runs from zero to dofs_per_cell, even in the case of an * FEFaceValues or FESubfaceValues object. * - * @param point_no Number of the quadrature point at which function is to be + * @param q_point Number of the quadrature point at which function is to be * evaluated * * @dealiiRequiresUpdateFlags{update_values} */ const double & - shape_value(const unsigned int function_no, - const unsigned int point_no) const; + shape_value(const unsigned int i, const unsigned int q_point) const; /** * Compute one vector component of the value of a shape function at a @@ -2523,9 +2522,9 @@ public: * shape function is not primitive, but then it is necessary since the other * function cannot be used. * - * @param function_no Number of the shape function to be evaluated. + * @param i Number of the shape function $\varphi_i$ to be evaluated. * - * @param point_no Number of the quadrature point at which function is to be + * @param q_point Number of the quadrature point at which function is to be * evaluated. * * @param component vector component to be evaluated. @@ -2533,12 +2532,12 @@ public: * @dealiiRequiresUpdateFlags{update_values} */ double - shape_value_component(const unsigned int function_no, - const unsigned int point_no, + shape_value_component(const unsigned int i, + const unsigned int q_point, const unsigned int component) const; /** - * Compute the gradient of the function_noth shape function at the + * Compute the gradient of the ith shape function at the * quadrature_pointth quadrature point with respect to real cell * coordinates. If you want to get the derivative in one of the coordinate * directions, use the appropriate function of the Tensor class to extract @@ -2555,16 +2554,15 @@ public: * The same holds for the arguments of this function as for the * shape_value() function. * - * @param function_no Number of the shape function to be evaluated. + * @param i Number of the shape function $\varphi_i$ to be evaluated. * - * @param quadrature_point Number of the quadrature point at which function + * @param q_point Number of the quadrature point at which function * is to be evaluated. * * @dealiiRequiresUpdateFlags{update_gradients} */ const Tensor<1, spacedim> & - shape_grad(const unsigned int function_no, - const unsigned int quadrature_point) const; + shape_grad(const unsigned int i, const unsigned int q_point) const; /** * Return one vector component of the gradient of a shape function at a @@ -2583,13 +2581,13 @@ public: * @dealiiRequiresUpdateFlags{update_gradients} */ Tensor<1, spacedim> - shape_grad_component(const unsigned int function_no, - const unsigned int point_no, + shape_grad_component(const unsigned int i, + const unsigned int q_point, const unsigned int component) const; /** - * Second derivatives of the function_noth shape function at the - * point_noth quadrature point with respect to real cell + * Second derivatives of the ith shape function at the + * q_pointth quadrature point with respect to real cell * coordinates. If you want to get the derivatives in one of the coordinate * directions, use the appropriate function of the Tensor class to extract * one component. Since only a reference to the hessian values is returned, @@ -2607,8 +2605,7 @@ public: * @dealiiRequiresUpdateFlags{update_hessians} */ const Tensor<2, spacedim> & - shape_hessian(const unsigned int function_no, - const unsigned int point_no) const; + shape_hessian(const unsigned int i, const unsigned int q_point) const; /** * Return one vector component of the hessian of a shape function at a @@ -2627,13 +2624,13 @@ public: * @dealiiRequiresUpdateFlags{update_hessians} */ Tensor<2, spacedim> - shape_hessian_component(const unsigned int function_no, - const unsigned int point_no, + shape_hessian_component(const unsigned int i, + const unsigned int q_point, const unsigned int component) const; /** - * Third derivatives of the function_noth shape function at the - * point_noth quadrature point with respect to real cell + * Third derivatives of the ith shape function at the + * q_pointth quadrature point with respect to real cell * coordinates. If you want to get the 3rd derivatives in one of the * coordinate directions, use the appropriate function of the Tensor class * to extract one component. Since only a reference to the 3rd derivative @@ -2651,8 +2648,7 @@ public: * @dealiiRequiresUpdateFlags{update_3rd_derivatives} */ const Tensor<3, spacedim> & - shape_3rd_derivative(const unsigned int function_no, - const unsigned int point_no) const; + shape_3rd_derivative(const unsigned int i, const unsigned int q_point) const; /** * Return one vector component of the third derivative of a shape function @@ -2671,8 +2667,8 @@ public: * @dealiiRequiresUpdateFlags{update_3rd_derivatives} */ Tensor<3, spacedim> - shape_3rd_derivative_component(const unsigned int function_no, - const unsigned int point_no, + shape_3rd_derivative_component(const unsigned int i, + const unsigned int q_point, const unsigned int component) const; /** @} */ @@ -3417,12 +3413,13 @@ public: quadrature_point_indices() const; /** - * Position of the qth quadrature point in real space. + * Return the location of the q_pointth quadrature point in + * real space. * * @dealiiRequiresUpdateFlags{update_quadrature_points} */ const Point & - quadrature_point(const unsigned int q) const; + quadrature_point(const unsigned int q_point) const; /** * Return a reference to the vector of quadrature points in real space. @@ -3435,7 +3432,8 @@ public: /** * Mapped quadrature weight. If this object refers to a volume evaluation * (i.e. the derived class is of type FEValues), then this is the Jacobi - * determinant times the weight of the *ith unit quadrature point. + * determinant times the weight of the q_pointth unit quadrature + * point. * * For surface evaluations (i.e. classes FEFaceValues or FESubfaceValues), * it is the mapped surface element times the weight of the quadrature @@ -3448,7 +3446,7 @@ public: * @dealiiRequiresUpdateFlags{update_JxW_values} */ double - JxW(const unsigned int quadrature_point) const; + JxW(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by JxW(). @@ -3463,7 +3461,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobians} */ const DerivativeForm<1, dim, spacedim> & - jacobian(const unsigned int quadrature_point) const; + jacobian(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3482,7 +3480,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobian_grads} */ const DerivativeForm<2, dim, spacedim> & - jacobian_grad(const unsigned int quadrature_point) const; + jacobian_grad(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3502,7 +3500,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobian_pushed_forward_grads} */ const Tensor<3, spacedim> & - jacobian_pushed_forward_grad(const unsigned int quadrature_point) const; + jacobian_pushed_forward_grad(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3521,7 +3519,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobian_2nd_derivatives} */ const DerivativeForm<3, dim, spacedim> & - jacobian_2nd_derivative(const unsigned int quadrature_point) const; + jacobian_2nd_derivative(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3542,8 +3540,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobian_pushed_forward_2nd_derivatives} */ const Tensor<4, spacedim> & - jacobian_pushed_forward_2nd_derivative( - const unsigned int quadrature_point) const; + jacobian_pushed_forward_2nd_derivative(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3563,7 +3560,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobian_3rd_derivatives} */ const DerivativeForm<4, dim, spacedim> & - jacobian_3rd_derivative(const unsigned int quadrature_point) const; + jacobian_3rd_derivative(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3584,8 +3581,7 @@ public: * @dealiiRequiresUpdateFlags{update_jacobian_pushed_forward_3rd_derivatives} */ const Tensor<5, spacedim> & - jacobian_pushed_forward_3rd_derivative( - const unsigned int quadrature_point) const; + jacobian_pushed_forward_3rd_derivative(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3603,7 +3599,7 @@ public: * @dealiiRequiresUpdateFlags{update_inverse_jacobians} */ const DerivativeForm<1, spacedim, dim> & - inverse_jacobian(const unsigned int quadrature_point) const; + inverse_jacobian(const unsigned int q_point) const; /** * Return a reference to the array holding the values returned by @@ -3618,7 +3614,7 @@ public: * Return the normal vector at a quadrature point. If you call this * function for a face (i.e., when using a FEFaceValues or FESubfaceValues * object), then this function returns the outward normal vector to - * the cell at the ith quadrature point of the face. + * the cell at the q_pointth quadrature point of the face. * * In contrast, if you call this function for a cell of codimension one * (i.e., when using a `FEValues` object with @@ -3634,7 +3630,7 @@ public: * @dealiiRequiresUpdateFlags{update_normal_vectors} */ const Tensor<1, spacedim> & - normal_vector(const unsigned int i) const; + normal_vector(const unsigned int q_point) const; /** * Return the normal vectors at all quadrature points represented by @@ -4219,14 +4215,14 @@ public: const hp::QCollection & quadrature); /** - * Boundary form of the transformation of the cell at the ith + * Boundary form of the transformation of the cell at the q_pointth * quadrature point. See * @ref GlossBoundaryForm. * * @dealiiRequiresUpdateFlags{update_boundary_forms} */ const Tensor<1, spacedim> & - boundary_form(const unsigned int i) const; + boundary_form(const unsigned int q_point) const; /** * Return the list of outward normal vectors times the Jacobian of the @@ -5569,7 +5565,7 @@ FEValuesBase::operator[]( template inline const double & FEValuesBase::shape_value(const unsigned int i, - const unsigned int j) const + const unsigned int q_point) const { AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_values, @@ -5579,7 +5575,7 @@ FEValuesBase::shape_value(const unsigned int i, // if the entire FE is primitive, // then we can take a short-cut: if (fe->is_primitive()) - return this->finite_element_output.shape_values(i, j); + return this->finite_element_output.shape_values(i, q_point); else { // otherwise, use the mapping @@ -5594,7 +5590,7 @@ FEValuesBase::shape_value(const unsigned int i, this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first]; - return this->finite_element_output.shape_values(row, j); + return this->finite_element_output.shape_values(row, q_point); } } @@ -5604,7 +5600,7 @@ template inline double FEValuesBase::shape_value_component( const unsigned int i, - const unsigned int j, + const unsigned int q_point, const unsigned int component) const { AssertIndexRange(i, fe->n_dofs_per_cell()); @@ -5625,7 +5621,7 @@ FEValuesBase::shape_value_component( const unsigned int row = this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + component]; - return this->finite_element_output.shape_values(row, j); + return this->finite_element_output.shape_values(row, q_point); } @@ -5633,7 +5629,7 @@ FEValuesBase::shape_value_component( template inline const Tensor<1, spacedim> & FEValuesBase::shape_grad(const unsigned int i, - const unsigned int j) const + const unsigned int q_point) const { AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_gradients, @@ -5643,7 +5639,7 @@ FEValuesBase::shape_grad(const unsigned int i, // if the entire FE is primitive, // then we can take a short-cut: if (fe->is_primitive()) - return this->finite_element_output.shape_gradients[i][j]; + return this->finite_element_output.shape_gradients[i][q_point]; else { // otherwise, use the mapping @@ -5658,7 +5654,7 @@ FEValuesBase::shape_grad(const unsigned int i, this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first]; - return this->finite_element_output.shape_gradients[row][j]; + return this->finite_element_output.shape_gradients[row][q_point]; } } @@ -5668,7 +5664,7 @@ template inline Tensor<1, spacedim> FEValuesBase::shape_grad_component( const unsigned int i, - const unsigned int j, + const unsigned int q_point, const unsigned int component) const { AssertIndexRange(i, fe->n_dofs_per_cell()); @@ -5688,7 +5684,7 @@ FEValuesBase::shape_grad_component( const unsigned int row = this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + component]; - return this->finite_element_output.shape_gradients[row][j]; + return this->finite_element_output.shape_gradients[row][q_point]; } @@ -5696,7 +5692,7 @@ FEValuesBase::shape_grad_component( template inline const Tensor<2, spacedim> & FEValuesBase::shape_hessian(const unsigned int i, - const unsigned int j) const + const unsigned int q_point) const { AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_hessians, @@ -5706,7 +5702,7 @@ FEValuesBase::shape_hessian(const unsigned int i, // if the entire FE is primitive, // then we can take a short-cut: if (fe->is_primitive()) - return this->finite_element_output.shape_hessians[i][j]; + return this->finite_element_output.shape_hessians[i][q_point]; else { // otherwise, use the mapping @@ -5721,7 +5717,7 @@ FEValuesBase::shape_hessian(const unsigned int i, this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first]; - return this->finite_element_output.shape_hessians[row][j]; + return this->finite_element_output.shape_hessians[row][q_point]; } } @@ -5731,7 +5727,7 @@ template inline Tensor<2, spacedim> FEValuesBase::shape_hessian_component( const unsigned int i, - const unsigned int j, + const unsigned int q_point, const unsigned int component) const { AssertIndexRange(i, fe->n_dofs_per_cell()); @@ -5751,15 +5747,16 @@ FEValuesBase::shape_hessian_component( const unsigned int row = this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + component]; - return this->finite_element_output.shape_hessians[row][j]; + return this->finite_element_output.shape_hessians[row][q_point]; } template inline const Tensor<3, spacedim> & -FEValuesBase::shape_3rd_derivative(const unsigned int i, - const unsigned int j) const +FEValuesBase::shape_3rd_derivative( + const unsigned int i, + const unsigned int q_point) const { AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_3rd_derivatives, @@ -5769,7 +5766,7 @@ FEValuesBase::shape_3rd_derivative(const unsigned int i, // if the entire FE is primitive, // then we can take a short-cut: if (fe->is_primitive()) - return this->finite_element_output.shape_3rd_derivatives[i][j]; + return this->finite_element_output.shape_3rd_derivatives[i][q_point]; else { // otherwise, use the mapping @@ -5784,7 +5781,7 @@ FEValuesBase::shape_3rd_derivative(const unsigned int i, this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + fe->system_to_component_index(i).first]; - return this->finite_element_output.shape_3rd_derivatives[row][j]; + return this->finite_element_output.shape_3rd_derivatives[row][q_point]; } } @@ -5794,7 +5791,7 @@ template inline Tensor<3, spacedim> FEValuesBase::shape_3rd_derivative_component( const unsigned int i, - const unsigned int j, + const unsigned int q_point, const unsigned int component) const { AssertIndexRange(i, fe->n_dofs_per_cell()); @@ -5814,7 +5811,7 @@ FEValuesBase::shape_3rd_derivative_component( const unsigned int row = this->finite_element_output .shape_function_to_row_table[i * fe->n_components() + component]; - return this->finite_element_output.shape_3rd_derivatives[row][j]; + return this->finite_element_output.shape_3rd_derivatives[row][q_point]; } @@ -5897,12 +5894,12 @@ FEValuesBase::get_jacobian_grads() const template inline const Tensor<3, spacedim> & FEValuesBase::jacobian_pushed_forward_grad( - const unsigned int i) const + const unsigned int q_point) const { Assert(this->update_flags & update_jacobian_pushed_forward_grads, ExcAccessToUninitializedField("update_jacobian_pushed_forward_grads")); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobian_pushed_forward_grads[i]; + return this->mapping_output.jacobian_pushed_forward_grads[q_point]; } @@ -5921,12 +5918,13 @@ FEValuesBase::get_jacobian_pushed_forward_grads() const template inline const DerivativeForm<3, dim, spacedim> & -FEValuesBase::jacobian_2nd_derivative(const unsigned int i) const +FEValuesBase::jacobian_2nd_derivative( + const unsigned int q_point) const { Assert(this->update_flags & update_jacobian_2nd_derivatives, ExcAccessToUninitializedField("update_jacobian_2nd_derivatives")); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobian_2nd_derivatives[i]; + return this->mapping_output.jacobian_2nd_derivatives[q_point]; } @@ -5946,13 +5944,13 @@ FEValuesBase::get_jacobian_2nd_derivatives() const template inline const Tensor<4, spacedim> & FEValuesBase::jacobian_pushed_forward_2nd_derivative( - const unsigned int i) const + const unsigned int q_point) const { Assert(this->update_flags & update_jacobian_pushed_forward_2nd_derivatives, ExcAccessToUninitializedField( "update_jacobian_pushed_forward_2nd_derivatives")); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[i]; + return this->mapping_output.jacobian_pushed_forward_2nd_derivatives[q_point]; } @@ -5972,12 +5970,13 @@ FEValuesBase::get_jacobian_pushed_forward_2nd_derivatives() const template inline const DerivativeForm<4, dim, spacedim> & -FEValuesBase::jacobian_3rd_derivative(const unsigned int i) const +FEValuesBase::jacobian_3rd_derivative( + const unsigned int q_point) const { Assert(this->update_flags & update_jacobian_3rd_derivatives, ExcAccessToUninitializedField("update_jacobian_3rd_derivatives")); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobian_3rd_derivatives[i]; + return this->mapping_output.jacobian_3rd_derivatives[q_point]; } @@ -5997,13 +5996,13 @@ FEValuesBase::get_jacobian_3rd_derivatives() const template inline const Tensor<5, spacedim> & FEValuesBase::jacobian_pushed_forward_3rd_derivative( - const unsigned int i) const + const unsigned int q_point) const { Assert(this->update_flags & update_jacobian_pushed_forward_3rd_derivatives, ExcAccessToUninitializedField( "update_jacobian_pushed_forward_3rd_derivatives")); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[i]; + return this->mapping_output.jacobian_pushed_forward_3rd_derivatives[q_point]; } @@ -6077,85 +6076,85 @@ FEValuesBase::quadrature_point_indices() const template inline const Point & -FEValuesBase::quadrature_point(const unsigned int i) const +FEValuesBase::quadrature_point(const unsigned int q_point) const { Assert(this->update_flags & update_quadrature_points, ExcAccessToUninitializedField("update_quadrature_points")); - AssertIndexRange(i, this->mapping_output.quadrature_points.size()); + AssertIndexRange(q_point, this->mapping_output.quadrature_points.size()); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.quadrature_points[i]; + return this->mapping_output.quadrature_points[q_point]; } template inline double -FEValuesBase::JxW(const unsigned int i) const +FEValuesBase::JxW(const unsigned int q_point) const { Assert(this->update_flags & update_JxW_values, ExcAccessToUninitializedField("update_JxW_values")); - AssertIndexRange(i, this->mapping_output.JxW_values.size()); + AssertIndexRange(q_point, this->mapping_output.JxW_values.size()); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.JxW_values[i]; + return this->mapping_output.JxW_values[q_point]; } template inline const DerivativeForm<1, dim, spacedim> & -FEValuesBase::jacobian(const unsigned int i) const +FEValuesBase::jacobian(const unsigned int q_point) const { Assert(this->update_flags & update_jacobians, ExcAccessToUninitializedField("update_jacobians")); - AssertIndexRange(i, this->mapping_output.jacobians.size()); + AssertIndexRange(q_point, this->mapping_output.jacobians.size()); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobians[i]; + return this->mapping_output.jacobians[q_point]; } template inline const DerivativeForm<2, dim, spacedim> & -FEValuesBase::jacobian_grad(const unsigned int i) const +FEValuesBase::jacobian_grad(const unsigned int q_point) const { Assert(this->update_flags & update_jacobian_grads, ExcAccessToUninitializedField("update_jacobians_grads")); - AssertIndexRange(i, this->mapping_output.jacobian_grads.size()); + AssertIndexRange(q_point, this->mapping_output.jacobian_grads.size()); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.jacobian_grads[i]; + return this->mapping_output.jacobian_grads[q_point]; } template inline const DerivativeForm<1, spacedim, dim> & -FEValuesBase::inverse_jacobian(const unsigned int i) const +FEValuesBase::inverse_jacobian(const unsigned int q_point) const { Assert(this->update_flags & update_inverse_jacobians, ExcAccessToUninitializedField("update_inverse_jacobians")); - AssertIndexRange(i, this->mapping_output.inverse_jacobians.size()); + AssertIndexRange(q_point, this->mapping_output.inverse_jacobians.size()); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.inverse_jacobians[i]; + return this->mapping_output.inverse_jacobians[q_point]; } template inline const Tensor<1, spacedim> & -FEValuesBase::normal_vector(const unsigned int i) const +FEValuesBase::normal_vector(const unsigned int q_point) const { Assert(this->update_flags & update_normal_vectors, (typename FEValuesBase::ExcAccessToUninitializedField( "update_normal_vectors"))); - AssertIndexRange(i, this->mapping_output.normal_vectors.size()); + AssertIndexRange(q_point, this->mapping_output.normal_vectors.size()); Assert(present_cell.is_initialized(), ExcNotReinited()); - return this->mapping_output.normal_vectors[i]; + return this->mapping_output.normal_vectors[q_point]; } @@ -6230,14 +6229,14 @@ FESubfaceValues::get_present_fe_values() const template inline const Tensor<1, spacedim> & -FEFaceValuesBase::boundary_form(const unsigned int i) const +FEFaceValuesBase::boundary_form(const unsigned int q_point) const { - AssertIndexRange(i, this->mapping_output.boundary_forms.size()); + AssertIndexRange(q_point, this->mapping_output.boundary_forms.size()); Assert(this->update_flags & update_boundary_forms, (typename FEValuesBase::ExcAccessToUninitializedField( "update_boundary_forms"))); - return this->mapping_output.boundary_forms[i]; + return this->mapping_output.boundary_forms[q_point]; } #endif // DOXYGEN