From b45b633c95d0608c9e15b15d62218fb2e66684fe Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 30 May 2002 18:20:35 +0000 Subject: [PATCH] access dot shape gradients eliminated git-svn-id: https://svn.dealii.org/trunk@5946 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/numerics/matrices.cc | 41 +++++++++------------ deal.II/deal.II/source/numerics/vectors.cc | 12 ++---- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index 3301ada851..4f57642b4e 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -980,9 +980,6 @@ void MatrixCreator::create_laplace_matrix_1 (const Mapping &mapping, cell_matrix.clear (); cell->get_dof_indices (dof_indices); - const std::vector > > - &grads = fe_values.get_shape_grads (); - if (coefficient != 0) { if (coefficient->n_components==1) @@ -994,14 +991,14 @@ void MatrixCreator::create_laplace_matrix_1 (const Mapping &mapping, const double weight = fe_values.JxW(point); for (unsigned int i=0; i& Dv = fe_values.shape_grad(i,point); for (unsigned int j=0; j& Du = fe_values.shape_grad(j,point); if ((n_components==1) || (fe.system_to_component_index(i).first == fe.system_to_component_index(j).first)) - cell_matrix(i,j) += (grads[i][point] * - grads[j][point] * - weight * + cell_matrix(i,j) += (Du * Dv * weight * coefficient_values[point]); } } @@ -1016,15 +1013,15 @@ void MatrixCreator::create_laplace_matrix_1 (const Mapping &mapping, const double weight = fe_values.JxW(point); for (unsigned int i=0; i& Dv = fe_values.shape_grad(i,point); const unsigned int component_i= fe.system_to_component_index(i).first; for (unsigned int j=0; j& Du = fe_values.shape_grad(j,point); if ((n_components==1) || (fe.system_to_component_index(j).first == component_i)) - cell_matrix(i,j) += (grads[i][point] * - grads[j][point] * - weight * + cell_matrix(i,j) += (Du * Dv * weight * coefficient_vector_values[point](component_i)); } @@ -1038,14 +1035,14 @@ void MatrixCreator::create_laplace_matrix_1 (const Mapping &mapping, const double weight = fe_values.JxW(point); for (unsigned int i=0; i& Dv = fe_values.shape_grad(i,point); for (unsigned int j=0; j& Du = fe_values.shape_grad(j,point); if ((n_components==1) || (fe.system_to_component_index(i).first == fe.system_to_component_index(j).first)) - cell_matrix(i,j) += (grads[i][point] * - grads[j][point] * - weight); + cell_matrix(i,j) += (Du * Dv * weight); } } } @@ -1177,8 +1174,6 @@ MatrixCreator::create_laplace_matrix_2 (const Mapping &mapping, local_rhs.clear (); cell->get_dof_indices (dof_indices); - const std::vector > > - &grads = fe_values.get_shape_grads (); rhs.value_list (fe_values.get_quadrature_points(), rhs_values); if (coefficient != 0) @@ -1193,14 +1188,14 @@ MatrixCreator::create_laplace_matrix_2 (const Mapping &mapping, for (unsigned int i=0; i& Dv = fe_values.shape_grad(i,point); for (unsigned int j=0; j& Du = fe_values.shape_grad(j,point); if ((n_components==1) || (fe.system_to_component_index(i).first == fe.system_to_component_index(j).first)) - cell_matrix(i,j) += (grads[i][point] * - grads[j][point] * - weight * + cell_matrix(i,j) += (Du * Dv * weight * coefficient_values[point]); local_rhs(i) += v * rhs_values[point] * weight; } @@ -1217,15 +1212,15 @@ MatrixCreator::create_laplace_matrix_2 (const Mapping &mapping, for (unsigned int i=0; i& Dv = fe_values.shape_grad(i,point); const unsigned int component_i= fe.system_to_component_index(i).first; for (unsigned int j=0; j& Du = fe_values.shape_grad(j,point); if ((n_components==1) || (fe.system_to_component_index(j).first == component_i)) - cell_matrix(i,j) += (grads[i][point] * - grads[j][point] * - weight * + cell_matrix(i,j) += (Du * Dv * weight * coefficient_vector_values[point](component_i)); local_rhs(i) += v * rhs_values[point] * weight; } @@ -1240,14 +1235,14 @@ MatrixCreator::create_laplace_matrix_2 (const Mapping &mapping, for (unsigned int i=0; i& Dv = fe_values.shape_grad(i,point); for (unsigned int j=0; j& Du = fe_values.shape_grad(j,point); if ((n_components==1) || (fe.system_to_component_index(i).first == fe.system_to_component_index(j).first)) - cell_matrix(i,j) += (grads[i][point] * - grads[j][point] * - weight); + cell_matrix(i,j) += (Du * Dv * weight); local_rhs(i) += v * rhs_values[point] * weight; } } diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index 0d7a2ae07d..f1086644ac 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -484,7 +484,6 @@ void VectorTools::create_right_hand_side (const Mapping &mapping, { fe_values.reinit(cell); - const FullMatrix &values = fe_values.get_shape_values (); const std::vector &weights = fe_values.get_JxW_values (); rhs_function.value_list (fe_values.get_quadrature_points(), rhs_values); @@ -492,7 +491,7 @@ void VectorTools::create_right_hand_side (const Mapping &mapping, for (unsigned int point=0; pointget_dof_indices (dofs); @@ -510,7 +509,6 @@ void VectorTools::create_right_hand_side (const Mapping &mapping, { fe_values.reinit(cell); - const FullMatrix &values = fe_values.get_shape_values (); const std::vector &weights = fe_values.get_JxW_values (); rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values); @@ -522,7 +520,7 @@ void VectorTools::create_right_hand_side (const Mapping &mapping, = fe.system_to_component_index(i).first; cell_vector(i) += rhs_values[point](component) * - values(i,point) * + fe_values.shape_value(i,point) * weights[point]; } @@ -595,7 +593,6 @@ VectorTools::create_boundary_right_hand_side (const Mapping &mapping, { fe_values.reinit(cell, face); - const FullMatrix &values = fe_values.get_shape_values (); const std::vector &weights = fe_values.get_JxW_values (); rhs_function.value_list (fe_values.get_quadrature_points(), rhs_values); @@ -603,7 +600,7 @@ VectorTools::create_boundary_right_hand_side (const Mapping &mapping, for (unsigned int point=0; pointget_dof_indices (dofs); @@ -625,7 +622,6 @@ VectorTools::create_boundary_right_hand_side (const Mapping &mapping, { fe_values.reinit(cell, face); - const FullMatrix &values = fe_values.get_shape_values (); const std::vector &weights = fe_values.get_JxW_values (); rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values); @@ -637,7 +633,7 @@ VectorTools::create_boundary_right_hand_side (const Mapping &mapping, = fe.system_to_component_index(i).first; cell_vector(i) += rhs_values[point](component) * - values(i,point) * + fe_values.shape_value(i,point) * weights[point]; } -- 2.39.5